[systemd-devel] How to get all PIDs in a service

Lennart Poettering lennart at poettering.net
Mon Jun 8 12:29:47 PDT 2015


On Sun, 07.06.15 02:01, David Herrmann (dh.herrmann at gmail.com) wrote:

> Hi
> 
> On Thu, Jun 4, 2015 at 6:31 PM, Andrei Borzenkov <arvidjaar at gmail.com> wrote:
> > В Thu, 04 Jun 2015 10:08:52 +0200
> > Sébastien Luttringer <seblu at seblu.net> пишет:
> >> 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.
> 
> We escape all strings we write to a TTY to make sure we don't
> accidentally write control-chars. However, we also don't know whether
> the data we print was already escaped or not (as we just call a
> generic handler on the dbus property).
> 
> In short: double-escape is on purpose.

I'd be willing to take a patch that adds a "--raw" switch or so that
drops both he property name prefix and the escaping in systemctl, to
make it easier to use "systemctl show" in shell scripts.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list