[systemd-devel] Facility to debug/trace services especially at system startup time

Mantas Mikulėnas grawity at gmail.com
Sat Sep 10 11:30:00 UTC 2016


On Sat, Sep 10, 2016 at 6:17 AM, Pathangi Janardhanan <path.jana at gmail.com>
wrote:

> Hi All,
>
>  What is the best option to do some debug/analysis of the system and the
> services started by systemd during initial bootup?
>
>  I would like to use tools like perf and strace etc. on some of the
> services. I could do this by starting the service manually but would like
> to have all the services that start at bootup and was wondering if there is
> a way for me to do this sort of thing, just for the initial boot up time.
>

One possible method is, boot with `init=/bin/sh`, then in the shell run:

    exec strace -D -f -o /tmp/strace.log /usr/lib/systemd/systemd

Alternatively, for both perf and strace, make a .service with
{Before=sysinit.target, DefaultDependencies=no} that attaches to pid 1:

    ExecStart=/bin/strace -p 1 -f -o /tmp/strace.log

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160910/49b91454/attachment.html>


More information about the systemd-devel mailing list