Factorio on systemd

# adduser factorio
# systemctl enable factorio.service
# service factorio start

# /etc/systemd/system/factorio.service
[Unit]
Description=Factorio Server

[Service]
Type=simple
User=factorio
ExecStart=/factorio/bin/x64/factorio --start-server-load-latest --server-settings /factorio/data/server-settings.json
WorkingDirectory=/factorio
Restart=on-failure
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

linux (9) factorio (2) systemd (1)

Generate new Factorio map

#!bash

su -

service factorio stop

cd /factorio

bin/x64/factorio --create saves/my-save.zip \
                 --map-gen-settings data/map-gen-settings.json \
                 --map-settings data/map-settings.json
                 
chown -R factorio:factorio /factorio

service factorio start

linux (9) factorio (2)