On Sat, 2014-11-01 at 19:48 +0100, Thomas Liske wrote: > needrestart git HEAD has reached experimental. It contains a new > notification feature to notify user sessions about obsolete processes.
Great idea! > Im looking for feedback on the idea and implementation - could you > please give it a try? Under gnome-shell classic mode I didn't see the user notification, possibly because I was running needrestart as root from a virtual console, my gnome-shell session was entirely separate and I didn't switch back to my gnome-shell session until after needrestart completed. When I switch back to my session immediately the situation is better but not by much, there is a notification in the notification area but the notifications indicator in the gnome-shell classic mode only lists the count of notifications. The notification itself contains HTML tags. The notification in my case listed processes that would be automatically restarted if I manually kill them (evolution mail client related services), a process that would kill my session entirely if I killed it (gnome-session), 3 other services that I'm not sure if they can be restarted or not and one application (xchat) that I would need to do some work in and only then manually close and restart (since it contains state that is not restored on restart). The notification also includes process identifiers which 90% of users aren't going to understand. I think you are going to need to integrate better with the various desktops. For example in the gnome-shell overview mode you could have an indicator icon on top of windows that need to be restarted. For all desktops and window managers etc you could also add an indicator to the window decorations. If the user is using systemd based user sessions (those are coming but not yet in GNOME etc), (I think) you will be able to autorestart user services in those sessions using systemctl. Your current implementation is X11 specific, Wayland is coming and personally I will be switching to it ASAP due to the improved security properties of Wayland compared to Xorg. I would suggest this instead of grep | sed: export DISPLAY=$(sed -z -n s/DISPLAY=//p /proc/$NR_SESSPPID/environ) Under the GDM login manager for normal users, your code will not work because GDM does not use ~/.Xauthority but sets XAUTHORITY to a custom path. I expect you will need to extract at least the XAUTHORITY variable and possibly others. It only worked for me because I add a symlink from ~/.Xauthority to $XAUTHORITY so that my cronjobs can access $DISPLAY. IIRC PackageKit has some support for restarting programs in user sessions, I would recommend looking at their implementation. -- bye, pabs https://wiki.debian.org/PaulWise
signature.asc
Description: This is a digitally signed message part

