You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it in any way possible to start the factorio server within the container trough command line? Maybe a workaround would be to create a userscript that runs after the backup is complete to start the server "manually".
Using the Evn.Variables seems to be bugged in fsm/unraid.
What confuses me about the docker installation is that entrypoint.sh does not appear to pass any of its CLI arguments to the actual fsm process. So when starting the container using docker run ofsm --autostart true (or any other parameter), all parameters are dropped. Am I missing something or is this an oversight and the last command of entrypoint.sh should include an "$@" at the end?
That could very well be the case but I won't have time to dive into it before the weekend. If you can test it out and report back (or create a PR) that would be great! If not I will try it in the weekend.
@Mattie112 I tested exactly that (after taking some time to get the docker build going locally) and it appears to work fine. With the argument passing added it now reacts to --autostart true as expected when running it, as well as all other cli parameters.
Here's the command I tested this with: docker run -p 80:80 -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -p 34197:34197/udp localofsm:latest --autostart true
Want me to create a PR for this miniscule change? I know this does not fix the original problem with Environment variables, but still seems relevant because as it stands right now, CLI parameters to fsm are ignored in docker.
@Tronnic I've gotten the autostart feature to work on Factorio Server Manger.
I am deploying the container via Unraid and followed these steps:
Turn on the container
Open the console for the container
Install nano (or whatever text editor you like) as one is not installed by default in the container apt-get update && apt-get install nano
Open the entrypoint.sh with your text editor nano entrypoint.sh
Edit the final line to the following: cd /opt/fsm && ./factorio-server-manager --conf /opt/fsm-data/conf.json --dir /opt/factorio --port 80 --autostart true "$@"
After adding the --autostart true with the "$@" to the end of the line I saved and quit the editor. Restarting the container showed the server start automatically!
Activity
matmat07 commentedon Oct 21, 2024
I can confirm the same behaviour. To add to that and confirm the value was passed correctly, here's the output of a command for the container:
printenv
HOSTNAME=6ca9cbef4a20
HOME=/root
HOST_OS=Unraid
FSM_AUTOSTART=true
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
FACTORIO_VERSION=latest
HOST_HOSTNAME=Tower
HOST_CONTAINERNAME=FactorioServerManager
PWD=/opt
RCON_PASS=
TZ=America/New_York
Mattie112 commentedon Oct 22, 2024
see: #301 for more
Tronnic commentedon Oct 22, 2024
Is it in any way possible to start the factorio server within the container trough command line? Maybe a workaround would be to create a userscript that runs after the backup is complete to start the server "manually".
Using the Evn.Variables seems to be bugged in fsm/unraid.
Mattie112 commentedon Oct 22, 2024
@Tronnic see #301 (comment) for a possible work-around
Tronnic commentedon Oct 22, 2024
@Mattie112 I have looked into the possible fix with the entrypoint.sh, unfortunately this doesn't work for me as well.
Leridon commentedon Oct 22, 2024
What confuses me about the docker installation is that entrypoint.sh does not appear to pass any of its CLI arguments to the actual fsm process. So when starting the container using
docker run ofsm --autostart true(or any other parameter), all parameters are dropped. Am I missing something or is this an oversight and the last command of entrypoint.sh should include an"$@"at the end?Mattie112 commentedon Oct 22, 2024
That could very well be the case but I won't have time to dive into it before the weekend. If you can test it out and report back (or create a PR) that would be great! If not I will try it in the weekend.
Leridon commentedon Oct 22, 2024
@Mattie112 I tested exactly that (after taking some time to get the docker build going locally) and it appears to work fine. With the argument passing added it now reacts to
--autostart trueas expected when running it, as well as all other cli parameters.Here's the command I tested this with:
docker run -p 80:80 -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -p 34197:34197/udp localofsm:latest --autostart trueWant me to create a PR for this miniscule change? I know this does not fix the original problem with Environment variables, but still seems relevant because as it stands right now, CLI parameters to fsm are ignored in docker.
OnlyPlean commentedon Oct 23, 2024
@Tronnic I've gotten the autostart feature to work on Factorio Server Manger.
I am deploying the container via Unraid and followed these steps:
apt-get update && apt-get install nanoentrypoint.shwith your text editornano entrypoint.shcd /opt/fsm && ./factorio-server-manager --conf /opt/fsm-data/conf.json --dir /opt/factorio --port 80 --autostart true "$@"After adding the
--autostart truewith the"$@"to the end of the line I saved and quit the editor. Restarting the container showed the server start automatically!Thank you to @Leridon for figuring this out!
Hope this helps!
sucr4m commentedon Feb 3, 2025
correct me if im wrong but doesnt this get lost when you actually restart the unraid server or update the docker container?
EthanetXYZ commentedon Jul 30, 2025
Just came here to say that this worked for me and seems to persist through restarts. I'm too smooth brain to understand why, but it does.
EthanetXYZ commentedon Jul 30, 2025
It does not survive an image update... :( back to square one for me
EthanetXYZ commentedon Jul 30, 2025
Okay, switching to the develop branch allows the environmental variable to work
Set FSM_AUTOSTART to true