[systemd-devel] Log of all processes

Gustavo Sverzut Barbieri barbieri at profusion.mobi
Mon Oct 25 04:27:48 PDT 2010


On Mon, Oct 25, 2010 at 3:18 AM, Canek Peláez Valdés <caneko at gmail.com> wrote:
> Hi; I'm using (with a high success) systemd in my Gentoo system.
> However, even with really few services running my startup time is not
> that different from OpenRC, and my PID count is really high; with an
> emergency boot, it's on the order of 1,500. I suspect the first
> problem is caused by the second.
>
> (By the way, the reboot and shutdown times have improved enormously,
> it's almost instantaneous).
>
> I would like to somehow log every process spawned from boot to getty
> in emergency mode, so I can track what is being called, and then know
> how to stop it.
>
> Is this possible? I don't want anything fancy like bootchart, only the
> processes (and, if possible, in the order of invocation) from
> "/bin/systemd udev" to "/sbin/agetty 38400 tty1".

Hi, I'm one of the guys helping Systemd to run on Gentoo and had
similar high-pid counts.

The biggest cause of problems was hotplug being installed. Alone it
would account for over 1000 pid. Removing it, but still leaving the
uevent helper set in kernel (CONFIG_UEVENT_HELPER_PATH!="") was still
causing high pid count, but faster boot (the kernel would create
process but not find the binary and thus they'd die).   Hotplug was
installed since it was recommended by some gentoo handbook, but as you
can see from the version (2004-something) it's deprecated and udev
handles it all, much more nicely.

The second problem was calling openrc scripts at /etc/init.d, as
openrc is too smart and tries to manage dependencies that may have
been handled by systemd already. So I disable it in my ebuild (see
below). With that I disable all access to /etc/init.d and have a fully
native systemd (you can find some service files in my repo as well).

The third, but very minor is to remove gentoo's intelligence from udev
rules. Things like "new network device -> /etc/init.d/net.$iface
start" or "new bluetooth, start bluez". These are also documented in
the link below.

Last but not least, I'm a desktop user and as such I don't care about
persistent logs. Systemd allows you to run with a very lightweight
bridge to link /dev/log to /dev/kmsg, then you can read your logs with
"dmesg" and they're all in ram, with no need to install logrotate
stuff. It's very lightweight (36kb here). I also disable all getty but
1 and start my login manager directly (slim.service, instead of
xdm.service). It boots into my Enlightenment17 with pid around 500,
with a hack to ignore some acpid udev modprobes I can get it to 300).

I have a "live" (from git) systemd ebuild, with instructions I'm collecting at:

    http://barbieri-playground.googlecode.com/svn/gentoo/overlay/sys-apps/systemd/README.txt

As for shutdown, yeah, it's as fast as it should be ;-) We're doing an
amazing work with systemd! My next hope is to have the cron features
in it and it's all I ever need to manage my system.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbieri at gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202


More information about the systemd-devel mailing list