Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start server_linux.sh on boot?

#1
I need to start the server on boot in Debian. Can I move server_linux.sh to /etc/init.d/ like on here http://www.debian-administration.org/art...ith_Debian

Is so do I have to adjust the file paths in the script? Also will it be running as root on another user?

Thanks
[MoFo] Servers - North America - Hosted in Montreal Canada - Admin DeadDred [MoFo]
Reply

#2
You can't move server_linux.sh there, the script expects the server binary to be in the same directory. What you can do, however, is make a small shell script that cd's into the directory of server_linux.sh and launches it. That should be simple enough.

Please do not run the server as root (or anything else that does not require it.) In your init.d script, you can use su to launch server_linux.sh as a different user.

EDIT: For your info, you might want to look into this: Debian's start-stop-daemon can launch daemons as other users. Also, it might be interesting to launch server_linux.sh inside a GNU screen or tmux session, because it spawns an interactive admin console which is more convenient to use than rcon (and also shows the game log live). Then you can just resume the screen session from ssh and see what's happening on your server or issue server commands directly in it. If you're running a server that needs good supervision, I suggest having a look at rcon2irc too, it's an administration tool that relays server events to an irc channel and, if you know Perl, you can code modules for it.
Reply

#3
(02-09-2013, 04:24 AM)Mr. Bougo Wrote: Also, it might be interesting to launch server_linux.sh inside a GNU screen or tmux session


Thats what I end up doing (tmux) but wasn't sure if it was the right way to go about doing it. Hotting Ctrl-b d detached the session and I was able to close my ssh window.

Would still like an auto start just incase the server provider decides to restart the VPS server.
[MoFo] Servers - North America - Hosted in Montreal Canada - Admin DeadDred [MoFo]
Reply

#4
Did my post above help for autostarting?
Reply

#5
(02-09-2013, 12:55 PM)Mr. Bougo Wrote: Did my post above help for autostarting?


Sorry I haven't set up the Debian way auto start but before I posted this I found tmux which let me run the script after closing the ssh session. So yes tmux did the job for now I'll do some more reading today and get the auto start going and how to control the xonotic server.

If I get the auto start going then I'll repost how I did it.



Thanks.
[MoFo] Servers - North America - Hosted in Montreal Canada - Admin DeadDred [MoFo]
Reply

#6
You can make the auto start script launch the server in a detached tmux session. Then you can attach later.

EDIT: I believe this is done with the '-d' argument to new-session: (disclaimer: I'm not a tmux user)
Code:
cd /path/to/xonotic/directory/
tmux new-session -d -s my_xonotic_server 'sh ./server_linux.sh'
Reply

#7
Couldn't you just run it within a screen session as well? After all, a dedicated server doesn't need no X11, so why tmux? Smile
[Image: 9216.png] Web: YouTubeSoundCloudFlickrzykure.de[unconnected]
IRC: #uc.xonotic #xonotic #xonotic.de #xonotic.pickup
Reply

#8
(02-09-2013, 06:34 PM)zykure Wrote: Couldn't you just run it within a screen session as well? After all, a dedicated server doesn't need no X11, so why tmux? Smile

I'm sure I could but I don't know what I'm going LOL - just Micky Mousing it for now as I read up on things.. I believe there is a native command to detach the session but tmux is working really nice.

The game server seems to be running good so now I need to harden the main server. iptables is making me scratch my head atm heh
[MoFo] Servers - North America - Hosted in Montreal Canada - Admin DeadDred [MoFo]
Reply

#9
(02-09-2013, 06:34 PM)zykure Wrote: Couldn't you just run it within a screen session as well? After all, a dedicated server doesn't need no X11, so why tmux? Smile

tmux is a terminal multiplexer like screen.
Reply

#10
I recall It'sMe wrote some software for handling multiple xonotic servers in different tmux sessions and abstracting out the whole management process pretty well. May want to have a look: https://github.com/itsme-/xstools
Reply

#11
(02-09-2013, 07:55 PM)Mr. Bougo Wrote: tmux is a terminal multiplexer like screen.

... and it's awesome! Why didn't I know about this before??! Big Grin
[Image: 9216.png] Web: YouTubeSoundCloudFlickrzykure.de[unconnected]
IRC: #uc.xonotic #xonotic #xonotic.de #xonotic.pickup
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  server_linux.sh can't find executable file. idk 4 1,245 05-22-2024, 03:27 PM
Last Post: idk
  Full server tutorial start-2-finish with maps & config from live server xonotic.us.to ballerburg9005 0 10,071 09-03-2021, 10:21 AM
Last Post: ballerburg9005
  Server does not start saddesad 2 2,618 11-25-2020, 04:39 AM
Last Post: saddesad
  [NEED HELP] I would like to setup a server; Where do I start? evilkittie 18 20,345 07-13-2017, 06:28 AM
Last Post: evilkittie
  player freeze during start countdown -maniac|Su- 0 2,609 10-31-2016, 04:21 PM
Last Post: -maniac|Su-
Question How to start a Server with Mutators ? Wolfseye 1 3,896 07-08-2014, 12:07 PM
Last Post: Mr. Bougo
  Start/stop/restart git version with Webmin shell scripts? end user 13 18,434 10-16-2013, 11:27 PM
Last Post: end user
Exclamation [SOLVED] How to start with Xonotic? Debianita 4 6,241 06-23-2012, 04:27 AM
Last Post: Debianita
  load issues (100%) while trying to start the server acidbuddha 5 5,511 06-15-2012, 08:53 AM
Last Post: Mr. Bougo
Question [SOLVED] linux server - won't start question nonenone 23 24,059 04-10-2012, 03:10 PM
Last Post: Mr. Bougo

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-