Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Switch to proper pid directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tvollmer-at-is24 committed Jan 22, 2016
1 parent 8da4aa4 commit ef50b77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,20 @@
# set alppaca to autostart
/sbin/chkconfig alppaca on

if [ ! -d /var/run/alppacad ]; then
if [ -e /var/run/alppacad ]; then
rm /var/run/alppacad
fi
mkdir -p /var/run/alppacad
chown alppaca:alppaca /var/run/alppacad/
fi

# Move old pid file to new place. This can be removed later on
if [ -f /tmp/alppaca.pid ] && kill -0 $(cat /tmp/alppaca.pid); then
mv /tmp/alppaca.pid /var/run/alppacad/alppacad.pid
fi

# Restart Service if running
if service alppaca status; then
service alppaca restart
fi
2 changes: 1 addition & 1 deletion src/main/scripts/alppacad
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ class AlppacaDaemon(Daemon):

if __name__ == "__main__":
# FIXME: Use proper pid file directory
alppaca = AlppacaDaemon(pid_file="/tmp/alppaca.pid")
alppaca = AlppacaDaemon(pid_file="/var/run/alppacad/alppacad.pid")
sys.exit(alppaca.action())

0 comments on commit ef50b77

Please sign in to comment.