I'm trying to write a new systemd unit for mini-httpd package, which is
using lsb-base to init. Can I replace the old init script straight up, or
do I have to maintain both the systemd unit and the old init script ?
A related question: The binary itself can drop privilege and run as
non-root, then should I use that native feature or use systemd User= when writing a default config/unit ?
On Mon, May 17, 2021 at 12:51 PM Khoa Tran Minh wrote:
A related question: The binary itself can drop privilege and run as
non-root, then should I use that native feature or use systemd User= when
writing a default config/unit ?
I would suggest to use systemd features for this.
Does that not depend on whether it does anything before dropping
privileges? For example, a webserver can bind to low ports before
dropping privilege. I imagine if the systemd service unit specified
running as (eg) www-data, that wouldn't work.
On Wed, May 19, 2021 at 8:51 AM Richard Hector wrote:
Does that not depend on whether it does anything before dropping
privileges? For example, a webserver can bind to low ports before
dropping privilege. I imagine if the systemd service unit specified
running as (eg) www-data, that wouldn't work.
I don't know the details, but I think systemd can open the ports and transparently pass them to the unprivileged process when it is spawned without any data loss, in a similar way to the inetd stuff used to
work.
Hi,
On 20/05/2021 03:35, Paul Wise wrote:
On Wed, May 19, 2021 at 8:51 AM Richard Hector wrote:
Does that not depend on whether it does anything before dropping
privileges? For example, a webserver can bind to low ports before
dropping privilege. I imagine if the systemd service unit specified
running as (eg) www-data, that wouldn't work.
I don't know the details, but I think systemd can open the ports and
transparently pass them to the unprivileged process when it is spawned
without any data loss, in a similar way to the inetd stuff used to
work.
http://0pointer.de/blog/projects/socket-activation.html
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 00:54:15 |
| Calls: | 12,098 |
| Calls today: | 6 |
| Files: | 15,003 |
| Messages: | 6,517,860 |