factorio-server-manager icon indicating copy to clipboard operation
factorio-server-manager copied to clipboard

Server autostart

Open Parabux opened this issue 2 years ago • 15 comments

Hi i have a server running on docker. the docker does a backup every night. this stops all containers. when factorio server manager starts up, i dosnt start the game server. would it be possible to get an button to make the server autostart on container start?

Parabux avatar Oct 16 '23 21:10 Parabux

You should be able to set the FSM_AUTOSTART environment variable in the docker container to start the server automatically.

mroote avatar Oct 16 '23 23:10 mroote

do i set FSM_AUTOSTART to true or 1 ? im no pro with docker :P

Parabux avatar Oct 17 '23 17:10 Parabux

It looks to be true/false: https://github.com/OpenFactorioServerManager/factorio-server-manager/blob/a5cde420c7400a26e937e77512ec86c5e43af2fb/src/bootstrap/config.go#L31

(And this is not a Docker thing btw, if you would to run this app without docker you can still use environment variables to configure it.

Mattie112 avatar Oct 19 '23 07:10 Mattie112

Tanks for the help so far. Still haven't gotten this to work. tried two different env variables. im betting its me doing something silly.

FSM_AUTOSTART autostart

i'm running this on unraid with an official image found on the community application store. the images is from portainer. I use portainer for a bit more granular access to the containers.

Parabux avatar Oct 19 '23 09:10 Parabux

Have a look into #315 to see how to setup envs in unraid, do the same for FSM_AUTOSTART=true and it should work.

knoxfighter avatar Oct 26 '23 11:10 knoxfighter

Hi, tried it on my server but still no autostart. Is anyone here who got it working?

mwLabs-eu avatar Mar 10 '24 02:03 mwLabs-eu

I can confirm that setting the env variable in Docker does NOT work for me.

armandkd avatar Mar 11 '24 17:03 armandkd

The FACTORIO_VERSION environment variable is working though. So it's probably not a problem with how I set the environment variables in Docker, but rather an issue with ofsm itself. I have also checked the conf.json file and the flags (as the documentation states that they will take precedence over the environment variables) and autostart is not present. I have also noticed that autostart is not mentioned in the conf.json documentation. This leads me to believe that this functionality may not be fully implemented yet.

armandkd avatar Mar 25 '24 16:03 armandkd

Due to the missing auto-restart, I excluded the container from my backups (I thought, Autosave would be fine). Yesterday a friend of mine started a train, crashed the server, and all saves were wiped. I don't know if this was already before the crash, wasn´t able to find any helpful in the logs. So just a reminder - create backups... (sorry for being off-topic)

mwLabs-eu avatar Mar 29 '24 00:03 mwLabs-eu

Any updates on this Issue? Is this feature/fix planned?

mwLabs-eu avatar Jul 29 '24 13:07 mwLabs-eu