[05:06] <twb> Currently "shutdown -r 10" will send a whole bunch of useful wall(8)-like messages to users on ttys.
[05:06] <twb> But users on a GUI aren't notified.  I need to fix this.
[05:07] <twb> Is there an alternative to dpkg-diverting /sbin/shutdown and adding a horrible wrapper there?
[05:10] <twb> I think the "right" thing is for the shutdown(8) source to be changed to generate notification-daemon events if it detects dbus is running, but that's kinda hard for me to do on my own.
[05:47] <sadmac> twb: that's close to the right thing...
[05:47] <sadmac> not that I can improve it.
[05:49] <twb> AFAICT if I don't want to use a wrapper and don't want to HTFS of upstart itself, I need to make a python daemon that starts when the user logs in.  It creates a new /dev/pts/N and adds a record in /var/run/[uw]tmp.  That means that shutdown(8) will write to it.  Then, it relays that information to notification-daemon or something.
[05:51] <twb> There's a utility called "gshutdown" that seems to be close to what I want, except that it also wants to replace shutdown(8) with itself.
[05:52] <sadmac> twb: ugh. creating that python daemon and then having it listen for a custom dbus signal and relay that information is probably a tad closer to right.
[05:52] <twb> shutdown(8) doesn't send a dbus signal
[05:53] <twb> Not until the reboot/shutdown actually begins -- I need to notify the user at e.g. 5 and 10 minutes beforehand, so they can save their work
[05:54] <twb> This is basically for workstations that have a curfew, so they automatically shutdown at e.g. 9PM each night.
[05:55] <sadmac> twb: you should use shutdown -r now from some other script then
[05:55] <twb> You mean, from a wrapper script that uses e.g. zenity to manually warn the user in advance?
[05:59] <sadmac> yes
[06:00] <twb> That is plan B, because it's bloody awful.
[06:00] <twb> I mean, the script would have to find the user's XAUTHORITY file and DISPLAY and then use them to break into the user's GUI
[06:00] <twb> (Because the script runs as root.)
[06:06] <twb> sadmac: sweet, /usr/share/doc/python-notify/examples/test-basic.py gets nearly half the problem solved
[06:09] <sadmac> interesting... libnotify doesn't have a system-wide notice thingy.
[06:11] <twb> Yeah, but I can launch it per-user in /etc/X11/Xsession.d/ as long as I can get it to have a pty, since then shutdown(8) will talk to that pty.
[06:12] <sadmac> cool
[07:19] <twb> So apparently that clever plan has gone to shit because /var/run/utmp isn't writable by users.
[07:22] <twb> Or: setgid utmp the python script...
[11:47] <mgoetze> eh... i'm having a problem with upstart 0.3.9 ... i created /etc/event.d/pleskinstall but i get "status: Unknown job: pleskinstall"