Dave Howorth wrote:
On Tue, 9 Jul 2019 20:57:12 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
09.07.2019 20:12, Per Jessen пишет:
Andrei Borzenkov wrote:
09.07.2019 17:50, Per Jessen пишет:
Per Jessen wrote: for testing whether a process is running under systemd - is getppid()==1 a good idea?
Do you mean "if /sbin/init is systemd" or "if program is running as system service as opposed to being launched by user"?
The latter - "if program is running as system service as opposed to being launched by user".
I do not think there is any reliable way to check it. Any double forked program will be reparented to init:
What about "ps -eo pid,comm,cgroup | grep firefox" or some similar mantra to check the cgroup as described at
In C please :-) -- Per Jessen, Zürich (17.6°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org