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

Re: Possibilities to merge some parts of some of the daemons-that-need-to-be-restarted checkers (was: Re: Bug#776628: ITP: needrestart-session -- [...])



Hi,

On 02/20/2015 11:10 PM, Axel Beckert wrote:
> 167/1/0 root@c-crosser:pts/8 [~] # needrestart -b -k
> NEEDRESTART-VER: 1.2
> NEEDRESTART-KCUR: 3.16.0-4-amd64
> NEEDRESTART-KEXP: 3.16.0-4-amd64
> NEEDRESTART-KSTA: 2
> 168/0/0 root@c-crosser:pts/8 [~] # needrestart -b -l
> NEEDRESTART-VER: 1.2
> NEEDRESTART-SVC: dbus
> NEEDRESTART-SVC: wdm
> 169/0/0 root@c-crosser:pts/8 [~] # 

the format was choosen to be compatible to apt-dater's ADP protocol...
apt-dater-host just calls needrestart and passes it's output through.
Could be easily extended, i.e. provide a JSON output.


> (JFTR: The two listed services are some of those on the mentioned
> blacklist. The output is from needrestart 1.2 as currently in Jessie.
> The one machine where I have needrestart 2.0 installed currently
> doesn't have any daemons to restart, so I can't test immediately if it
> has the same behaviour.)

It should :-)


>> Only needrestart seems to have the ability to notify user sessions
>> about things that need restarting.
> 
> Yes. And that works quite well for me -- except that the desktop
> notifications look quite ugly in Awesome's notifier widget. That one
> neither seems to do automatic line wrapping nor does it interpret
> HTML tags and hence shows them as plain text.

The notification stuff is not part of needrestart 1.2. needrestart 2.0
detects user sessions and does session notification using different hooks:

> thomas@clempner:/etc/needrestart/notify.d$ ls -1
> 200-write
> 300-needrestart-session
> 400-notify-send
> 600-mail
> README.needrestart

The first hook which exits with a rc value of 0 stops the hook processing:

[200-write]
Writes a notification to the TTY of the *session*... if it has any TTY.
Running a bash within a xterm won't trigger this hook - the bash and the
xterm should be part of the X session.

[300-needrestart-session]
Part the *needrestart-session* package: This script triggers a dbus
helper script within user session. This script runs the
needrestart-session GUI which uses needrestart in usermode to detect
processes using obsolete libraries etc.

[400-notify-send]
Looks for the DISPLAY/XAUTHORITY environment variables of the session
and uses notify-send from libnotify-bin (trying to use html tags for
some formatting). This hook is *realy* uggly!

[600-mail]
Just send a mail to the user (mail $USERNAME) as last resort.


@abe: Did you already give needrestart + needrestart-session a try?


Regards,
Thomas

-- 

    ::  WWW:                         http://fiasko-nw.net/~thomas/  ::
   :::  Jabber:                   xmpp:thomas@jabber.fiasko-nw.net  :::
    ::  flickr:              http://www.flickr.com/photos/laugufe/  ::


Reply to: