From 2c49e04c9847fe55ec4b64fe815ce0fe36e79766 Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Thu, 24 Mar 2016 11:22:09 +0100 Subject: [PATCH] Updated the exlorer for more systems changed the ps syntax, so it should work on freebsd to added a case so it could easy implemented for other os to --- cdist/conf/explorer/init | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cdist/conf/explorer/init b/cdist/conf/explorer/init index 3777b431..a9cdd0d3 100755 --- a/cdist/conf/explorer/init +++ b/cdist/conf/explorer/init @@ -18,7 +18,19 @@ # along with cdist. If not, see . # # -# Check whether the given name will be started on boot or not +# Returns the process name of pid 1 ( normaly the init system ) +# for example at linux this value is "init" or "systemd" in most cases # -ps -o comm= --pid 1 +uname_s="$(uname -s)" + +case "$uname_s" in + Linux|FreeBSD) + ps -o comm= -p 1 || true + exit 0 + ;; + *) + echo "init exlorer needs to be implemented for $os" >&2 + exit 1 + ;; +esac