Systemd service file DynamicUser option with --chroot
See original GitHub issueSince User and Group options in wsdd.service had been replaced with DynamicUser option, wouldn’t it make sense to replace
;ExecStartPre=/usr/bin/install -d -o nobody -g nobody -m 0700 /run/wsdd/chroot
with
;ExecStartPre=/usr/bin/install -d -o wsdd -g wsdd -m 0700 /run/wsdd/chroot
aswell?
That’s what worked for me on my Debian stable machine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
systemd.exec - Freedesktop.org
Unit configuration files for services, sockets, mount points, and swap devices share a subset of configuration options which define the execution environment of ......
Read more >Running a systemd service with RootDirectory= and access ...
To answer your question directly: how to properly execute a service with external dependencies outside of the chroot using RootDirectory.
Read more >Dynamic Users with systemd - 0pointer.net
If you write a systemd service unit file, you may enable the dynamic user logic for it by setting the DynamicUser= option in...
Read more >Start a systemd service inside chroot from a non ... - Super User
Define a service file outside chroot that execute the service inside the chroot with the options RootDirectory=/path/to/chroot in conjunction with ...
Read more >systemd.exec - Execution environment configuration
Unit configuration files for services, sockets, mount points, ... If these options are not used and dynamic user/group allocation is enabled for a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I encountered the same issue while playing around with the chroot.
I went into a different direction and used the RuntimeDirectory which is automatically created and removed by systemd with the user/group provided in the unit file. So no need for pre/post exec commands anymore. See PR #110 for a new version of the unit file. Comments are welcome!
Thanks for digging into the details of needrestart and providing the pointer. I would agree that nothing needs to be changed for wsdd. It appears to me that there is a general issue with needrestart and chroot’ing units so it might affect other services out there as well.
However, if there is an issue arises, feel free to open a new issue here.