You are not logged in.

#1 2013-01-03 05:24:11

onny
Member
From: Europe
Registered: 2010-08-07
Posts: 46
Website

[SOLVED] Trying to write HLDS systemd service file

Hey,
I want to write a systemd service file for my HLDS AUR package: https://aur.archlinux.org/packages/hlds/
My environment file looks like this:

HLDS_USER=root
HLDS_WORKINGDIR=/opt/hlds
HLDS_PARAMS="-game cstrike"
HLDS_LOGFILE=/var/log/hlds_cstrike

The service file like this:

After=network.target

[Service]
#EnvironmentFile=/etc/conf.d/hlds
#User=${HLDS_USER}
#WorkingDirectory=${HLDS_WORKINGDIR}
ExecStart=/opt/hlds/hlds_run -game cstrike
ExecStop=/bin/kill $MAINPID

[Install]
WantedBy=multi-user.target

But systemd fails to start the service:

hlds.service - Half-Life Dedicated Server
          Loaded: loaded (/usr/lib/systemd/system/hlds.service; disabled)
          Active: failed (Result: exit-code) since Thu, 2013-01-03 06:20:49 CET; 2s ago
         Process: 567 ExecStop=/bin/kill $MAINPID (code=exited, status=1/FAILURE)
         Process: 564 ExecStart=/opt/hlds/hlds_run -game cstrike (code=killed, signal=INT)
          CGroup: name=systemd:/system/hlds.service

Jan 03 06:20:49 playground systemd[1]: Starting Half-Life Dedicated Server...
Jan 03 06:20:49 playground systemd[1]: Started Half-Life Dedicated Server.
Jan 03 06:20:49 playground hlds_run[564]: Invalid game type 'cstrike' sepecified.
Jan 03 06:20:49 playground hlds_run[564]: Thu Jan  3 06:20:49 CET 2013: Server Failed
Jan 03 06:20:49 playground kill[567]: usage: kill [ -s signal | -p ] [ -a ] pid ...
Jan 03 06:20:49 playground kill[567]: kill -l [ signal ]
Jan 03 06:20:49 playground systemd[1]: Unit hlds.service entered failed state

Running

/opt/hlds/hlds_run -game cstrike

manually works quote well hmm

Someone knows how to proceed? Thanks

Last edited by onny (2013-01-03 05:43:49)

Offline

#2 2013-01-03 05:44:15

onny
Member
From: Europe
Registered: 2010-08-07
Posts: 46
Website

Re: [SOLVED] Trying to write HLDS systemd service file

Solved. It didn't recognized the workingdir correctly ...

Offline

Board footer

Powered by FluxBB