Closed Dergonic closed 4 years ago
More info : FSM is setup to autostart using crontab and @reboot. It is working fine.
FSM start command : /opt/factorio-server-manager/factorio-server-manager --dir /opt/factorio --conf /opt/factorio-server-manager/conf.json
I'm not sure if it would be possible to manage the Factorio process separately from the manager. Without starting the server through the manager it doesn't have control over that process so managing an existing Factorio server is difficult.
One alternative might be to have a flag that starts Factorio automatically when the manager is brought up. This way you could have the Manager start automatically at boot and start Factorio at the same time, then you would be able to manage the Factorio server running.
+1 on that flag feature.
Being able to do something along the lines of ./factorio-server-manager --autostart
would be great, since my server does a restart every night.
Right now I am using the API as a workaround.
After starting FSM, I run:
sleep 10
(the API was not accessible right after starting FSM)curl -c ~/.fsmcookie -X POST -d '{"username":"<USER>", "password":"<PASSWORD>"}' http://localhost:8080/api/login
curl -b ~/.fsmcookie -X POST -d '{"bindip":"0.0.0.0", "port":34197, "savefile":"<SAVEFILE>.zip"}' http://localhost:8080/api/server/start
rm ~/.fsmcookie
Works like a charm. The only downside is the password being stored in cleartext. (Although there might be more elegant ways of dealing with that cookie...)
@Wyrrrd On my fork I have added the auto start feature, still testing it but it seems to have no bugs, also added the binary file there so you can download it, if @mroote says everything is ok with what I wrote he will merge it here on the next release.
Hi, did this ever get merged? I was looking for just this solution.
The PR merged from @Psychomantis71 didnt include the autostart feature. He planned on creating a second PR with the autostart feature, but he never did :( If you want to do it, you can catch his code and create your own PR with it. https://github.com/mroote/factorio-server-manager/pull/155/commits/759aae40e51709570ead3b2e9b16bf923ff310c6
Whomst dare summon me!
Sorry guys my bad, yeah I never got around to make a separate PR for it.
I will try to get around it this week, am sick anyways so got some free time.
A feature to autostart factorio after launching FSM was added with #179. This will be released in the next release.
Hi everyone
I setup a server which runs great and wanted to link factorio Sever Manager to this server. Sadly, even if Factorio server is running, FSM (Factorio server Manager) report it "not running"
I setup the Factorio server using https://github.com/Bisa/factorio-init on a OVH vps server (Ubuntu server). Factorio is running as a service (using systemctl) and starts automatically at server boot.
I installed FSM and configured it to point to the right path. All is working great (Logs reading, mods management), but main page reports the server as "Not running". I'm not able to start, stop or o anything t the Factorio service.
Is there any way I could link the Factorio service to the FSM system ?
Thanks