![]() ![]() If you have the systemctl command in your terminal, you probably have systemd. You can even ask many programs to save their output to a log file instead of writing to the standard output. How one defines such a thing varies from system to system, but the genera principle is that a service is started by your server automatically once it's dependencies have started up, and will optionally restart it if it dies. To that end, I recommend you investigate how to create a system service for your server. This solution, however, does not take into account your server process crashing, the server restarting, or something else weird happening. Solutions offered here so far talk about using screen - which basically lets you disconnect from a terminal session, log out, and then reconnect to it at a later date - leaving all your processes still running. The reason this occurs is because when you close your SSH session, your SSH server kills all the processes you had running. (If it's still running, try kill -9 PID next.) Verify by running ps aux |grep minecraft again. ![]() Then, just kill PID (where PID is the number from the previous command.) should do the trick. If it stays in the background, you can kill it next time you log in by one of the kill commands, either killall java (which will kill all java processes running!) or ps aux |grep minecraft, which will spit out all processes with the word "minecraft" in them (incl the ps aux|grep minecraft probably), an the number next to the username is the PID. The command is Java -jar minecraft_server.1.10.2.jar but sometimes Java -Xmx1024M -Xms1024M -jar minecraft_server.1.10.2.jar (Of course, if they die or are killed, everything in them dies as well). They can be detached into background upon disconnecting and reattached the next time you log in, with all the processes running inside them intact. On the other hand, to keep a foreground process alive between sessions, you need to use something like screen, tmux or byobu terminal multiplexors. via ps aux | grep 'name_of_process' or using top or htop utilities, or by issuing killall name command. (You can "daemonize" most foreground processes by appending & at the end of the command you start that process with.) To kill it from another session you need to know its PID number (obtained e.g. a daemon, it will continue to run even after the remote session ends. something that stays opened, not a daemon that runs in the background) in that terminal, that process will terminate once you disconnect from your ssh session. putty) and run a "foreground process" (i.e. When you connect to a remote system using ssh a terminal emulator (e.g. I'm not 100% sure what you're asking, but I'll try to answer anyway :)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |