Running a shell script on login in a terminal (Debian)
4 replies, posted
Let me start of by saying that i do not have much experience with Linux in general. I have used Ubuntu(not much) and now i'm using Debian for the first time so i still got allot to learn.
I decided to run Debian on my IBM x345 server which seems to be going well. Now i decided run my minecraft server on it. I made it run on boot by adding a shell script in /etc/init.d and i executed the update-rc.d command. The server is running fine this way but there is no way for me to access the console since there is no terminal being opened in which the server runs(i can make it run in a terminal by manually opening the script in an existing terminal).
Is there a way that i can get the server to run on boot/login in a terminal so that i can access the server console?
You should look into screen. I'm not exactly sure of your setup, but you should be able to run your minecraft server inside a screen session. When you want to access the console all you need to do is attach the screen session.
I'm not sure about what screen exactly is but from my understanding it is not what i'm looking for. Debian has a Desktop interface, it's not just a terminal. I wan't to run my script in a terminal on boot/login instead of a background service or something
No, Boris-B is right (although I use tmux). Basically, screen will allow you to keep a terminal session open even if the corresponding terminal window/user login is closed. This is how I use IRC. After logging in via ssh, I type 'tmux attach' to attach to it. To create it, I simply typed tmux then irssi.
So modify your init script so that it starts your process under a screen. You can then login as the user your minecraft server is running as, and attach to the screen/tmux.
EDIT: Also I never hosted minecraft servers, but if the program is above highschool-level of quality then it probably has another way to connect to its terminal.
If it's a server, the computer shouldn't have the desktop interface as it uses too many resources. Ideally the server would have no monitor to begin with and you would ssh into it and access it through screen in order to modify things.
Sorry, you need to Log In to post a reply to this thread.