Public bug reported:

Binary package hint: ircd-irc2

The script to start the IRC server blocks.

I changed the script to use the log_begin/end_msg functions and to make
use of the --background.

Also, somehow, it does not create the .pid file. That I think is because
we start the server with user:group irc:irc. This prevents it from
opening the .pid file (permission denied).

Thus, I changed the stop using the name of the exec rather than the .pid
file.

That works for me.

The changes are below.

Alexis Wilke


#!/bin/sh
#
# Starts/stops the irc daemon
#

set -e

# $PATH to go
PATH=/sbin:/bin:/usr/sbin:/usr/bin
          
# where the irc-daemon is
IRCD=/usr/sbin/ircd
PIDFILE=/var/run/ircd.pid                  


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

. /lib/lsb/init-functions

case "$1" in
       
       start)
               log_begin_msg "Starting irc server daemon: ircd"
               start-stop-daemon --start --background --chuid irc --exec ${IRCD}
                       #>> /dev/null 2>&1
               log_end_msg $?
               ;;
 
       stop)
               log_begin_msg "Stopping irc server daemon: ircd"
               start-stop-daemon --stop --quiet --oknodo --exec ${IRCD}
               log_end_msg $?
               ;;

       reload|force-reload)
               log_begin_msg "Reloading irc server daemon: ircd"
               start-stop-daemon --stop --signal 1 --quiet --exec ${IRCD}
               log_end_msg $?
               ;;

       restart)
               log_begin_msg "Restarting irc server daemon: ircd"
               start-stop-daemon --stop --quiet --oknodo --exec ${IRCD}
               sleep 1
               start-stop-daemon --start --background --chuid irc --exec ${IRCD}
               log_end_msg $?
               ;;
       *)
               echo "Usage: $0 {start|stop|restart|reload|force-reload}"
               exit 1
               ;;
esac

exit 0

** Affects: ircd-irc2 (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
ircd-irc2 hangs boot process
https://launchpad.net/bugs/90554

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to