ProtectSystem=full should be read-only /etc
what is the point of this settig if the process still can write there?
is it normal that a Service started with systemd still can write files ouitside it working dir?
Hi,
On Wed, Jun 25, 2025 at 11:33:02AM +0200, Philipp Ewald wrote:
ProtectSystem=full should be read-only /etc
what is the point of this settig if the process still can write there?
The "full" setting is indeed meant to keep the whole filesystem
read-only for that service, except /dev, /proc, and /sys, so if yours
isn't then there is something else going on.
It doesn't work for user services (i.e. services started with --user
option).
It doesn't work if your kernel doesn't support filesystem namespaces,
which can happen if you have systemd running inside some other
container.
ReadWritePaths= can be used to add paths that can be written to, so
check there isn't one of those.
Otherwise there is some other issue, or a bug.
Thanks,
Andy
systemctl cat openvpn@<conf>
# [Service]
# Type=notify
# PrivateTmp=true
# WorkingDirectory=/etc/openvpn
# ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid
# PIDFile=/run/openvpn/%i.pid
[..]
# DeviceAllow=/dev/null rw
# DeviceAllow=/dev/net/tun rw
# ProtectSystem=true
# ProtectHome=true
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 52:34:31 |
Calls: | 10,397 |
Calls today: | 5 |
Files: | 14,067 |
Messages: | 6,417,384 |
Posted today: | 1 |