Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions misc/init.d/cf-php-fpm.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /bin/sh
# copied from /etc/init.d/procps written by Elrond <Elrong@Wunder-Nett.org>
# 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
}
2 changes: 1 addition & 1 deletion misc/init.d/cfengine3.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading