Hi, Am Donnerstag, den 04.09.2008, 22:10 +0200 schrieb Luca Capello: > On Wed, 13 Aug 2008 16:27:28 +0200, Timo Juhani Lindfors wrote: > > ginger:~# /etc/init.d/zhone-session restart > > /usr/bin/xinit already running. > > This is mostly annoying when you upgrade zhone-session, since the > upgrade exits with an error. That shoudn’t anymore, as we don’t restart on upgrad anymore. (Not that this fixes anything).
> The following patch is a possible
> solution, for sure not the best, but anyway Joachim is improving the
> general situation (and I don't like non-fixed bugs).
>
> --8<---------------cut here---------------start------------->8---
> --- /etc/init.d/zhone-session.ORG 2008-09-04 21:57:57.000000000 +0200
> +++ /etc/init.d/zhone-session 2008-09-04 22:04:32.000000000 +0200
> @@ -35,8 +35,12 @@
> case "$1" in
> start)
> [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
> - start-stop-daemon --start --pidfile ${PIDFILE} --make-pidfile
> --background --exec ${PROG_XINIT} -- ${PROG_XSESSION} ${PROG_FSO} --
> $X_OPTIONS
> - [ "$VERBOSE" != no ] && log_end_msg $?
> + if pidof /usr/bin/xinit >/dev/null; then
> + echo "W: zhone-session is already running, not starting."
> + else
> + start-stop-daemon --start --pidfile ${PIDFILE}
> --make-pidfile --background --exec ${PROG_XINIT} -- ${PROG_XSESSION}
> ${PROG_FSO} -- $X_OPTIONS
> + [ "$VERBOSE" != no ] && log_end_msg $?
> + fi
> ;;
> stop)
> [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
> --8<---------------cut here---------------end--------------->8---
>
> Comments?
Not sure what you are trying to do there. starting the daemon when it’s
already running is an error, isn’t it?
The problem is that restart is too fast, maybe a "sleep" needs to be put
in between the $0 stop; $0 start commands. Or maybe adding a "-R 1" to
the start-stop-daemon --stop command line is what we want (see the
manpage for more infos).
Greetings,
Joachim
--
Joachim "nomeata" Breitner
Debian Developer
[EMAIL PROTECTED] | ICQ# 74513189 | GPG-Keyid: 4743206C
JID: [EMAIL PROTECTED] | http://people.debian.org/~nomeata
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

