diff --git a/misc/init.d/cf-php-fpm.in b/misc/init.d/cf-php-fpm.in new file mode 100644 index 0000000000..7d217655a2 --- /dev/null +++ b/misc/init.d/cf-php-fpm.in @@ -0,0 +1,35 @@ +#! /bin/sh +# copied from /etc/init.d/procps written by Elrond +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: cf-php-fpm +# Required-Start: +# Required-Stop: +# Should-Start: +# X-Start-Before: +# Default-Start: S +# Default-Stop: +# Short-Description: Start CFEngine Mission Portal php-fpm service +# Description: CFEngine Enterprise PHP FastCGI Process Manager +### END INIT INFO + +# shellcheck disable=SC2034 +DESC=cf-php-fpm +PREFIX=${CFTEST_PREFIX:-@workdir@} +DAEMON=$PREFIX/httpd/php/sbin/php-fpm +PIDFILE=$PREFIX/httpd/php-fpm.pid + +do_start_cmd() { + STATUS=0 + "$DAEMON" --pid "$PIDFILE" --force-stderr || STATUS="$?" + return $STATUS +} + +do_stop_cmd() { + if [ -f "$PIDFILE" ]; then + kill -9 "-$(cat "$PIDFILE")" + fi +} diff --git a/misc/init.d/cfengine3.in b/misc/init.d/cfengine3.in index 6017e7e212..bb320630a8 100644 --- a/misc/init.d/cfengine3.in +++ b/misc/init.d/cfengine3.in @@ -150,7 +150,7 @@ fi CURRENT_PS_UID=__none__ INSIDE_CONTAINER=-1 -if ps --help 2>/dev/null | egrep -e '--cols\b' > /dev/null || ps --help output 2>/dev/null | egrep -e '--cols\b'; then +if ps --help 2>/dev/null | egrep -e '--cols\b' > /dev/null || ps --help output 2>/dev/null | egrep -e '--cols\b' > /dev/null; then # There is a bug in SUSE which means that ps output will be truncated even # when piped to grep, if the terminal size is small. However using --cols # will override it. NOTE: On Suse 12 and 15, `ps` mentions `--cols` only