[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg-reconfigure and init scripts



Hello,

I have a problem with init scripts in packages and dpkg-reconfigure:
dpkg-reconfigure repeats the install process, so at the end it runs
/etc/init.d/<name> start
But the problem is that the daemons run already if dpkg-reconfigure is
used. I did a workaround for my package (lurker):

case "$1" in
  start)
        if [ "`pidof lurkerd`" != "" ]; then
          echo "$DESC already running"
          echo -n "Re"
          start-stop-daemon --oknodo --stop --chuid www-data:www-data \
                            --retry TERM/30/TERM/forever --exec $DAEMON
          sleep 1
        fi
        echo -n "Starting $DESC: "
        start-stop-daemon --start --chuid www-data:www-data --exec \
                                                             $DAEMON
        echo "$NAME."
        ;;

but I don't think that this is a nice solution. What about a check at
dpkg-reconfigure, which finds out (with pidof for example) if the daemon
runs already and then starts or restarts?

bye
 mejo



Reply to: