[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 -- [...])



On 22/02/15 18:54, Thomas Liske wrote:
> [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!

With D-Bus maintainer hat on:

This is an anti-pattern. Please don't fish environment variables out of
a desktop session and connect to it from a system service. The right way
to get a notification into a desktop session is this:

* have a process inside the desktop session (probably autostarted) that
  connects to the system bus and listens for broadcast signals from a
  named system service;

* have a system-wide thing that connects to the system bus, claims the
  appropriate bus name, sends the broadcast and releases the name
  (it can exit as soon as it's had the reply from releasing the name)

(This is part of what e.g. the systemd maintainers mean when they say
"don't call into services higher up the stack" as a design principle.)

    S


Reply to: