Added upstart script
This commit is contained in:
parent
8df8d15cba
commit
fe97c58222
37
upstart/bitmessage.conf
Normal file
37
upstart/bitmessage.conf
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# This is an upstart script for bitmessage for when using daemon mode
|
||||||
|
# Bitmessage forks more than twice before daemonizing, so a workaround is
|
||||||
|
# necessary
|
||||||
|
|
||||||
|
description "bitmessage"
|
||||||
|
author "Peter Surda"
|
||||||
|
|
||||||
|
start on (local-filesystems and net-device-up)
|
||||||
|
stop on runlevel [!2345]
|
||||||
|
|
||||||
|
setuid bitmessage
|
||||||
|
setgid bitmessage
|
||||||
|
|
||||||
|
chdir /home/bitmessage
|
||||||
|
env HOME="/home/bitmessage"
|
||||||
|
|
||||||
|
pre-start script
|
||||||
|
/usr/src/PyBitmessage/src/bitmessagemain.py
|
||||||
|
end script
|
||||||
|
|
||||||
|
script
|
||||||
|
while [ ! -f $HOME/.config/PyBitmessage/singleton.lock ]; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
while [ -f $HOME/.config/PyBitmessage/singleton.lock ]; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
end script
|
||||||
|
|
||||||
|
post-stop script
|
||||||
|
if [ -f $HOME/.config/PyBitmessage/singleton.lock ]; then
|
||||||
|
pid=`lsof -F p $HOME/.config/PyBitmessage/singleton.lock|cut -b2-`
|
||||||
|
if [ -n "$pid" ]; then
|
||||||
|
kill $pid
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
end script
|
Loading…
Reference in New Issue
Block a user