[Gllug] GConfd

Sanatan Rai sanatan at gmail.com
Wed Sep 21 09:28:38 UTC 2011

On 20 September 2011 23:42, Nix <nix at esperi.org.uk> wrote:
> On 20 Sep 2011, Sanatan Rai uttered the following:
>>    Ok, I get that. I kill it after running somethng that needs it, eg geeqie.
>> For example, it is running now. I killed that last copy around the time I sent
>> the initial email, and I haven't started any GTK+/GNOME stuff since then.
> I suspect something else needed it and you didn't notice. Even Emacs
> sometimes starts one. I'm running one now and I'm a KDE user... it
> doesn't use much memory and can usually be ignored.

    Hmm...not sure if I want to leave it running. I also see other processes
such as gvfsd-metadata  and gam_server, but presumably they get
started when I run something using GTK+/GNOME.

   To be honest, I do wish these things would just die gracefully if nothing is
using them.

>>> This 'adoption' behaviour is a universally-applicable Unix thing (wired
>>> into the kernel): init(8) adopts all processes whose parents die.

I just tried this: I ran geeqie from the command line, and sure enough gconfd-2
turns up. But again PPID for gconfd is init's, should it not be geeqie's?

> The SIGHUP is not sent by the death of the parent. It is sent in two
> situations:
>  - to session leaders (processes that have called setsid()) when the
>   terminal disconnects, if and only if clocal is not set (see 'stty
>   -a'). (clocal is almost certainly not set for you.)
>  - to all processes in a session leader's foreground process group
>   (in shell terms, that pipeline that has not been 'bg'ed) when
>   the session leader terminates.
> So session leaders don't always get it (e.g. they will never get it if
> they have no controlling terminal), and children of session leaders
> don't always get it either. Its purpose is not to signal parent death:
> it is to signal terminal disconnection.
> There is no reliable portable way to get a signal on parent death: you
> have to call getppid() periodically. Since this is obviously appalling,
> there is a nonportable Linux-specific scheme:
> prctl(PR_SET_PDEATHSIG,...). (However, you almost always have to
> implement polling too, for the sake of portability to lesser Unixes.)

    Thanks for this, very helpful. I agree it is perfectly legitimate to spawn
something and die. I am just unhappy that apps using GTK+/GNOME or
KDE libraries leave all these services running behind.

   [The reason I went off GNOME/KDE (and switched to Enlightenment)
was because they were such hogs. Having all these `helpful processes'
cluttering the process table defeats the purpose. But then it serves me
right for running geeqie etc.]


Sanatan Rai
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list