Daemon Task Runner in Ubuntu
Make minion and miniond executable
chmod
0755
minion
chmod
0755
miniond
Create an Upstart conf file
cd /etc/init
sudo nano pingapp-process.conf
Copy the following into pingapp-process.conf. Make sure to modify PINGAPP_HOME#
# PingApp Queue PROCESS Daemon Control
#
description
"PingApp Daemon Processing"
author
"PingApp"
# Debugging
#console log
console none
# Configuration variables
env
PINGAPP_HOME=
/srv/www/ping
.ushahidi.com
/public_html
# Tell Upstart to respawn our command on a crash
# stop restarting if it crashes more then 5 times within 10 seconds
respawn
respawn limit 5 10
# Tell Upstart to start us after MySQL started and shut us down on system shutdown
start on started mysql
stop on runlevel S
# Run as the www-data user and group (same as Apache is under in Ubuntu)
setuid www-data
setgid www-data
# The command Upstart should execute to start our daemon
script
# Navigate to PingApp directory
chdir $PINGAPP_HOME
# Run the script
exec
.
/miniond
--task=
ping
--subtask=process
end script
To start the daemon:
sudo start pingapp-process