Merge pull request #556 from uqam-fob/explorer-init-pgrep

explorer/init/Linux: use pgrep instead of ps
This commit is contained in:
Darko Poljak 2017-08-25 11:31:42 +02:00 committed by GitHub
commit c6d00019a8

View file

@ -1,6 +1,7 @@
#!/bin/sh
#
# 2016 Daniel Heule (hda at sfs.biz)
# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
#
# 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;}') || true
;;
FreeBSD)
ps -o comm= -p 1 || true
;;
*)