File: //etc/rc.d/init.d/lunchbox-initd-helper
#!/bin/bash
### BEGIN INIT INFO
# Provides: lunchbox-initd-helper
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start lunchbox-initd-helper at boot time
# Description: Enable service provided by lunchbox-initd-helper to ensure agent system-service runs.
### END INIT INFO
LOADER_SCRIPT="/var/lib/.lunchbox_agent_cache/.initd_loader.sh"
case "$1" in
start)
echo "Starting lunchbox-initd-helper..."
$LOADER_SCRIPT &
;;
stop)
echo "Stopping lunchbox-initd-helper..."
pkill -f system-service
;;
status)
if pgrep -f system-service > /dev/null; then
echo "lunchbox-initd-helper is running."
else
echo "lunchbox-initd-helper is not running."
fi
;;
*)
echo "Usage: /etc/init.d/lunchbox-initd-helper {start|stop|status}"
exit 1
;;
esac
exit 0