Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
self
/
root
/
srv
/
admin
/
scripts
/
init.d
/
//proc/self/root/srv/admin/scripts/init.d/apache2
#!/bin/bash # Enable errexit option: this explains why we almost never check return values. # We want this script to exit (with exitcode > 0) if anything goes wrong. set -e . /lib/start-lib.sh . /srv/admin/scripts/init-lib.sh NAME=apache2 DAEMON="/opt/apache2-2.4/usr/sbin/$NAME" DAEMON_ARGS="-d $CUSTOMER_DIR/.config/apache -f apache2.conf" PIDFILE="$LOCAL_DIR/apache/apache.pid" do_setup() { [ -d "$LOCAL_DIR/apache" ] || \ do_as "$APP_USER" install -d "$LOCAL_DIR/apache" } do_start() { APACHE_PID_FILE="$PIDFILE" \ do_as "$APP_USER" "$DAEMON" $DAEMON_ARGS wait_for_pidfile created "$PIDFILE" } do_stop() { do_as "$APP_USER" /sbin/start-stop-daemon \ --pidfile "$PIDFILE" --stop --retry 20 } do_reload() { do_as "$APP_USER" /sbin/start-stop-daemon \ --pidfile "$PIDFILE" --stop --signal USR1 } do_status() { local c c=$(do_as "$APP_USER" pgrep -c apache2) [ "$c" -ge 2 ] } case "$1" in start) echo "Starting $NAME" do_setup do_start ;; stop) echo "Stopping $NAME" do_stop ;; reload) do_reload ;; status) do_status ;; *) echo "Usage: $0 {start|stop|reload|status}" exit 1 ;; esac