Bisa / factorio-init

Factorio init script
MIT License
415 stars 82 forks source link

Error when starting with systemd - failed to start service #151

Closed douira closed 4 years ago

douira commented 5 years ago

When I run systemctl start factorio I get this error:

/opt/factorio-init$ systemctl start factorio
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'factorio.service'.
Authenticating as: douira,,, (douira)
Password: 
==== AUTHENTICATION COMPLETE ===
Job for factorio.service failed because the control process exited with error code.
See "systemctl status factorio.service" and "journalctl -xe" for details.

I'm running Ubuntu 18 so I followed the steps for systemd. I created a factorio user with adduser factorio beforehand.

wli commented 4 years ago

I just ran into this, and had to debug this following the debug instructions. This is because --server-adminlist is no longer a valid option (not sure as of which factorio version).

$ /opt/factorio-init/factorio invocation
/opt/factorio/bin/x64/factorio --config /opt/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json --server-adminlist /opt/factorio/data/server-adminlist.json
$ /opt/factorio/bin/x64/factorio --config /opt/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json --server-adminlist /opt/factorio/data/server-adminlist.json
Option ‘server-adminlist’ does not exist

Usage:
  factorio [OPTION...]

Workaround: remove the --server-adminlist ${ADMINLIST} arg in https://github.com/Bisa/factorio-init/blob/8a78316fc6c04c533a931f260a244054f42a963c/factorio#L126 locally, and try again.

tmzasz commented 4 years ago

so your problem is the command exists but you need to point it to an actual file if the file does not exist it throws the error they could be a little bit clearer with the error message but --server-adminlist FILE is a legit command line arg https://cdn.discordapp.com/attachments/251934092306677760/627391604399013898/unknown.png

cybersteel8 commented 4 years ago

That workaround to remove the command from the invocation wouldn't be required if you put in your factorio-init/config file an entry named ADMINLIST. An example that I used: ADMINLIST=${FACTORIO_PATH}/server-adminlist.json