Differences

This shows you the differences between two versions of the page.

Link to this comparison view

topics:interactive-service-systemd [2017/12/22 04:59] (current)
orzfly created
Line 1: Line 1:
 +====== Interactive Services with Systemd ======
  
 +<code ini /etc/systemd/system/minecraft-server.service>
 +[Unit]
 +Description=Minecraft Server
 +
 +[Service]
 +User=minecraft
 +Group=minecraft
 +SyslogIdentifier=minecraft.service
 +ExecStart=/usr/bin/tmux -S /home/minecraft/minecraft.tmux new -s minecraft -d 'java -jar minecraft-server.jar ....................'
 +ExecStop=/usr/bin/tmux -S /home/minecraft/minecraft.tmux kill-server
 +Type=forking
 +WorkingDirectory=/home/minecraft/server
 +Restart=always
 +RestartSec=30s
 +KillSignal=SIGINT
 +TimeoutStartSec=10
 +TimeoutStopSec=10
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +To connect to the interactive service, ''sudo -u minecraft -H -- tmux -S /home/minecraft/minecraft.tmux attach -t minecraft''
 +
 +===== See Alsos =====
 +  - http://man.openbsd.org/OpenBSD-current/man1/tmux.1
 +
 +{{tag>systemd tmux}}