Package: xfree86-driver-synaptics
Severity: wishlist
Version: 0.14.0-1
Tag: patch

current syndaemon lacks an init script for "automatic" manipulation 
through runlevel for the user.
attached is the contribution of an init script based on the 
skeleton debian init script.

as of current syndaemon version the daemon has no pidfile
the init scripts needs to be named differently than the
daemon itself or the init script gets killed on stop or 
on restart..  i choose synaptics for the init script name, 
as an user may easily find it.

the synaptics init script has an option string.
please review it for generic usage before inclusion.
in long term it would be cool to add an config file,
but that's another story ;)

you will need to call dh_installinit in rules
dh_installinit --name=synaptics

you may want to add start-up and stop links with update-rc.d
attached therefor a postinst, a prerm and a postrm.
but i guess that may be an overkill for now as the user
still needs X11 config manipulation before he gets a
usefull syndaemon.


hope that helps + best regards

--
maks

#! /bin/sh
#
# based on:
# Version:      @(#)skeleton  2.85-23  28-Jul-2004  [EMAIL PROTECTED]
#
# adapted due to current lack of syndaemon pidfile

set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="keyboard monitor"
NAME=syndaemon
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# Read config file if it is present.
# FIXME: no config yet, therefor OPTIONS variable
#if [ -r /etc/default/$NAME ]
#then
#       . /etc/default/$NAME
#fi
OPTIONS="-d -i 1 -t"


#
#       function that starts syndaemon
#
syndaemon_start() 
{
        start-stop-daemon --start --quiet \
                --exec $DAEMON -- $OPTIONS \
                || echo -n " already running"
}

#
#       function that stops syndaemon
#
syndaemon_stop() 
{
        start-stop-daemon --stop --quiet --name $NAME \
                || echo -n " not running"
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        syndaemon_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        syndaemon_stop
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        syndaemon_stop
        sleep 1
        syndaemon_start
        echo "."
        ;;
  *)
         echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
         exit 1
         ;;
esac

exit 0
#!/bin/sh

set -e

if [ -x /etc/init.d/gdm ]; then
        update-rc.d synaptics defaults >/dev/null 2>&1
fi
#!/bin/sh

set -e

if [ "$1" = "remove" ]; then
        if [ -x /etc/init.d/synaptics ]; then
                invoke-rc.d synaptics stop
        fi
fi
#!/bin/sh

set -e

if [ "$1" = "purge" ] ; then
        update-rc.d synaptics remove >/dev/nul
fi

Reply via email to