Bug 66923 - generator: usage of systemctl is causing deadlock which prevents starting systemd
Summary: generator: usage of systemctl is causing deadlock which prevents starting sys...
Status: RESOLVED NOTABUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-15 13:05 UTC by Umut Tezduyar
Modified: 2013-07-15 13:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Umut Tezduyar 2013-07-15 13:05:11 UTC
If systemctl is used in a generator, it causes a deadlock which eventually resolves when the bus connection request times out. But meanwhile, it prevents systemd from starting up.

A generator like following will cause deadlock.

#!/bin/sh -e

. /etc/conf.d/iptables

if [ $IPTABLES_ENABLED = yes ]; then
	systemctl --runtime --no-reload enable ip-filter.service
else
	systemctl --runtime --no-reload disable ip-filter.service
fi
Comment 1 Lennart Poettering 2013-07-15 13:41:42 UTC
You may not use systemctl or anything like that in generators. That's simply not supported.

http://www.freedesktop.org/wiki/Software/systemd/Generators/

"Since generators are run very early at boot they cannot rely on any external services. They may not talk to any other process."

I'll add a note that makes explicitly clear that systemd itself is also one of those external services.
Comment 2 Umut Tezduyar 2013-07-15 13:44:14 UTC
Thanks that would be my guess and I wanted to open a bug so we can improve documentation.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.