First of all read http://upstart.ubuntu.com/getting-started.html upstart is beautiful 🙂 If your linux supports it.
But in some systems you should use old init style scripts 🙁
cp /etc/init.d/sceleton /etc/init.d/rec-runner
and edit it.
/etc/init.d/rec-runner
do_stop()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5/9 --pidfile $PIDFILE
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5/9 --pidfile $PIDFILE
/home/scripts/rec-runner
#!/bin/sh
sudo -u mahout java -jar -server some variables \
some other variables \
> /var/log/recommender.log 2>&1 & echo $! > /var/run/rec-runner.pid
#EOF
sudo -u mahout java -jar -server some variables \
some other variables \
> /var/log/recommender.log 2>&1 & echo $! > /var/run/rec-runner.pid
#EOF
update-rc.d rec-runner defaults
0 Comments.