OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
604 stars 141 forks source link

Autostart Factorio and Factorio Server Manager #107

Closed Dergonic closed 4 years ago

Dergonic commented 6 years ago

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

Dergonic commented 6 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

mroote commented 6 years ago

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.

Wyrrrd commented 5 years ago

+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.

Wyrrrd commented 5 years ago

Right now I am using the API as a workaround.

After starting FSM, I run:

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...)

Psychomantis71 commented 5 years ago

@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.

yuanchueh commented 4 years ago

Hi, did this ever get merged? I was looking for just this solution.

knoxfighter commented 4 years ago

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

Psychomantis71 commented 4 years ago

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.

knoxfighter commented 4 years ago

A feature to autostart factorio after launching FSM was added with #179. This will be released in the next release.