Menu

#4148 Systemd unit files in /etc/systemd/system cannot be edited

1.600
closed-fixed
5
2012-09-26
2012-09-26
ChrisWayg
No

For example, I have created a nginx.service unit file which is correctly placed in /etc/systemd/system. If I open 'Edit Systemd Service' in Webmin, the edit field is left blank, even though the service is installed, enabled and running.

If I do try to write a new unit file in there it will be saved in /*lib*/systemd/system/nginx.service, but will not be used, because it is overridden by the unit file in /etc/systemd/system/nginx.service.

There seems to be an underlying assumption, that all unit files belong in /lib/systemd/system, as Webmin creates new unit files there.

On the website of systemd: "Q: I want to change a service file, but rpm keeps overwriting it in /usr/lib/systemd/system all the time, how should I handle this? A: The recommended way is to copy the service file from /usr/lib/systemd/system to /etc/systemd/system and edit it there. The latter directory takes precedence over the former, and rpm will never overwrite it. If you want to use the distributed service file again you can simply delete (or rename) the service file in /etc/systemd/system again." http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions

The above works the same in all installations of systemd in other distributions. Gentoo: "Any custom service files should be copied to the /etc/systemd/system directory. The /*usr/lib*/systemd/system directory is reserved for service files installed by ebuilds." Fedora: "The unit files in /etc/systemd/system have a higher precedence over unit files in /lib/systemd/system. Copy them from the latter to the former and customize it as per your requirements."

My request is, that unit files in etc-systemd would be displayed properly for editing and that Webmin would recognize, that they take precedence over files in lib-systemd. Also wouldn't it be preferable, if Webmin user created unit files would be placed in /etc/systemd/system?

Discussion

  • Jamie Cameron

    Jamie Cameron - 2012-09-26

    Thanks for pointing that out - I will fix this in the next Webmin release.

     
  • Jamie Cameron

    Jamie Cameron - 2012-09-26
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB