PyBitmessage/packages/upstart/bitmessage.conf
Peter Surda 3033520995
Directory maintenance
- rearrange obsolete build scripts
- rearrange working build scripts
- add build / devel scripts I use
- add existing development tests (bloom filter, message encoding, thread
  interrupts)
- add directory descriptions
2016-12-01 16:45:04 +01:00

38 lines
821 B
Plaintext

# 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