SpigotSystemd
Adding a way to control using systemd spigot while still being able to attach to the console.
Installing
# Install perlbrew before doing this
# Follow perlbrew instructions, do not copy blindly
perlbrew init
perlbrew install 5.40.0
perlbrew switch perl-5.40.0
# You will need to install development headers
# of libraries in order of this to success
# the specifics will vary in your OS
# Duckduckgo errors
perlbrew exec cpan -T $(cat deps)
Using
Probably you will need to edit the script to match your installation.
This is an example systemd unit service.
[Unit]
Description=Spigot
After=nginx.service
[Service]
WorkingDirectory=/var/lib/spigot/
ExecStart=/usr/bin/perlbrew exec perl start_server.pl
Type=simple
Restart=always
RestartSec=30
User=spigot
Group=spigot
[Install]
WantedBy=multi-user.target
To attach to the console you would use, will vary for your setup as always:
sudo -u spigot perlbrew exec perl ~spigot/attach_console.pl
You will no longer be afraid of writting ctrl+c.
Recommendable
In server.properties
put:
pause-when-empty-seconds=0
To avoid the console getting stuck without connected users in the server.
Languages
Perl
100%