Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Systemd: unknown lvalue 'User' in section 'Unit'

A couple weeks a go I moved from Ubuntu 14.04 to 16.04 and found my Upstart script no longer worked, so feeling adventurous I managed to create a Systemd script that worked instead.

But I'm having a couple issues still.

[/etc/systemd/system/ss13_server.service:3] Unknown lvalue 'User' in section 'Unit'

This is my Systemd Script:

[Unit]
Description=ss13_server
User=ss13
[Service]
WorkingDirectory=/home/ss13/ss13
ExecStart=/usr/local/byond/bin/DreamDaemon /home/ss13/ss13/baystation12.dmb 25565 -trusted
Restart=on-failure
RestartSec=90s

It is meant to run the command /usr/local/byond/bin/DreamDaemon /home/ss13/ss13/baystation12.dmb 25565 -trusted within /home/ss13/ss13 as the user ss13 and then rerun that command if the process dies.

As far as I can tell it does that pretty well, except for the error [/etc/systemd/system/ss13_server.service:3] Unknown lvalue 'User' in section 'Unit'

Which leads me to suspect it is not running as the correct user.

I used a website that shows the commands from upstart and the alternatives for systemd and the correct area they go into.

Anyway, any help is useful, Thanks!

like image 265
Baa Avatar asked Jul 06 '16 09:07

Baa


1 Answers

User should be in section [Service].

like image 165
Shuangistan Avatar answered Sep 22 '22 05:09

Shuangistan