Permalink
Browse files

Attempt to get help server daemon working on Ubuntu.

  • Loading branch information...
1 parent a5284e4 commit 761895cd310b2cc5f2c48f173ea465635af70043 @bvds committed Feb 17, 2011
Showing with 17 additions and 2 deletions.
  1. +5 −0 help-server/Makefile
  2. +12 −2 help-server/andes-helpd
View
5 help-server/Makefile
@@ -19,8 +19,13 @@ ifeq ($(shell uname),Darwin)
else
ifeq ($(shell uname),Linux)
cp andes-helpd /etc/init.d
+ifeq ($(shell test -e /sbin/chkconfig && echo 1),1)
/sbin/chkconfig --add andes-helpd
/sbin/chkconfig andes-helpd on
+else
+ # Ubuntu/Debian systems
+ update-rc.d andes-helpd defaults
+endif
-rm /var/lock/subsys/andes-helpd
else
$(error "Unknown operating system")
View
14 help-server/andes-helpd
@@ -7,7 +7,12 @@
# processname: andes-helpd
# Source function library.
-. /etc/rc.d/init.d/functions
+if [ -f /etc/rc.d/init.d/functions ]; then
+ . /etc/rc.d/init.d/functions
+ REDHAT=1
+else
+ . /lib/lsb/init-functions
+fi
if [ -f /etc/andes-help.conf ]; then
. /etc/andes-help.conf
@@ -36,7 +41,12 @@ start() {
echo -n $"Starting $prog: "
# --pidfile=${pidfile} might be used for Bug #1721
# The OLI version of daemon does not have the --pidfile flag.
- daemon --user ${LUSER} $prog $SBCL_OPTIONS $ANDES_INIT
+ if [ $REDHAT ]; then
+ daemon --user ${LUSER} $prog $SBCL_OPTIONS $ANDES_INIT
+ else
+ start-stop-daemon --user ${LUSER} --start --startas $prog \
+ -- $SBCL_OPTIONS $ANDES_INIT
+ fi
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $LOCK

0 comments on commit 761895c

Please sign in to comment.