Jump to content

Update Server via systemd


dwarfmaster1974
 Share

Recommended Posts

Howdy folks,

 

me and my girlfriend ran a small dedicated server at home with 7 day to die, so we could build and tinker undisturbed.

 

The installation of the server was quite easy and worked out quite well.
The whole thing runs on Ubuntu and I set up a systemd service for it.
This works also quite well, if there weren't the updates.

So I thought it would be smart to tell the service to do the updates for the server as well.

But I can't get it to run.

 

Here is my systemd-file: https://pastebin.com/EQG5K5mh

here the update7dtd.sh: https://pastebin.com/K0DJsmJ5

here the update7dtd.steam: https://pastebin.com/bJVbM0j0

 

Every time I call systemctl start 7dtd I get an error message: https://pastebin.com/07As7h1H

 

This is what the systemctl status 7dtd looks like: https://pastebin.com/5Lny7F0A

and so the journalctl -xe shows up like this: https://pastebin.com/FnZkwj8d


What am I doing wrong?

 

Someone out there who can help me?

 

Greeting from Navezgane 
Germany Division
Outpost Kiel

 

Edited by dwarfmaster1974
no links for the links :-) (see edit history)
Link to comment
Share on other sites

23 minutes ago, dwarfmaster1974 said:

/root/Steam/logs/stderr.txt

is empty. So nothing to show :(

 

after entering this command:


root@deskserver:~/Steam/logs# steamcmd

This output shows up: https://pastebin.com/m31PKdhE

 

Looks fine for me ... or not?

Steamcmd was updated twice? That sounds unusual. I just started steamcmd as well and it did update, but only once.

 

Any<way, the systemd output shows he tries to do the update which seems to be followed by steamcmd restarting, which fails. My guess is that the update failed as well since you had to update by calling it manually.

It might be because of the shutdownonfailed command and some routine mistaking this for an error (timeouts, return value different, who knows) it never gets past the update. You should do another reboot to see if it upgrades now. If I'm right it will work now because the steamcmd update has been done and won't interfere anymore.

 

My stderr.txt after doing the upgrade was not empty by the way:

CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
CAppInfoCacheReadFromDiskThread took 139 milliseconds to initialize

 

Now, running a script you have in your users home dir as root is practically giving everyone who might hack into your user account a direct way to get root privileges, you might as well just run everything as root. And maybe there are even safety checks somewhere to prevent steamcmd running as root.

 

So, independant of your problem, I would advise to redesign the service to run the script as the user. Just google for "systemd run service as user" and you will find lots of info on how to do that . It basically is two lines in the service file giving userid and groupid of the user. Also make sure that no files in your home dir have owner root after you make this change, i.e. do "chown -R tatilumini /home/tatilumini". Especially if the update worked with the root script there might be lots of files owned by root now in there. 

 

 

 

 

 

  • Thanks 1
Link to comment
Share on other sites

Sorry for the late feedback.

I have decided to do something completely different, namely docker with this:

https://hub.docker.com/r/didstopia/7dtd-server

Pretty cool the whole thing. With a little bit of research I was able to set it up quickly and, most importantly, it was update proof.

If you need a manual for this I can deliver it. Unfortunately the readme there is not the whole truth and some things I had to do myself.
But I for my part am very enthusiastic.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...