So I have a server that I can run from a bash terminal using e.g.java -jar spigot.jarwhich will send output to stdout (I believe), and thus be printed to the terminal screen. To stop the server from the terminal, one simply sends the stop command to the server, at which point the server initiates shutdown (saves current data, etc.).However, I don't want to have to start the server every time I reboot, or have an extra bash terminal hanging around with the open process, so I've been trying to set up a systemd service to run the server automatically, and take standard input from (anywhere, really), using a .service file like the following:   [Unit]Description=Spigot Minecraft server daemon[Service]Restart=alwaysWorkingDirectory=*location where spigot.jar is*StandardInput=ttyTTYPath=/dev/tty2ExecStart=/usr/bin/java -jar spigot.jarExecStop=/bin/sh -c 'echo stop >/dev/tty2'[Install]WantedBy=multi-user.targetBut I can't figure out why this won't work. What I thought it should do is pipe /dev/tty2 to the server, and when I use the commandsystemctl stop *service*it should send stop (indirectly through /dev/tty2) to the server. What am I missing?But the service doesn't seem to run? If I comment out the StandardInput & TTYPath lines, the server starts, but when issuingsystemctl stop *service*and then reviewing server logs throughjournalctl -u *service*the proper shutdown sequence never initiated -- the process was just killed (instead of gracefully stopping itself).So what I want to know is: how do I run this server as a service, with some FIFO/file/tty/something piped into it (so I can still issue server commands)?
Systemd: pipe input to daemonized server?
systemd;pipe