#!/bin/sh ### BEGIN INIT INFO # Provides: xphclogd # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/stop xphclog daemon ### END INIT INFO # Set the USER variable to the name of the user to start xphclogd under export USER='pi' ### End customization required eval cd ~$USER case "$1" in start) echo "Starting xphclog for $USER " su $USER -c 'cd /home/pi/xphclog; ./xphclogd.raspi --ini xphclogd.ini --loglevel 0xffffffff &' ;; stop) pkill xphclogd echo "xphclog daemon stopped" ;; *) echo "Usage: /etc/init.d/xphclogd {start|stop}" exit 1 ;; esac exit 0