Daemon stop/start updates

This commit is contained in:
dschmenk 2013-09-22 16:14:50 -07:00
parent 8b9808872d
commit 45205cc788
5 changed files with 35 additions and 9 deletions

View File

@ -1,5 +1,5 @@
PACKAGE=a2pi PACKAGE=a2pi
VERSION=0.1.0 VERSION=0.1.1
DIST=$(PACKAGE)-$(VERSION) DIST=$(PACKAGE)-$(VERSION)
DISTDIR=./$(DIST) DISTDIR=./$(DIST)

18
debian/changelog vendored
View File

@ -1,3 +1,21 @@
a2pi (0.1.1-2) unstable; urgency=low
* Add user 'pi' to group 'fuse'
-- David Schmenk <dschmenk@gmail.com> Sun, 22 Sep 2013 15:16:00 -0700
a2pi (0.1.1-1) unstable; urgency=low
* Clean up daemon restart code
-- David Schmenk <dschmenk@gmail.com> Sun, 22 Sep 2013 15:00:00 -0700
a2pi (0.1.0-4) unstable; urgency=low
* Remove hard-coded path in a2mount
-- David Schmenk <dschmenk@gmail.com> Sun, 22 Sep 2013 14:32:30 -0700
a2pi (0.1.0-3) unstable; urgency=low a2pi (0.1.0-3) unstable; urgency=low
* Fix for daemon start * Fix for daemon start

15
debian/init.d vendored
View File

@ -63,20 +63,21 @@ do_stop()
# 1 if daemon was already stopped # 1 if daemon was already stopped
# 2 if daemon could not be stopped # 2 if daemon could not be stopped
# other if a failure occurred # other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME #start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?" #RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2 #[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks # Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript. # and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code # If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be # that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to # needed by services started subsequently. A last resort is to
# sleep for some time. # sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2 #[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit. # Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE #rm -f $PIDFILE
return "$RETVAL" #return "$RETVAL"
killall $NAME
} }
# #

7
debian/postinst vendored
View File

@ -46,10 +46,15 @@ case "$1" in
cp /usr/share/a2pi/11-joy.conf /usr/share/X11/xorg.conf.d cp /usr/share/a2pi/11-joy.conf /usr/share/X11/xorg.conf.d
fi fi
# #
# Add default Pi user,pi, to groups fuse and input
#
addgroup pi fuse
# addgroup pi input # already there by default
#
# Add schmenk.is-a-geek.com to apt sources # Add schmenk.is-a-geek.com to apt sources
# #
if [ "$(grep schmenk /etc/apt/sources.list)" = "" ] ; then if [ "$(grep schmenk /etc/apt/sources.list)" = "" ] ; then
echo "deb http://schmenk.is-a-geek.com/raspbian wheezy contrib extra" >> /etc/apt/sources.list echo "deb http://schmenk.is-a-geek.com/raspbian wheezy contrib" >> /etc/apt/sources.list
fi fi
# #
# Remove old install # Remove old install

View File

@ -637,6 +637,8 @@ void main(int argc, char **argv)
/* /*
* Add signal handlers. * Add signal handlers.
*/ */
if (signal(SIGTERM, sig_bye) == SIG_ERR)
die("signal");
if (signal(SIGINT, sig_bye) == SIG_ERR) if (signal(SIGINT, sig_bye) == SIG_ERR)
die("signal"); die("signal");
if (signal(SIGHUP, sig_bye) == SIG_ERR) if (signal(SIGHUP, sig_bye) == SIG_ERR)