Bug 69096 - systemctl start should run "systemd daemon-reload" automatically
Summary: systemctl start should run "systemd daemon-reload" automatically
Status: RESOLVED WONTFIX
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-09-08 12:56 UTC by Pacho Ramos
Modified: 2013-09-10 20:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Pacho Ramos 2013-09-08 12:56:49 UTC
A lot of times I notice I need to run "systemd daemon-reload" when I try to start a service and it fails. Wouldn't be possible to make systemctl start run that instead of only warning me? (or, at least, add an option to allow it to do the job)

Thanks a lot
Comment 1 Lennart Poettering 2013-09-09 17:22:15 UTC
This has been requested before, but I still don't think this is a good idea. (Similar requests using inotify to make all file changes instantaneous have been made as well).

The problem is one of atomicity: installing something into systemd usually consists of creating/editing not only one but multiple unit files, and creating subdirectories as well as symlinks. Since doing these changes all in one atomic step is not possible it is problematic doing reloads at arbitrary points in time since systemd then might see some changes applied and others not. This can result in various problems: for example services showing up multiple times or not at all.

By making reloads explicit and controlled by the user we avoid the problem as far as we can: as it is the admin who executed the operation at a point of time of his choice we can be reasonably sure that the configuration is in a sane state at that time.

"systemctl daemon-reload" is done implicitly by "systemctl enable" and "systemctl disable" since the latter commands each execute one change transaction anyway. However start/stop is something that is frequently done implicitly in the background where the admin does not expect this, so we cannot do this there.

Sorry.
Comment 2 Pacho Ramos 2013-09-10 20:12:44 UTC
I guess it's not possible to distinguish "internally" when "systemctl start is executed by admin or by other systemd executable, right? :/ In that case, no problem, and thanks a lot for the explanation :)


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.