Open chenweiyj opened 9 years ago
instead put the script in /etc/init.d
creat a script in /etc/init/
and use something like this
#!upstart
description "Strider upstart job"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on shutdown
script
export PORT=
export DB_URI=""
export SMTP_HOST=""
export SMTP_PORT=""
export SMTP_USER=""
export SMTP_PASS=""
export SERVER_NAME=""
export STRIDER_CLONE_DEST=""
export PLUGIN_GITHUB_APP_ID=""
export PLUGIN_GITHUB_APP_SECRET=""
echo $$ > /var/run/strider.pid
exec
/path/to/strider/bin/strider >> /var/log/strider.log 2>&1
end script
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/strider.log
end script
pre-stop script
rm /var/run/strider.pid
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/strider.log
end script
I find the document of
strider
shows we can runstrider
by typingstrider
in the terminal. However, it does not show how to run it as a daemon service. I write a service script to put it into /etc/init.d/. But the strider process is killed directly after started. I need some help. Thank you.Here is my service script: