[2.0.77][Linux][Headless] Server doesn't start with daemon service

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
welldown
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Oct 25, 2024 7:56 am
Contact:

[2.0.77][Linux][Headless] Server doesn't start with daemon service

Post by welldown »

So let me start with that I'm new to home labbing and I'm trying to set up my own headless server in a Proxmox machine.

Until now i have tried to run the server in a ssh shell and with a bash script. i have a config file that lets the game read the main installation but write to a separate users home directory (mods, logs, saves, etc).

Code: Select all

#!/bin/bash

HOME_PATH="/home/factorio"
args=(
        -c $HOME_PATH/vanilla-mods/config.ini
        --mod-directory $HOME_PATH/vanilla-mods/mods/
        --start-server $HOME_PATH/vanilla-mods/saves/vanilla.zip
        --server-settings $HOME_PATH/vanilla-mods/vanilla.json
)

# echo "${args[@]}"
cd /opt/factorio
./bin/x64/factorio "${args[@]}"
This version works, and i can connect to it from LAN. still haven't gotten an outside connection in, but that's probably some weird firewall or forwarding I'm missing.

Now i want to translate this to a service that would autostart the server on boot. From ddifferent resources, I have this factorio.service file(?)

Code: Select all

    [Unit]
    Description=Factorio Server Vanilla
    After=network.target

    [Service]
    User=factorio
    WorkingDirectory=/opt/factorio/
    ExecStart=/opt/factorio/bin/x64/factorio -c /home/factorio/vanilla-mods/config.ini \
        --mod-directory /home/factorio/vanilla-mods/mods/ \
        --start-server /home/factorio/vanilla-mods/saves/vanilla.zip

    Restart=on-failure
    RestartSec=5

    [Install]
    WantedBy=multi-user.target
Now when this runs, it loads the mods and such but stops at this error:

Code: Select all

Aug 11 10:43:11 testing factorio[1232]:    1.089 Error InterruptibleStdioStream.cpp:55: Got EOF on stdin; closing
it also doesn't seem to write to the regular log files. the logs from journalctl for a try look like this:

Code: Select all

Aug 11 10:43:10 testing systemd[1]: Started factorio.service - Factorio Server Vanilla.
Aug 11 10:43:10 testing factorio[1232]:    0.000 2026-08-11 10:43:10; Factorio 2.0.77 (build 84539, linux64, headless, space-age)
Aug 11 10:43:10 testing factorio[1232]:    0.000 Operating system: Linux
Aug 11 10:43:10 testing factorio[1232]:    0.000 Program arguments: "/opt/factorio/bin/x64/factorio" "-c" "/home/factorio/vanilla-mods/confi>
Aug 11 10:43:10 testing factorio[1232]:    0.000 Config path: /home/factorio/vanilla-mods/config.ini
Aug 11 10:43:10 testing factorio[1232]:    0.000 Read data path: /opt/factorio/data
Aug 11 10:43:10 testing factorio[1232]:    0.000 Write data path: /home/factorio/vanilla-mods [2679/3951MB]
Aug 11 10:43:10 testing factorio[1232]:    0.000 Binaries path: /opt/factorio/bin
Aug 11 10:43:10 testing factorio[1232]:    0.008 System info: [CPU: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz, 2 cores, RAM: 15732 MB]
Aug 11 10:43:10 testing factorio[1232]:    0.008 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DE>
Aug 11 10:43:10 testing factorio[1232]:    0.015 Running in headless mode
Aug 11 10:43:10 testing factorio[1232]:    0.015 Audio is disabled
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag expansion-shaders = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag freezing = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag quality = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag rail-bridges = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag segmented-units = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag space-travel = false
Aug 11 10:43:10 testing factorio[1232]:    0.015 Info ModManager.cpp:449: FeatureFlag spoiling = false
Aug 11 10:43:10 testing factorio[1232]:    0.017 Loading mod settings VehicleSnap 2.0.3 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.018 Loading mod settings calculator-ui 2.0.1 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.018 Loading mod settings car-finder 2.0.0 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.018 Loading mod settings DiscoScience 2.0.1 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.019 Loading mod settings even-distribution 2.0.2 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.019 Loading mod settings light-overhaul 0.2.2 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.019 Loading mod settings nixie-tubes 2.0.9 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.020 Loading mod settings playtime-plus 1.0.6 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.020 Loading mod settings wire-fix 0.2.2 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.020 Loading mod settings BottleneckLite 1.3.4 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.021 Loading mod settings factoryplanner 2.0.50 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.021 Loading mod settings gridlines 1.3.0 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.025 Loading mod settings Milestones 1.4.7 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.025 Loading mod settings RateCalculator 3.3.8 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.025 Loading mod settings TaskList 0.5.0 (settings.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.028 Loading mod core 0.0.0 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.039 Loading mod base 2.0.77 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.172 Loading mod VehicleSnap 2.0.3 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.184 Loading mod bullet-trails 0.7.1 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.197 Loading mod calculator-ui 2.0.1 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.209 Loading mod car-finder 2.0.0 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.222 Loading mod DiscoScience 2.0.1 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.234 Loading mod even-distribution 2.0.2 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.246 Loading mod flib 0.16.5 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.260 Loading mod nixie-tubes 2.0.9 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.278 Loading mod pushbutton 2.0.5 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.292 Loading mod textplates 0.7.2 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.318 Loading mod wire-fix 0.2.2 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.334 Loading mod factoryplanner 2.0.50 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.350 Loading mod gridlines 1.3.0 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.368 Loading mod Milestones 1.4.7 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.384 Loading mod RateCalculator 3.3.8 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.401 Loading mod TaskList 0.5.0 (data.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.417 Loading mod base 2.0.77 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.433 Loading mod CleanFloor 2.0.0 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.449 Loading mod bullet-trails 0.7.1 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.465 Loading mod light-overhaul 0.2.2 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.481 Loading mod nixie-tubes 2.0.9 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.498 Loading mod textplates 0.7.2 (data-updates.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.515 Loading mod nixie-tubes 2.0.9 (data-final-fixes.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.531 Loading mod BottleneckLite 1.3.4 (data-final-fixes.lua)
Aug 11 10:43:10 testing factorio[1232]:    0.592 Checksum for core: 4187927925
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of base: 1879415942
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of CleanFloor: 2254551355
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of VehicleSnap: 2430757830
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of bullet-trails: 3844283971
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of calculator-ui: 524243340
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of car-finder: 1120809659
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of DiscoScience: 2800209080
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of even-distribution: 281457414
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of flib: 728527376
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of light-overhaul: 528444255
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of nixie-tubes: 2432398288
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of playtime-plus: 2453392666
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of pushbutton: 3128159157
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of textplates: 1586580192
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of wire-fix: 1543231011
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of BottleneckLite: 2417211789
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of factoryplanner: 654180266
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of gridlines: 4091674549
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of Milestones: 3738671663
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of RateCalculator: 832009472
Aug 11 10:43:10 testing factorio[1232]:    0.593 Checksum of TaskList: 519621940
Aug 11 10:43:10 testing factorio[1232]:    0.771 Prototype list checksum: 1498207259
Aug 11 10:43:10 testing factorio[1232]:    0.807 Info PlayerData.cpp:64: Local player-data.json available, timestamp 1786443969
Aug 11 10:43:10 testing factorio[1232]:    0.807 Info PlayerData.cpp:71: Cloud player-data.json unavailable
Aug 11 10:43:10 testing factorio[1232]:    0.809 Factorio initialised
Aug 11 10:43:10 testing factorio[1232]:    0.809 Info ServerSynchronizer.cpp:22: nextHeartbeatSequenceNumber(0) initialized Synchronizer nex>
Aug 11 10:43:10 testing factorio[1232]:    0.809 Info ServerMultiplayerManager.cpp:808: updateTick(18446744073709551615) changing state from>
Aug 11 10:43:10 testing factorio[1232]:    0.809 Info ServerMultiplayerManager.cpp:808: updateTick(18446744073709551615) changing state from>
Aug 11 10:43:10 testing factorio[1232]:    0.809 Loading map /home/factorio/vanilla-mods/saves/vanilla.zip: 872137 bytes.
Aug 11 10:43:10 testing factorio[1232]:    0.821 Loading level.dat: 1147975 bytes.
Aug 11 10:43:10 testing factorio[1232]:    0.821 Info Scenario.cpp:154: Map version 2.0.77-0
Aug 11 10:43:10 testing factorio[1232]:    0.841 Blueprint storage "blueprint-storage-2.dat" was not found, trying to load previous version >
Aug 11 10:43:10 testing factorio[1232]:    0.841 Loading script.dat: 862746 bytes.
Aug 11 10:43:10 testing factorio[1232]:    0.844 Checksum for script __level__/control.lua: 3792629764
Aug 11 10:43:10 testing factorio[1232]:    0.845 Checksum for script __VehicleSnap__/control.lua: 2163719687
Aug 11 10:43:10 testing factorio[1232]:    0.846 Checksum for script __calculator-ui__/control.lua: 1245882141
Aug 11 10:43:10 testing factorio[1232]:    0.847 Checksum for script __car-finder__/control.lua: 4090552566
Aug 11 10:43:10 testing factorio[1232]:    0.849 Checksum for script __DiscoScience__/control.lua: 2090411717
Aug 11 10:43:10 testing factorio[1232]:    0.850 Script @__even-distribution__/framework.lua:22: 0 [ED] Initializing framework... DEBUG = fa>
Aug 11 10:43:10 testing factorio[1232]:    0.850 Script @__even-distribution__/framework.lua:22: 0 [ED] Registering custom scripts...
Aug 11 10:43:10 testing factorio[1232]:    0.850 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: metatables
Aug 11 10:43:10 testing factorio[1232]:    0.850 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: util
Aug 11 10:43:10 testing factorio[1232]:    0.851 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: helpers
Aug 11 10:43:10 testing factorio[1232]:    0.851 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: setup
Aug 11 10:43:10 testing factorio[1232]:    0.852 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: remote
Aug 11 10:43:10 testing factorio[1232]:    0.852 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: visuals
Aug 11 10:43:10 testing factorio[1232]:    0.852 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: gui-tools
Aug 11 10:43:10 testing factorio[1232]:    0.852 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: drag
Aug 11 10:43:10 testing factorio[1232]:    0.853 Script @__even-distribution__/framework.lua:22: 0 [ED] Script: cleanup
Aug 11 10:43:10 testing factorio[1232]:    0.853 Script @__even-distribution__/framework.lua:22: 0 [ED] GUI-Script: settings-gui
Aug 11 10:43:10 testing factorio[1232]:    0.854 Script @__even-distribution__/framework.lua:22: 0 [ED] Registering default event handlers...
Aug 11 10:43:10 testing factorio[1232]:    0.855 Script @__even-distribution__/framework.lua:22: 0 [ED] Registering custom inputs...
Aug 11 10:43:10 testing factorio[1232]:    0.855 Script @__even-distribution__/framework.lua:22: 0 [ED] Input: inventory-cleanup   event: on>
Aug 11 10:43:10 testing factorio[1232]:    0.855 Script @__even-distribution__/framework.lua:22: 0 [ED] Input: fast-entity-transfer-hook   e>
Aug 11 10:43:10 testing factorio[1232]:    0.855 Script @__even-distribution__/framework.lua:22: 0 [ED] Input: fast-entity-split-hook   even>
Aug 11 10:43:10 testing factorio[1232]:    0.856 Script @__even-distribution__/framework.lua:22: 0 [ED] Successfully initialized
Aug 11 10:43:10 testing factorio[1232]:    0.856 Checksum for script __even-distribution__/control.lua: 140605339
Aug 11 10:43:10 testing factorio[1232]:    0.859 Checksum for script __nixie-tubes__/control.lua: 1542917025
Aug 11 10:43:10 testing factorio[1232]:    0.860 Checksum for script __playtime-plus__/control.lua: 2420395902
Aug 11 10:43:10 testing factorio[1232]:    0.861 Checksum for script __textplates__/control.lua: 3558670443
Aug 11 10:43:10 testing factorio[1232]:    0.864 Checksum for script __wire-fix__/control.lua: 3345811123
Aug 11 10:43:10 testing factorio[1232]:    0.890 Checksum for script __factoryplanner__/control.lua: 2259241580
Aug 11 10:43:10 testing factorio[1232]:    0.895 Checksum for script __gridlines__/control.lua: 4152890871
Aug 11 10:43:10 testing factorio[1232]:    0.901 Checksum for script __Milestones__/control.lua: 3544787678
Aug 11 10:43:10 testing factorio[1232]:    0.906 Checksum for script __RateCalculator__/control.lua: 2687378667
Aug 11 10:43:10 testing factorio[1232]:    0.910 Checksum for script __TaskList__/control.lua: 1367495161
Aug 11 10:43:11 testing factorio[1232]:    0.934 Info UDPSocket.cpp:38: Opening socket at (IP ADDR:({0.0.0.0:34197}))
Aug 11 10:43:11 testing factorio[1232]:    0.934 Hosting game at IP ADDR:({0.0.0.0:34197})
Aug 11 10:43:11 testing factorio[1232]:    0.934 Info HttpSharedState.cpp:57: Downloading https://auth.factorio.com/generate-server-padlock->
Aug 11 10:43:11 testing factorio[1232]:    1.089 Info AuthServerConnector.cpp:112: Obtained serverPadlock for serverHash (FyFwgoVwnjhlMRqWof>
Aug 11 10:43:11 testing factorio[1232]:    1.089 Info ServerMultiplayerManager.cpp:808: updateTick(7605) changing state from(CreatingGame) t>
Aug 11 10:43:11 testing factorio[1232]:    1.089 Error InterruptibleStdioStream.cpp:55: Got EOF on stdin; closing
Aug 11 10:53:50 testing factorio[1232]:  640.136 Received SIGTERM, shutting down
Aug 11 10:53:50 testing factorio[1232]:  640.136 Quitting: signal.
Aug 11 10:53:50 testing factorio[1232]:  640.136 Info MainLoop.cpp:437: Saving map as /home/factorio/vanilla-mods/saves/vanilla.zip
Aug 11 10:53:50 testing systemd[1]: Stopping factorio.service - Factorio Server Vanilla...
Aug 11 10:53:50 testing factorio[1232]:  640.157 Info MainLoop.cpp:448: Saving progress: 0.171233%
Aug 11 10:53:50 testing factorio[1232]:  640.162 Info MainLoop.cpp:448: Saving progress: 100.000000%
Aug 11 10:53:50 testing factorio[1232]:  640.187 Info ServerMultiplayerManager.cpp:119: Disconnecting multiplayer connection.
Aug 11 10:53:50 testing factorio[1232]:  640.187 Info ServerMultiplayerManager.cpp:808: updateTick(7605) changing state from(InGame) to(Disc>
Aug 11 10:53:50 testing factorio[1232]:  640.221 Info ServerMultiplayerManager.cpp:808: updateTick(7605) changing state from(DisconnectingSc>
Aug 11 10:53:50 testing factorio[1232]:  640.254 Info ServerMultiplayerManager.cpp:808: updateTick(7605) changing state from(Disconnecting) >
Aug 11 10:53:50 testing factorio[1232]:  640.254 Info ServerMultiplayerManager.cpp:146: Quitting multiplayer connection.
Aug 11 10:53:50 testing factorio[1232]:  640.254 Info ServerMultiplayerManager.cpp:808: updateTick(7605) changing state from(Disconnected) t>
Aug 11 10:53:50 testing factorio[1232]:  640.254 Info ServerMultiplayerManager.cpp:166: Deleting active scenario (global = true).
Aug 11 10:53:50 testing factorio[1232]:  640.325 Info UDPSocket.cpp:238: Closing socket
Aug 11 10:53:50 testing factorio[1232]:  640.325 Info UDPSocket.cpp:268: Socket closed
Aug 11 10:53:50 testing factorio[1232]:  640.350 Goodbye
Aug 11 10:53:50 testing systemd[1]: factorio.service: Deactivated successfully.
Aug 11 10:53:50 testing systemd[1]: Stopped factorio.service - Factorio Server Vanilla.
Aug 11 10:53:50 testing systemd[1]: factorio.service: Consumed 3.276s CPU time.
Been looking everywhere and i cant seem to find the solution. it probably is some stupid network thing or something else ive failed to notice. any advice would help (about the other issue too :P)
TheFrizz
Burner Inserter
Burner Inserter
Posts: 19
Joined: Fri May 31, 2024 4:28 pm
Contact:

Re: [2.0.77][Linux][Headless] Server doesn't start with daemon service

Post by TheFrizz »

I just recently made a Factorio daemon service for a HAOS app for my kids as a test of AI coding agents. I hit this same error, but I don't believe this error is as fatal as it sounds. Factorio server listens to the keyboard, but because your supervisor parent process isn't interested in sending it input on stdin (like a virtual keyboard etc) it doesn't keep stdin open and Factorio logs this message when it sees stdin close. But I don't believe that's your issue. 10 Seconds later Factorio receives SIGTERM. I believe they are unrelated. On my end AI ended up leaving stdin connected to a dummy connection just to suppress that error but was seen as not critical.
welldown
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Oct 25, 2024 7:56 am
Contact:

Re: [2.0.77][Linux][Headless] Server doesn't start with daemon service

Post by welldown »

SIGTERM is sent by me, because it doesn't show up on the LAN network, so i killed it.

ok, well, i need to keep testing then. still a mystery why it doesnt show up started with a daemon.

also, is there a way, that it could keep writing logs? would feel better, if i could check the logs too, if something went wrong.
TheFrizz
Burner Inserter
Burner Inserter
Posts: 19
Joined: Fri May 31, 2024 4:28 pm
Contact:

Re: [2.0.77][Linux][Headless] Server doesn't start with daemon service

Post by TheFrizz »

Docker probably by default does not expose the listening open ports of the container to the host's network without explicitly configuring them. This would be security by default. Are you sure you've configured Docker to expose the ports? I apologize this is just a shot in the dark. My guess is if you did some kind of netstat from within the server you'd see Factorio listening but there's some kind of Docker misconfiguration.
welldown
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Oct 25, 2024 7:56 am
Contact:

Re: [2.0.77][Linux][Headless] Server doesn't start with daemon service

Post by welldown »

It's not a Docker container tho. It's a VM in my ProxMox machine. Running the binary without systemd i can see the server and connect to it through LAN at least. but it could still be some port misalignment. the VM doesnt have a firewall on its own, i have a higher order firewall and that should have it's ports configured
Post Reply

Return to “Technical Help”