From 5646a66f6c6b5f5dd66f69d63709825af9e99a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Gr=C3=A9goire?= Date: Sun, 20 Aug 2017 11:06:07 -0400 Subject: [PATCH] explorer/init/Linux: replace ps by pgrep BusyBox's version of ps does not support the -o option. On Linux systems, use pgrep -P0 -l to get the name of pid 1. --- cdist/conf/explorer/init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cdist/conf/explorer/init b/cdist/conf/explorer/init index 2693a0d3..54784a2e 100755 --- a/cdist/conf/explorer/init +++ b/cdist/conf/explorer/init @@ -1,6 +1,7 @@ #!/bin/sh # # 2016 Daniel Heule (hda at sfs.biz) +# Copyright 2017, Philippe Gregoire # # This file is part of cdist. # @@ -25,7 +26,10 @@ uname_s="$(uname -s)" case "$uname_s" in - Linux|FreeBSD) + Linux) + pgrep -P0 -l | awk '/^1[ \t]/ {print $2;}' + ;; + FreeBSD) ps -o comm= -p 1 || true ;; *)