bisa / factorio-init Goto Github PK
View Code? Open in Web Editor NEWFactorio init script
License: MIT License
Factorio init script
License: MIT License
There is a big bug in your script because there is no option with "--port" for yout invocation.
Please remove it (v. 0.12.30)
This one stumped me for a while, basically I hadn't run the factorio server before and it hadn't generated the default config yet.
If the server is started with --config PATH then that config must exist otherwise it creates an error. That error by the way isnt getting shown because it's created in the screen.
Best to check if the config exists, if not warn the user who is executing the script and tell them to run the server once to have it create a default config
I have to look into adding your own custom arguments to the binary (mostly to allow for easy "manual" updates to this script)
Recent 1.12.7 introduced
--disallow-commands and --peer-to-peer
Is there a way to auto update without a user and token?
It appears that the latest version of the script supports it.
narc0tiq/factorio-updater#1
while chatting from the console is perfectly doable - I have not been able to avoid input and output mixing toghter and becoming garbled. Essentially this feels like a limitation of using a terminal for both input and output.
I'll just stick this here for now and use tail on the output file
I use the python script to update the server. I found code in your script to download the experimental version too, but now how to invoke the update for experimental.
Hello,
I'm getting the following message when doing "service factorio start":
"Check Permissions. Cannot Write to /opt/factorio-init/Factorio.pid. Correct the permission and then execute /etc/init.d/factorio status"
I've done chmod 777 and have tried different groups with chown and using -R for the files inside (since I can't go in the directory because it isn't one (?)).
I'm still fairly new to using ssh and might have made a dumb mistake. If so, sorry.
Thanks in advance for answering.
I was able to follow your install instructions perfectly on a CentOS 7 box, but am now trying it on an Amazon Web Services LMI instance.
This does not have systemd, and so this step in your Readme does not work.
Can you advise of alternatives please, or does your script rely on systemd?
When applying updates, update does not numerically sort version numbers;
New version core-linux_headless64 0.13.18.
Wrote /tmp/factorio-update/core-linux_headless64-0.12.35-0.13.0-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.12.
35-0.13.0-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.0-0.13.1-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.0
-0.13.1-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.1-0.13.2-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.1
-0.13.2-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.2-0.13.3-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.2
-0.13.3-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.3-0.13.4-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.3
-0.13.4-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.4-0.13.5-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.4
-0.13.5-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.5-0.13.6-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.5
-0.13.6-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.6-0.13.7-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.6
-0.13.7-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.7-0.13.8-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.7
-0.13.8-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.8-0.13.9-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.8
-0.13.9-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.9-0.13.10-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13.
9-0.13.10-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.10-0.13.11-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.10-0.13.11-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.11-0.13.12-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.11-0.13.12-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.12-0.13.13-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.12-0.13.13-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.13-0.13.14-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.13-0.13.14-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.14-0.13.15-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.14-0.13.15-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.15-0.13.16-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.15-0.13.16-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.16-0.13.17-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.16-0.13.17-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.13.17-0.13.18-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.13
.17-0.13.18-update.zip`
Still not shut down, waiting a while longer...
Factorio is now shut down.
Applying /tmp/factorio-update/core-linux_headless64-0.12.35-0.13.0-update.zip ...
Applying /tmp/factorio-update/core-linux_headless64-0.13.0-0.13.1-update.zip ...
Applying /tmp/factorio-update/core-linux_headless64-0.13.10-0.13.11-update.zip ...
0.000 2016-08-26 18:10:54; Factorio 0.13.1 (Build 22864, linux64, headless)
0.169 Operating system: Linux (Ubuntu 14.04)
0.169 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--apply-update" "/tmp/factorio-update/core-linux_headless64-0.13.10-0.13.11-update.zip"
0.169 Read data path: /home/factorio/factorio/data
0.169 Write data path: /home/factorio/factorio
0.169 Binaries path: /home/factorio/factorio/bin
0.255 Running in headless mode
0.259 Loading mod core 0.0.0 (data.lua)
0.281 Loading mod base 0.13.1 (data.lua)
0.804 Checksum for core: 1399339455
0.804 Checksum for mod base: 2679425721
1.946 Custom inputs active: 0
1.947 Factorio initialised
1.948 Info Updater.cpp:390: Applying update /tmp/factorio-update/core-linux_headless64-0.13.10-0.13.11-update.zip
3.998 Error Util.cpp:57: File /home/factorio/factorio/bin/x64/factorio has unexpected content
4.027 Goodbye
Error! Failed to apply update
Recently, I attempted to upgrade from 0.12.12 to 0.12.19 and the script only applies the first update file even though it downloaded all the update files necessary to update to the latest version. The workaround for this is to run 'service factorio update' until it reaches the latest version. This is inefficient since it repeatedly downloads all the files for update every time it is run.
EDIT: Just saw a similar issue closed about a week ago. Investigating fix and will close if issue is void.
Hello,
I updated my Server from 0.12.28 to 0.12.29 via your script. Now it seem like I have lost 3-5 minutes gameplay time (no desaster). I know all players should disable auto save and the server does the auto save. I set this to 3 minutes. When the last server-auto-save is a few minutes ago and all player quit, does it ever do an auto save again? I then did stop the server and started the update. When I reconnected 2-4 new assembler buildings where missing. Does the server/script save when I stop it?
hello,
the latest server update changed the way that the headless server needs to be initialized. specifically some of the -- commands are pulled from the server-config file instead of through the command line. i just deleted the lines in the init script and it worked fine but people will not be able to launch without removing them
Factorio v 0.12.4 fixed the incorrect exit code on update errors, for completeness I want to adjust the script to use this properly.
I'm having second thoughts on parts of this script.
This issue serves to look at:
I have added more options to the script which I though were missing.
I've attached my script, you could probably do these a little better.
Hi,
my server need a proxy for outgoing http request. Do you can add a proxy parameter?
Cheers!
Any chance you could enhance the service page and readme to include instructions for upstart users?
Please 👍
I get this message everytime I try to start the server with the service command. Any idea why this is happening?
After running "sudo systemctl list-units -t service --all" this is listed among other entries:
factorio.service loaded activating auto-restart
When I try to run that without sudo I get the same error.
I think I figured it out: I tried to start the service as a non root and that may have caused a problem
I had to remove the "peer to peer" flag to make the server work for more than two players.
But I forgot a trailing whitespace - and suddenly the script didn't work anymore.
Even in the debug mode I spent an hour to find out that the whitespace was the mistake.
So could you add a comment there - and maybe remove the peer to peer flag also?
Attempting to start a Factorio server on Ubuntu 14.04.3 without EXTRA_BINARGS
doesn't seem to work. I tried both using an empty string and removing it from INVOCATION
, neither of which worked.
EXTRA_BINARGS
is an empty stringfactorio@xxxxxxxxxx:/home/ubuntu$ service factorio restart
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
No running server, starting it...
DEBUG LOG: last modified save: /opt/factorio/saves/factorio-init-save.zip
DEBUG LOG: using existing factorio-init-save.zip
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
INVOCATION
factorio@xxxxxxxxxx:/home/ubuntu$ service factorio restart
DEBUG LOG: found pid: 1635
1983
28344
28797
28924
/etc/init.d/factorio: line 123: [: too many arguments
/etc/init.d/factorio: line 125: [: too many arguments
No running server, starting it...
DEBUG LOG: last modified save: /opt/factorio/saves/factorio-init-save.zip
DEBUG LOG: using existing factorio-init-save.zip
DEBUG LOG: found pid: 1635
1983
28344
28797
28924
29068
This output continued for a while before it quit.
Launching the new experimental 0.14 with the script no longer works as it uses a no longer supported command line option which needs to be removed from the INVOCATION variable.
/opt/factorio/bin/x64/factorio --config /opt/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json --autosave-interval 5 --autosave-slots 24 --latency-ms 75
unrecognised option '--latency-ms'
(And thanks for the script, really helps running a server!)
The exit code when running "status" check is invalid, should return > 0 when the server is not running.
I'll need to investigate this behaviour and implement a way to handle when the updater returns multiple patches - from forum topic http://www.factorioforums.com/forum/viewtopic.php?p=101417#p101417
root@mc:/opt# service factorio update
Could not find factorio server settings file: /opt/factorio/data/server-settings.json
Update your config and point SERVER_SETTINGS to a modified version of data/server-settings.example.json
I just revived my old Factorio 0.12.30 headless server to update it to 0.13.x
To make things easy, I first updated your init-script (git pull) and then tried to update my "old" Factorio installation "service factorio update". But that only gave me the above error message. I assume that file is new with 0.13.x ? If so, how would be the correct update path? Can't I use your script together with the update in this case?
Can we use this to detect crashes and restart the server
Why the systemd was abandoned? I think it was good and also the output from it was quite nice.
Now status is only - Factorio is running, nothing more. 👎
Also it's no longer running as service ?
I just updated to the latest master (as of time of writing) and am tinkering with a few things in the invocation. I've noticed that the tail
command is not terminated along with the Factorio server when the server terminates abnormally (eg: missing save file).
I'm unsure if this appears in other situations, but this is where I've observed it.
dmulligan@dmulligan /opt/factorio-init [master]±% sudo service factorio start !3658
dmulligan@dmulligan /opt/factorio-init [master]±% sudo service factorio status !3659
● factorio.service - LSB: start and stop Factorio server
Loaded: loaded (/etc/init.d/factorio)
Active: active (running) since Mon 2016-09-12 16:56:16 EDT; 1s ago
Process: 5186 ExecStart=/etc/init.d/factorio start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/factorio.service
└─5208 tail -f /opt/factorio/bin/x64/../../server.fifo
Sep 12 16:56:16 dmulligan.ca su[5202]: + ??? root:factorio
Sep 12 16:56:16 dmulligan.ca su[5202]: pam_unix(su:session): session opened for user factorio by (uid=0)
Sep 12 16:56:16 dmulligan.ca su[5204]: Successful su for factorio by root
Sep 12 16:56:16 dmulligan.ca su[5204]: + ??? root:factorio
Sep 12 16:56:16 dmulligan.ca su[5204]: pam_unix(su:session): session opened for user factorio by (uid=0)
Sep 12 16:56:16 dmulligan.ca su[5206]: Successful su for factorio by root
Sep 12 16:56:16 dmulligan.ca su[5206]: + ??? root:factorio
Sep 12 16:56:16 dmulligan.ca su[5206]: pam_unix(su:session): session opened for user factorio by (uid=0)
Sep 12 16:56:16 dmulligan.ca factorio[5186]: Started Factorio, please see log for details
Sep 12 16:56:16 dmulligan.ca systemd[1]: Started LSB: start and stop Factorio server.
dmulligan@dmulligan /opt/factorio-init [master]±% sudo service factorio stop !3660
dmulligan@dmulligan /opt/factorio-init [master]±% sudo service factorio status !3661
● factorio.service - LSB: start and stop Factorio server
Loaded: loaded (/etc/init.d/factorio)
Active: inactive (dead)
Sep 12 16:56:16 dmulligan.ca su[5204]: Successful su for factorio by root
Sep 12 16:56:16 dmulligan.ca su[5204]: + ??? root:factorio
Sep 12 16:56:16 dmulligan.ca su[5204]: pam_unix(su:session): session opened for user factorio by (uid=0)
Sep 12 16:56:16 dmulligan.ca su[5206]: Successful su for factorio by root
Sep 12 16:56:16 dmulligan.ca su[5206]: + ??? root:factorio
Sep 12 16:56:16 dmulligan.ca su[5206]: pam_unix(su:session): session opened for user factorio by (uid=0)
Sep 12 16:56:16 dmulligan.ca factorio[5186]: Started Factorio, please see log for details
Sep 12 16:56:16 dmulligan.ca systemd[1]: Started LSB: start and stop Factorio server.
Sep 12 16:56:20 dmulligan.ca systemd[1]: Stopping LSB: start and stop Factorio server...
Sep 12 16:56:20 dmulligan.ca factorio[5264]: No running server.
Sep 12 16:56:20 dmulligan.ca systemd[1]: Stopped LSB: start and stop Factorio server.
dmulligan@dmulligan /opt/factorio-init [master]±% sudo ps ax -F | grep factorio !3662
factorio 5208 1 0 1460 708 0 16:56 ? S 0:00 tail -f /opt/factorio/bin/x64/../../server.fifo
dmullig+ 5311 2978 0 3182 2008 0 16:56 pts/0 S+ 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn factorio
You can see that the server is not started successfully (no factorio
process is spawned on start) but after stopping, the tail
command remains active.
The factorio.service does not start the factorio server in the prefered screen session.
All was set uped over the non-root user, the root-user was used to create the symlinks and to use the systemctl cmd.
Please fix this issue so that the server can run as service in a screen session (important)!
I used the "service factorio screen" command very often, to see whats going on. You seem to have removed it. Whats the new way to reach the console output?
Take advantage of Narcs updater https://github.com/narc0tiq/factorio-updater allowing Factorio to update with its official update process
just fail with a proper error if the dependancy "screen" is not installed...
Hello,
today I tried your script on Ubuntu 14.04.4 LTS but without success. I always get the error, leaving open processes:
root@mc:/opt/factorio# service factorio start
Still not running, waiting a while longer...
Failed to start, aborting.
root@mc:/opt/factorio# ps -Af | grep fac
factorio 31747 1 0 13:56 ? 00:00:00 SCREEN -dmS factorio /opt/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 3 --autosave-slots 6 --latency-ms 250 --disallow-commands --peer-to-peer
factorio 31748 31747 0 13:56 pts/3 00:00:00 /opt/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 3 --autosave-slots 6 --latency-ms 250 --disallow-commands --peer-to-peer
root 31882 29998 0 13:58 pts/0 00:00:00 grep --color=auto fac
root@mc:/opt/factorio#
These open processes block the port so I have to kill them.
According to the log, everything is fine I assume:
root@mc:/opt/factorio# cat factorio-current.log
0.000 2016-03-18 13:56:34; Factorio 0.12.26 (Build 17762, linux64)
0.052 Operating system: Linux (Ubuntu 14.04)
0.052 Program arguments: "/opt/factorio/bin/x64/factorio" "--start-server" "factorio-init-save" "--autosave-interval" "3" "--autosave-slots" "6" "--latency-ms" "250" "--disallow-commands" "--peer-to-peer"
0.052 Read data path: /opt/factorio/data
0.052 Write data path: /opt/factorio
0.052 Binaries path: /opt/factorio/bin
0.061 Running in headless mode
0.064 Loading mod core 0.0.0 (data.lua)
0.066 Loading mod base 0.12.26 (data.lua)
0.427 Factorio initialised
0.428 Info Router.cpp:556: Router peerID(65535) shutting down.
0.428 Info Router.cpp:582: Router state -> Disconnected
0.428 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
0.428 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
0.428 Loading map /opt/factorio/saves/factorio-init-save.zip
0.459 Info Scenario.cpp:124: Map version 0.12.26-0
0.709 Info MultiplayerManager.cpp:282: 0x7f5f997896e0, (nil)
0.709 Info PosixUDPSocket.cpp:34: Opening socket at port 65353
0.709 Info Router.cpp:582: Router state -> Connected
0.709 Info Synchronizer.cpp:54: NetworkTick(0) initialized Synchronizer local peer(0) latency(15).
0.709 Hosting game at port 65353, peerID 0, session magic 2122
0.709 Info MultiplayerManager.cpp:304: 0x7f5f997896e0, 0x7f5f997896e0
0.709 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(1235041) changing state from(CreatingGame) to(InGame)
0.709 Info NetworkInputHandler.cpp:40: mapTick(1235041) networkTick(0) initialized NetworkInputHandler local peer(0).
0.976 Info MultiplayerManager.cpp:1385: Received peer info for peer(0) username().
0.976 Info MultiplayerManager.cpp:1043: networkTick(15) mapTick(1235041) received stateChanged peerID(0) oldState(Ready) newState(CreatingGame)
0.976 Info MultiplayerManager.cpp:1043: networkTick(15) mapTick(1235041) received stateChanged peerID(0) oldState(CreatingGame) newState(InGame)
root@mc:/opt/factorio#
Du you have any idea why your script says the server doesn't start?
It looks like the moved several more of the command line args have been moved into the json. Once again causing the script to fail to load.
It looks to be the auto save frequency and slots
I'm sorry that I have to create that new issue but googling didn't lead to a solution, therefor I'm guessing this is a bug. I get this error when trying service factorio start
# systemctl status factorio.service
● factorio.service - (null)
Loaded: loaded (/etc/init.d/factorio)
Active: failed (Result: exit-code) since Tue 2016-04-12 18:15:57 CEST; 30s ago
Process: 8851 ExecStart=/etc/init.d/factorio start (code=exited, status=1/FAILURE)
Apr 12 18:15:57 vmd10967.contabo.host su[8865]: pam_unix(su:session): session closed for user factorio
Apr 12 18:15:57 vmd10967.contabo.host factorio[8851]: Check Permissions. Cannot write to /opt/factorio/Factorio.pid. Correct the permissions and then excute: /etc/init.d/factorio status
Apr 12 18:15:57 vmd10967.contabo.host su[8870]: Successful su for factorio by root
Apr 12 18:15:57 vmd10967.contabo.host su[8870]: + ??? root:factorio
Apr 12 18:15:57 vmd10967.contabo.host su[8870]: pam_unix(su:session): session opened for user factorio by (uid=0)
Apr 12 18:15:57 vmd10967.contabo.host su[8870]: pam_unix(su:session): session closed for user factorio
Apr 12 18:15:57 vmd10967.contabo.host factorio[8851]: Error! Unable to find any saves in /opt/factorio/saves
Apr 12 18:15:57 vmd10967.contabo.host systemd[1]: factorio.service: control process exited, code=exited status=1
Apr 12 18:15:57 vmd10967.contabo.host systemd[1]: Failed to start (null).
Apr 12 18:15:57 vmd10967.contabo.host systemd[1]: Unit factorio.service entered failed state.
in my factorio folder there is no Factorio.pid file! Is this file supposed to be generated? Or am I supposed to copy this file from somewhere else?
System info: Debian headless server
with 0.13 introducing logged chat it's possible to parse and act on chat commands
Add command to untar specified tarball to update/install Factorio itself
/etc/init.d/factorio update
stops the server as one of the first things it does, even in --dry-run
mode.
If running in --dry-run
, or there are no updates, there is no real need to stop the server.
Hi, sorry to open this as an issue but got an odd error.
I tried to get the server running via your script and hit a few bumps along the way but currently cant get past this one.
Unit factorio.service has begun starting up.
Jul 10 17:16:34 RMMD-MC-1 factorio[13734]: DEBUG: Determining WRITE_DIR based on /opt/factorio/config/config.ini, IF you edited write-data from the default, this probably fails
Jul 10 17:16:34 RMMD-MC-1 factorio[13734]: DEBUG: write path: /opt/factorio/bin/x64/../..
Jul 10 17:16:34 RMMD-MC-1 factorio[13734]: Unable to start vana
Jul 10 17:16:34 RMMD-MC-1 factorio[13734]: Could not start vana
Jul 10 17:16:34 RMMD-MC-1 systemd[1]: factorio.service: control process exited, code=exited status=1
Jul 10 17:16:34 RMMD-MC-1 systemd[1]: Failed to start Factorio Server.
This is running on a Centos7 x64 box, Below is my server config and also all the other configs i could think off
[root@RMMD-MC-1 factorio]# cat config/config.ini [path] read-data=__PATH__executable__/../../data write-data=__PATH__executable__/../.. [general] locale= [debug] show_fps=basic show_detailed_info=basic show_time_used_percent=basic show_multiplayer_waiting_icon=basic show_multiplayer_waiting_statistics=basic show_tile_grid=full show_collision_rectangles=detailed show_selection_rectangles=detailed show_paths=full show_next_waypoint_bb=full show_target=full show_unit_group_info=full show_unit_stuck_info=full show_last_path_detail=full show_path_cache=full show_path_cache_paths=full show_rail_paths=full show_rolling_stock_count=full show_rail_connections=detailed show_rail_segments=detailed show_rail_joints=detailed show_train_stop_point=detailed show_train_braking_distance=full show_train_signals=full show_network_connected_entities=detailed show_circuit_network_numbers=detailed show_energy_sources_networks=detailed show_active_state=detailed show_pollution_values=full show_active_entities_on_chunk_counts=full show_active_chunks=full show_enemy_expansion_candidate_chunks=full show_tile_variations=full show_raw_tile_transitions=never show_tile_correction_previews=never show_fluid_box_fluid_info=basic show_environment_sound_info=basic show_logistic_robot_targets=full [graphics] multisampling-level=0 lights-render-quality=0.200000003 fullscreen=false system-ui-scale=true custom-ui-scale=1 preferred-screen-index=255 show-smoke=true show-clouds=true show-inserter-shadows=true show-minimap=true show-pollution-on-minimap=true show-grid-when-paused=true show-inserter-arrows-when-detailed-info-is-on=false show-mining-drill-arrows-when-detailed-info-is-on=true light-entity-info-background=false force-opengl=false graphics-quality=normal v-sync=true screenshots_queue_size=10 screenshots_threads_count=1 max-texture-size=0 video-memory-usage=high disable-fma3=auto [sound] master_volume=0.600000024 ambient_volume=0.400000006 game_effects_volume=0.699999988 gui_effects_volume=0.699999988 walking_volume=0.300000012 environment_volume=0.449999988 alert_volume=0.550000012 audible_distance=40 environment_audible_distance=15 maximum_environment_sounds=15 active_gui_volume_modifier=1.29999995 active_gui_environment_volume_modifier=0.600000024 ambient_music_pause_mean_seconds=45 ambient_music_pause_variance_seconds=30 ambient_music_mode=interleave-main-tracks-with-interludes [other] tooltip_delay=0.0399999991 max_threads=4 show_tips_and_tricks=true autosort_inventory=true research_finished_stops_game=true use_item_groups=true use_item_subgroups=true output_console_delay=1200 autosave_interval=2 autosave_slots=3 enable_latency_hiding=true enable_new_mods=true port=34197 check_updates=true enable_experimental_updates=false proxy= verbose-logging=false
factorio-init config
http://pastebin.com/tRnTqW62
(gave up trying to deal with Githubs "code" for comments)
I can however run the server manually so at present it i running in a screen session.
I'll look into starting the server with separate --config options to allow multiple instances to run from the same binary
Factorio launches in the background, but factorio-init doesn't recognise it. To stop it I have to 'killall factorio'. Is it an issue with ubuntu or me?
factorio@orange:/opt/factorio/mods$ factorio start
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: last modified save: /opt/factorio/saves/factorio-init-save.zip
DEBUG LOG: using existing factorio-init-save.zip
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
Still not running, waiting a while longer...
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
DEBUG LOG: could not find a pid for binary: "/opt/factorio/bin/x64/factorio"
Failed to start, aborting.
factorio@linux:~$ rm -Rfv /tmp/factorio-update; sudo /etc/init.d/factorio update
removed ‘/tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip’
removed ‘/tmp/factorio-update/core-linux_headless64-0.12.26-0.12.27-update.zip’
removed directory: ‘/tmp/factorio-update’
Checking for updates...
New version core-linux_headless64 0.12.28.
Wrote /tmp/factorio-update/core-linux_headless64-0.12.26-0.12.27-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.12.26-0.12.27-update.zip`
Wrote /tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip, apply with `factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip`
Still not shut down, waiting a while longer...
Factorio is now shut down.
Applying /tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip ...
0.000 2016-03-22 19:57:17; Factorio 0.12.26 (Build 17762, linux64)
0.051 Operating system: Linux (Ubuntu 15.04)
0.051 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--apply-update" "/tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip"
0.051 Read data path: /home/factorio/factorio/data
0.051 Write data path: /home/factorio/factorio
0.051 Binaries path: /home/factorio/factorio/bin
0.062 Running in headless mode
0.066 Loading mod core 0.0.0 (data.lua)
0.069 Loading mod base 0.12.26 (data.lua)
0.666 Factorio initialised
0.667 Info Updater.cpp:390: Applying update /tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip
1.072 Error Util.cpp:57: File /home/factorio/factorio/bin/x64/factorio has unexpected content
1.087 Goodbye
Error! Failed to apply update
You can try to apply it manually with:
su factorio -c "/home/factorio/factorio/bin/x64/factorio --apply-update /tmp/factorio-update/core-linux_headless64-0.12.27-0.12.28-update.zip"
factorio@linux:~$
I installed the headless server from factorio, followed the guide, and it runs smoothly, added user factorio:factorio and chowned the folder to factorio:factorio
it works quite good... but when i try to start via the factorio-init, it gives this:
DEBUG: Determining WRITE_DIR based on /root/factorio/config/config.ini, IF you edited write-data from the default, this probably fails
DEBUG: write path: /root/factorio/bin/x64/../..
Check Permissions. Cannot write to /root/factorio/bin/x64/../..
Here is the invocation:
DEBUG: Determining WRITE_DIR based on /root/factorio/config/config.ini, IF you edited write-data from the default, this probably fails
DEBUG: write path: /root/factorio/bin/x64/../..
/root/factorio/bin/x64/factorio --config /root/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /root/factorio/online_show.config.json
everything is nicelly configured, and the paths are corrects, any help will be apreciated.
Running factorio-init/factorio start
with 0.14.12 experimental version gave me this error:
Unable to start Factorio
Could not start Factorio
I ran `factorio-init/factorio invocation' and saw that the script was trying to run this command:
/opt/factorio/bin/x64/factorio --config /opt/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json --autosave-interval 10 --autosave-slots 3 --allow-commands admins-only
Reading the changelog for 0.14.12, I saw that the autosave-interval
and autosave-slots
(as well as allow_commands
, afk_autokick_interval
, and auto_pause
) are now settable only in server-settings
. I think this is what is causing the issue.
ensure the script gives proper feedback when attempting to start the server without an existing save file/dir
I'm thinking of enhancing the installation process by using the freely provided headless tar package.
Options like "clean install" or "force update latest version" spring to mind, but without a readily accessible link to the "latest" version I'm not going to mess around with this - if you're watching this, feel free to show some love in https://forums.factorio.com/viewtopic.php?f=6&t=22210 to support this.
Currently, if you add the --headless flag, the check to see if the PID is running does not successfully return. I'm posting this to possibly plan to pull and fix in the next couple weeks, but I want to make sure it is actually an issue and I'm not just missing anything.
Factorio as it is today stores 2 logs, one "current" and a previous log.
I've been wanting to add a feature that would rotate/retain logs on a server graceful shutdown to store more than 2 restarts' worth of logs.
Thanks for creating nice script.
I think that I have to create actual file instead of symlink so that run systemctl enable factorio.service
It is the correct command?
cp /opt/factorio-init/factorio.service /etc/systemd/system/factorio.service
Hi guy
I have a little problem when i use your init, i do all steps and i can use "service factorio start" but no "systemctl factorio start"
When i do systemctl show me this error:
unknown operation 'factorio'.
You know what is the problem?
Thanks you a lot ^^
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.