Bug 66923

Summary: generator: usage of systemctl is causing deadlock which prevents starting systemd
Product: systemd Reporter: Umut Tezduyar <umut>
Component: generalAssignee: systemd-bugs
Status: RESOLVED NOTABUG QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.