question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Systemd service file DynamicUser option with --chroot

See original GitHub issue

Since 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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
christgaucommented, May 22, 2021

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!

0reactions
christgaucommented, Dec 7, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found