Closed helenclarko closed 3 years ago
Not sure I follow. This Docker container image uses neither upstart nor systemd.
Thanks Dids,
I was referring to the help document created back in 2016 for Ubuntu 14.04.
I probably should have just used 14.04 which has upstart, but I want to check with you first incase you had something.
Do you happen to have a link to that? Still not entirely sure how this relates to this project/Docker image, as we have no control over any documentation outside of this repository. 🙂
Of course, this document here: https://rust.didscraft.com/rust-server-on-linux-using-docker/#automaticstartup
I know it's not part of the repository, but I wasn't sure where else to ask for systemd alternative to upstart.
I really hope this was a page you created and I'm not asking in the wrong place. Sorry if I am wasting your time.
Ahh thank you, I'd entirely forgotten about that guide. I'll make a note to update it!
No no, Thanks you @Dids
why would you need to complicate the docker with such a script.
by using the correct docker commands
docker run --restart unless-stopped
docker would do the same..
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I've translated the upstart code to systemd code simply for my own usecase. Feel free to modify as you need, although probably using docker run --restart unless-stopped
is good enough for your own usecase.
Create a file in: /etc/systemd/system/rust-server.service
[Unit]
Description=Rust Server Container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStartPre=-/usr/bin/docker rm -f rust-server 2>/dev/null
ExecStartPre=-/usr/bin/docker pull didstopia/rust-server
ExecStart=/usr/bin/docker run -p 28015:28015 -p 28015:28015/udp -p 28016:28016 -p 8080:8080 -p 28082:28082 --name rust-server --env-file /rust.env -v /rust:/steamcmd/rust --rm didstopia/rust-server
ExecStop=/usr/bin/docker stop rust-server
[Install]
WantedBy=default.target
Modify this code section as you will. I don't offer any support for this. It works well enough for my own usecase, but YMMV.
Edit: added rust+ port
you might have missed the (rust+) port?
28082:28082
Good catch @Hardcore-fs. I'm getting back into Rust and running a server again and I'm not familiar with this new Rust+. I've made the edit to the above script to reflect those changes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe. Newer releases of Ubuntu do not have upstart available
Describe the solution you'd like systemd alternative auto startup script