I have no idea what i did wrong, since "service factorio help" works normally and gives me the list of aviable commands. Can anyone please help me?
Thanks
![Smile :)](./images/smilies/icon_e_smile.gif)
EDIT: Ok, nevermind, I got it to work.. just took some fiddling and googling
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
If you found any useful information to resolve your problem, please share it with us heredannyus wrote:EDIT: Ok, nevermind, I got it to work.. just took some fiddling and googling
OkBisa wrote: If you found any useful information to resolve your problem, please share it with us here
That's the systems usergroup and user under which you wish to run factorio, I would set up a specific user named "factorio" on your server and assign all files in /opt/factorio to it (then update the init config setting USERNAME and GROUP to =factorio)dannyus wrote: USERNAME and GROUP things are, because if I have anything else than root written in it, It just dont work
I've been tinkering with this myself a bit, currently there are a number of options you can set to distinguish between instances, for exampleMcBirdy wrote:I'm sure this is something that can be implemented as well. I might look into it over the easter holiday. It would need a slightly different way of handling the save games, as they are named factorio-init-save today.
right now - the only ways this script will support multiple instances is if you mod the factorio.service.example to load a different config per "instance" or copy the script to a separate directory per instance (if you're using the screen approach)runningman wrote:Would be really nice if multiple instances could be managed be the init script. Looking forward to it
Code: Select all
root@ubuntu-Vserver:/usr/local/factorio# service factorio start
/etc/init.d/factorio: line 112: [: too many arguments
/etc/init.d/factorio: line 114: [: too many arguments
Code: Select all
***:***/***# service factorio start
Job for factorio.service failed. See 'systemctl status factorio.service' and 'journalctl -xn' for details.
***:/***/***# systemctl status factorio.service
● factorio.service - (null)
Loaded: loaded (/etc/init.d/factorio)
Active: failed (Result: exit-code) since Ср 2016-03-23 10:16:34 EDT; 6s ago
Process: 8067 ExecStart=/etc/init.d/factorio start (code=exited, status=1/FAILURE)
мар 23 10:16:24 *** su[8086]: pam_unix(su:session): session opened for user factorio by (uid=0)
мар 23 10:16:24 *** su[8088]: Successful su for factorio by root
мар 23 10:16:24 *** su[8088]: + ??? root:factorio
мар 23 10:16:24 *** su[8088]: pam_unix(su:session): session opened for user factorio by (uid=0)
мар 23 10:16:24 *** su[8088]: pam_unix(su:session): session closed for user factorio
мар 23 10:16:26 *** factorio[8067]: Still not running, waiting a while longer...
мар 23 10:16:34 *** factorio[8067]: Failed to start, aborting.
мар 23 10:16:34 *** systemd[1]: factorio.service: control process exited, code=exited status=1
мар 23 10:16:34 *** systemd[1]: Failed to start (null).
мар 23 10:16:34 *** systemd[1]: Unit factorio.service entered failed state.
***:/***/***#
I never really looked into upstart, if you write an example for upstart - feel free to share it with the rest of usBonesaw wrote:Hi Bisa,
Looking at the README.md at the end it talks about getting systemd set up with factorio. But... as I learned systemctl is the systemd tool and that tool is not present nor used on Ubuntu 14.04 as it uses Upstart. Do you know, or anyone else for that matter, have a .conf file that can be used with Upstart?
Code: Select all
description "Factorio server"
expect fork
start on runlevel [3]
stop on runlevel [!2345]
respawn
script
su -c "/path/to/factorio-init/factorio refresh-save" factorio
su -c "/path/to/factorio-init/factorio start" factorio
end script
Code: Select all
****:/opt# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.3 (jessie)
Release: 8.3
Codename: jessie
Code: Select all
****:/opt# ldd /opt/factorio/bin/x64/factorio
linux-vdso.so.1 (0x00007ffe5a96b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f57d5714000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f57d550c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f57d520a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f57d4ff4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f57d4c49000)
/lib64/ld-linux-x86-64.so.2 (0x00007f57d593a000)
Code: Select all
drwxrwxr-x 8 factorio factorio 4096 Mar 23 11:40 factorio
drwxrwxrwx 3 factorio factorio 4096 Mar 23 19:22 factorio-init
Code: Select all
-rw-r--r-- 1 factorio factorio 0 Mar 23 11:24 Factorio.pid
drwxr-xr-x 3 factorio factorio 4.0K Mar 23 09:50 bin
drwxr-xr-x 2 factorio factorio 4.0K Mar 23 11:39 config
-rw-r--r-- 1 factorio factorio 998 Jul 13 2015 config-path.cfg
drwxr-xr-x 4 factorio factorio 4.0K Mar 18 12:57 data
-rw-r--r-- 1 factorio factorio 8.1K Mar 23 11:41 factorio-current.log
-rw-r--r-- 1 factorio factorio 3.0K Mar 23 11:39 factorio-previous.log
drwxr-xr-x 2 factorio factorio 4.0K Mar 23 11:39 mods
-rw-r--r-- 1 factorio factorio 402 Mar 23 11:39 player-data.json
drwxr-xr-x 2 factorio factorio 4.0K Mar 23 11:39 saves
drwxr-xr-x 3 factorio factorio 4.0K Mar 23 11:40 temp
Code: Select all
-rw-r--r-- 1 root root 1.1K Mar 23 19:21 LICENSE
-rw-r--r-- 1 factorio factorio 1.6K Mar 23 19:21 README.md
-rw-r--r-- 1 root root 2.5K Mar 23 19:22 config
-rw-r--r-- 1 root root 2.5K Mar 23 19:21 config.example
-rwxr-xr-x 1 root root 12K Mar 23 19:21 factorio
-rw-r--r-- 1 root root 621 Mar 23 19:21 factorio.service.example
Code: Select all
****:/opt#su factorio
/opt/factorio/bin/x64/factorio --start-server save
0.000 2016-03-23 20:05:33; Factorio 0.12.28 (Build 17913, linux64, headless)
0.017 Operating system: Linux (Debian 8.3)
0.017 Program arguments: "/opt/factorio/bin/x64/factorio" "--start-server" "save"
0.017 Read data path: /opt/factorio/data
0.017 Write data path: /opt/factorio
0.017 Binaries path: /opt/factorio/bin
0.023 Running in headless mode
0.026 Loading mod core 0.0.0 (data.lua)
0.027 Loading mod base 0.12.28 (data.lua)
0.068 Loading mod marathon 1.0.1 (data.lua)
0.110 Loading mod marathon 1.0.1 (data-updates.lua)
0.364 Factorio initialised
0.365 Info Router.cpp:507: Router peerID(65535) shutting down.
0.365 Info Router.cpp:534: Router state -> Disconnected
0.365 Info MultiplayerManager.cpp:912: networkTick(0) mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
0.365 Info MultiplayerManager.cpp:912: networkTick(0) mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
0.365 Loading map /opt/factorio/saves/save.zip
0.378 Info Scenario.cpp:124: Map version 0.12.28-1
0.827 Info MultiplayerManager.cpp:281: 0x7f54ab56e350, (nil)
0.827 Info PosixUDPSocket.cpp:34: Opening socket at port 34197
0.827 Info Router.cpp:534: Router state -> Connected
0.827 Info Synchronizer.cpp:54: NetworkTick(0) initialized Synchronizer local peer(0) latency(6).
0.827 Hosting game at port 34197, peerID 0, session magic 3677
0.827 Info MultiplayerManager.cpp:303: 0x7f54ab56e350, 0x7f54ab56e350
0.827 Info MultiplayerManager.cpp:912: networkTick(0) mapTick(10356399) changing state from(CreatingGame) to(InGame)
0.827 Info NetworkInputHandler.cpp:45: mapTick(10356399) networkTick(0) initialized NetworkInputHandler local peer(0).
0.944 Info MultiplayerManager.cpp:1411: Received peer info for peer(0) username(<server>).
0.944 Info MultiplayerManager.cpp:1059: networkTick(6) mapTick(10356399) received stateChanged peerID(0) oldState(Ready) newState(CreatingGame)
0.944 Info MultiplayerManager.cpp:1059: networkTick(6) mapTick(10356399) received stateChanged peerID(0) oldState(CreatingGame) newState(InGame)
Code: Select all
****:/opt/factorio-init# ./factorio start
Factorio is running.
This seems to be your issue right there, did you add a service file? (you can copy/symlink the factorio.service.example and update its content based on your own environment)WhiteORU wrote: Failed to start factorio.service: Unit factorio.service failed to load: No such file or directory.
The save name, or rather the entire invocation with all its arguments is used to find which process id the server runs as. I opted to keep a static name used for this reason - as such, if you want to play different save games you need to manually copy them aside and use "load-save" to play the one you want to use right now.gloix wrote:Why does the init script generate another save file instead of using the original?