7

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
2
  • Check this issue: askubuntu.com/questions/676007/… I was able to get an answer for a similar question here.
    – Matt K
    Dec 10, 2020 at 19:07
  • Look man, the only thing that other issue tells me is that I can put User=xyz in the [Service] section of my .service file. Which, if you read my question (and I mean attentively) , is something I clearly already knew. Dec 24, 2020 at 14:19

1 Answer 1

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.

3
  • Did you file a bug report?
    – waltinator
    Jul 18, 2017 at 14:24
  • No. Where should I do that ? Systemd ? Ubuntu ? Kubuntu (which is the flavour I am actually using) ? Jul 26, 2017 at 17:59
  • that's totally weird Dec 20, 2019 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .