9

I've created a .service file that includes User=xyz in the [Service] section. The service still runs as root. Quid?

[Unit]
Description=...
Requires=network-online.target

[Service]
ExecStart=/usr/bin/java ...
Type=simple
ExecStop=/usr/bin/java ...
User=siraprise

[Install]
WantedBy=multi-user.target
Gryu
  • 8,002
  • 9
  • 37
  • 53

1 Answers1

8

Apparently the behaviour changes if User= is specified before ExecStart=.

Don't know whether that's a feature or an accident, but as a feature it's pretty dumb and moreover it seems undocumented which is actively annoying.