[systemd-devel] Porting init script using unshare, overlayfs to systemd

Lennart Poettering lennart at poettering.net
Mon Jan 13 09:36:42 UTC 2020


On Di, 03.12.19 11:27, Daniel Farina (daniel at fdr.io) wrote:

>
> Fairly neat and tidy, but of some trouble is the fact that I need a few
> root manipulations, and "User=postgres" becomes a liability for that. I
> could change that to root and then pepper "su" everywhere to get the deed
> done, but I felt inclined to write into the list to ask if that is in the
> grain of systemd's design.

You can use the "+" modifier for ExecStartPre=, which allows you to
run the command with full privileges, so that only ExecStart= has the
specified user applied.

See systemd.service(5) for details.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list