В Thu, 04 Jun 2015 10:08:52 +0200
Sébastien Luttringer <se...@seblu.net> пишет:

> Hello,
> 
> In order to restart updated daemons on filesystems, I created a
> script[1] which lists all PID by service and look for updated files in
> /proc/$pid/maps.
> 
> To get all PIDs of a service, I use "systemctl show -p ControlGroup" to
> craft a path to the "tasks" file.
> 
> But something wrong happen with escaping with some units (e.g serial
> -getty)
> 
> This works:
> #cat /sys/fs/cgroup/systemd/$(systemctl show systemd-logind.service -p
> ControlGroup|cut -f2 -d=)/tasks
> 286
> 
> This not:
> #cat /sys/fs/cgroup/systemd/$(systemctl show serial-getty@ttyS0.service 
> -p ControlGroup|cut -f2 -d=)/tasks
> /sys/fs/cgroup/systemd/$(systemctl show  -p ControlGroup|cut -f2 -d=)
> cat: /sys/fs/cgroup/systemd//system.slice/system-serial\
> x5cx2dgetty.slice/serial-getty@ttyS0.service/tasks: No such file or
> directory
> 

It seems to work here using systemd 210 on openSUSE

bor@opensuse:~/src/systemd> cat /sys/fs/cgroup/systemd/$(systemctl show 
systemd-rfkill@rfkill1.service -p ControlGroup | cut -f2 -d=)/tasks

bor@opensuse:~/src/systemd> systemctl show systemd-rfkill@rfkill1.service -p 
ControlGroup --no-pager 
ControlGroup=/system.slice/system-systemd\x2drfkill.slice/systemd-rfkill@rfkill1.service

> What's the right way to get all pid belonging to a service? How can I
> unescape strings from systemctl?
> 

Well, you can use systemd-escape -u, but real question is why it gets
escaped twice and is it intentional.

> This is happening since a long time. I made these tests on systemd v220
> et v219.
> 
> Cheers,
> 
> [1] https://github.com/seblu/archutils/blob/master/checkservices
> 

Attachment: pgpv7EIKqYICD.pgp
Description: OpenPGP digital signature

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to