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:06 |
twb | Is there an alternative to dpkg-diverting /sbin/shutdown and adding a horrible wrapper there? | 05:07 |
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:10 |
sadmac | twb: that's close to the right thing... | 05:47 |
sadmac | not that I can improve it. | 05:47 |
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:49 |
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:51 |
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:52 |
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:53 |
twb | This is basically for workstations that have a curfew, so they automatically shutdown at e.g. 9PM each night. | 05:54 |
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:55 |
sadmac | yes | 05:59 |
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:00 |
twb | sadmac: sweet, /usr/share/doc/python-notify/examples/test-basic.py gets nearly half the problem solved | 06:06 |
sadmac | interesting... libnotify doesn't have a system-wide notice thingy. | 06:09 |
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:11 |
sadmac | cool | 06:12 |
twb | So apparently that clever plan has gone to shit because /var/run/utmp isn't writable by users. | 07:19 |
twb | Or: setgid utmp the python script... | 07:22 |
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" | 11:47 |
=== robbiew1 is now known as robbiew | ||
=== robbiew1 is now known as robbiew |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!