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

Re: best way to check for an active X session from a maintainer script?

On Tue, 11 Sep 2007 00:07:52 -0700
Steve Langasek <vorlon@debian.org> wrote:

> The problem is that some of the services that have to be restarted are
> display managers, and restarting them will kill any active X sessions.  The
> question is, where should the line be drawn between trying to automatically
> restart these services, and warning the user that services could not be
> safely restarted?

In my case, the service that needed to be restarted (relating to X) was
gdm and I suffered the abrupt termination of my X session. (I have a
slow internet connection and need to run apt-get upgrade in the
background whilst doing other things.)

Can't gdm and similar be "scheduled" for a reload instead of actually
forced into an immediate reload?

Just looking at the gdm source, debian/gdm.init contains:
        log_daemon_msg "Scheduling reload of GNOME Display Manager configuration" "gdm"
        set +e
        start-stop-daemon --stop --signal USR1 --quiet --pidfile \
                /var/run/gdm.pid --name gdm 
        set -e
        log_end_msg $?

That way, the user can continue with the X session and the reload takes
place at logout. A suitable reminder can be output to remind the user
to actually logout - much like the kernel packages remind users to

I thought I'd seen the same behaviour in kdm and xdm but it's been a
while since I looked at those.


Neil Williams

Attachment: pgpVKGoF8jt1E.pgp
Description: PGP signature

Reply to: