[linux] Dedicated server init script

Find multiplayer games.
Tools/scripts to run a dedicated server.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

[linux] Dedicated server init script

Post by Bisa »

For those interested in a headless factorio server running on linux I've cooked up a init script
https://github.com/Bisa/factorio-init

For issues and general support, please use the github issue tracker.


Looking for a guide how to run factorio on linux? Check out the wiki

Feel free to contribute if you find somewhere to improve.
Last edited by Bisa on Sat Nov 21, 2020 9:53 am, edited 5 times in total.
Hosting a factorio server? Take a look at this || init script ||.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

* reserved *
Last edited by Bisa on Sat Aug 08, 2015 8:13 pm, edited 1 time in total.
Hosting a factorio server? Take a look at this || init script ||.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

Mikerman50 wrote: Hi Bisa, tried to setup a linux based server (CentOS) on my VPS but i get error

Code: Select all

could not find a pid with invocation:
Image

as you can see linkswere setup correctly and points to the binary file.. any advice?


many thanks
Let me cehck if I can figure out why on my setup - stay tuned.
Mikerman50 wrote: as you can see linkswere setup correctly and points to the binary file.. any advice?
Come to think of it, the debug log is not nessesarily giving you an error, just information from the find_pid() method, is the server not starting correctly after you use the load-save command?
To try this, please run "service factorio status" after you run "service factorio load-save server" and give me the output.

(btw, seelcting text in Putty automatically copis it to your clipboard so you do not need to screenshot the window)
Last edited by Bisa on Sat Aug 08, 2015 8:13 pm, edited 1 time in total.
Hosting a factorio server? Take a look at this || init script ||.
Mikerman50
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jul 18, 2015 11:40 am
Contact:

Re: [linux] Dedicated server init script

Post by Mikerman50 »

Code: Select all

[root@SimCraftWorkShop ~]# service factorio load-save server
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server server --autosave-interval 10"
DEBUG LOG: last modified save: /home/minecraft/factorio/saves/server.zip
DEBUG LOG: using existing server.zip
and then after I run Status and get

Code: Select all

[root@SimCraftWorkShop ~]# service factorio status
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server server --autosave-interval 10"
Factorio is not running.
The Init code works fine and great (which i like very much) perhaps i'm missing some dependencies for the binary to run?
here's my pid list at time of testing this

Code: Select all

[root@SimCraftWorkShop ~]# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  19236  1464 ?        Ss   Jul24   0:00 init
root         2  0.0  0.0      0     0 ?        S    Jul24   0:00 [kthreadd/8009]
root         3  0.0  0.0      0     0 ?        S    Jul24   0:00 [khelper/80096]
root       124  0.0  0.0  10664   572 ?        S<s  Jul24   0:00 /sbin/udevd -d
root       460  0.0  0.5 183752  3360 ?        Sl   Jul24   0:02 /sbin/rsyslogd
dbus       481  0.0  0.1  21408   916 ?        Ss   Jul24   0:00 dbus-daemon --s
68         490  0.0  0.3  37224  2316 ?        Ssl  Jul24   0:00 hald
root       491  0.0  0.2  20400  1300 ?        S    Jul24   0:00 hald-runner
root       533  0.0  0.1  64372  1148 ?        Ss   Jul24   0:03 /usr/sbin/sshd
root       540  0.0  0.1  22096   952 ?        Ss   Jul24   0:00 xinetd -stayali
root       547  0.0  0.1  64568   936 ?        Ss   Jul24   0:00 /usr/sbin/sasla
root       549  0.0  0.1  64568   672 ?        S    Jul24   0:00 /usr/sbin/sasla
root       563  0.0  0.4  80816  2364 ?        Ss   Jul24   0:01 sendmail: accep
smmsp      571  0.0  0.3  76412  2080 ?        Ss   Jul24   0:00 sendmail: Queue
root       586  0.0  0.2 117216  1228 ?        Ss   Jul24   0:00 crond
root       606  0.0  0.1   4068   592 tty1     Ss+  Jul24   0:00 /sbin/mingetty
root       607  0.0  0.1   4068   596 tty2     Ss+  Jul24   0:00 /sbin/mingetty
root     11636  0.0  0.7  94016  4408 ?        Ss   16:32   0:00 sshd: root@pts/
root     11638  0.0  0.3 108304  1896 pts/0    Ss   16:32   0:00 -bash
root     11969  0.0  0.1 110240  1152 pts/0    R+   16:37   0:00 ps aux
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

I see, please note that I've updated the script to fix a screen dependancy (but seeing you run minecraft I assume you already have screen installed)
Also, try starting the binary from console with the same invocation (as the factorio user!):

Code: Select all

/home/minecraft/factorio/bin/x64/factorio --start-server server --autosave-interval 10
If you are able to run the binay you should get a log outputting to your console (press ctrl+c to exit)
Hosting a factorio server? Take a look at this || init script ||.
Mikerman50
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jul 18, 2015 11:40 am
Contact:

Re: [linux] Dedicated server init script

Post by Mikerman50 »

yeah i have had a mc server running on it, the minecraft dir is just the default user space of the VPS, (easier for me to access in FTP :P )

so i've tried what you recommended after updating the scripts and config and then turned the debug info back to 1 and i ended up with this result after running just the binary without using the script

Code: Select all

[root@SimCraftWorkShop ~]# service factorio status
Factorio is not running.
[root@SimCraftWorkShop ~]# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  19236  1468 ?        Ss   17:20   0:00 init
root         2  0.0  0.0      0     0 ?        S    17:20   0:00 [kthreadd/80096]
root         3  0.0  0.0      0     0 ?        S    17:20   0:00 [khelper/80096]
root       124  0.0  0.0  10664   568 ?        S<s  17:20   0:00 /sbin/udevd -d
root       460  0.0  0.2 183552  1480 ?        Sl   17:20   0:00 /sbin/rsyslogd -i /var/run/syslogd.pid
dbus       481  0.0  0.1  21408   916 ?        Ss   17:20   0:00 dbus-daemon --system
68         490  0.0  0.4  37224  2328 ?        Ssl  17:20   0:00 hald
root       491  0.0  0.2  20400  1296 ?        S    17:20   0:00 hald-runner
root       533  0.1  0.1  64372  1144 ?        Ss   17:20   0:00 /usr/sbin/sshd
root       540  0.0  0.1  22096   952 ?        Ss   17:20   0:00 xinetd -stayalive -pidfile /var/run/xi
root       547  0.0  0.1  64568   936 ?        Ss   17:20   0:00 /usr/sbin/saslauthd -m /var/run/saslau
root       549  0.0  0.1  64568   672 ?        S    17:20   0:00 /usr/sbin/saslauthd -m /var/run/saslau
root       563  0.0  0.4  80816  2348 ?        Ss   17:20   0:00 sendmail: accepting connections
smmsp      571  0.0  0.3  76416  2068 ?        Ss   17:20   0:00 sendmail: Queue runner@01:00:00 for /v
root       579  0.0  1.7 291276 10252 ?        Ss   17:20   0:00 /usr/sbin/httpd
root       586  0.0  0.2 117212  1216 ?        Ss   17:20   0:00 crond
root       605  0.0  0.1   4068   592 tty1     Ss+  17:20   0:00 /sbin/mingetty console
root       606  0.0  0.1   4068   596 tty2     Ss+  17:20   0:00 /sbin/mingetty tty2
500        607  0.0  0.9 291276  5716 ?        S    17:20   0:00 /usr/sbin/httpd
root      2548  0.0  0.7  94016  4412 ?        Ss   17:21   0:00 sshd: root@pts/0
root      3141  0.0  0.3 108304  1888 pts/0    Ss   17:21   0:00 -bash
root      3973  0.0  0.5  65716  3232 ?        Ss   17:21   0:00 sshd: [accepted]
sshd      3974  0.0  0.2  65716  1544 ?        S    17:21   0:00 sshd: [net]
root      3975  0.0  0.1 110236  1152 pts/0    R+   17:21   0:00 ps aux
[root@SimCraftWorkShop ~]# service factorio load-save server
Removing rogue PIDFILE
Still not running, waiting a while longer...
Failed to start, aborting.
[root@SimCraftWorkShop ~]# service factorio start
Removing rogue PIDFILE
Still not running, waiting a while longer...
Failed to start, aborting.
[root@SimCraftWorkShop ~]# service factorio help
Usage: /etc/init.d/factorio COMMAND

Available commands:
   start                 Starts the server
   stop                  Stops the server
   restart               Restarts the server
   status                Displays server status
   load-save [name]              Loads the specified save
   screen                Shows the server screen
[root@SimCraftWorkShop ~]# service factorio screen
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
Server is not running. Do you want to start it? [n]: y
DEBUG LOG: last modified save: /home/minecraft/factorio/saves/factorio-init-save.zip
DEBUG LOG: using existing factorio-init-save.zip
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: comparing pidfile pid "" with actual pid: -1
Removing rogue PIDFILE
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
Still not running, waiting a while longer...
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
DEBUG LOG: no pidfile found
DEBUG LOG: could not find a pid with invocation: "/home/minecraft/factorio/bin/x64/factorio --start-server factorio-init-save --autosave-interval 10"
Failed to start, aborting.
[root@SimCraftWorkShop ~]# cd /
[root@SimCraftWorkShop /]# cd home/minecraft/factorio/bin/x64
[root@SimCraftWorkShop x64]# ./ factorio
-bash: ./: is a directory
[root@SimCraftWorkShop x64]# ./factorio
./factorio: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./factorio)
./factorio: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./factorio)
./factorio: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./factorio)
[root@SimCraftWorkShop x64]# yum install glib*                                                         Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
14: problem making ssl connection
^[[A * base: centos.openitc.uk
 * epel: mirrors.coreix.net
 * extras: centos.openitc.uk
 * rpmforge: www.mirrorservice.org
 * updates: centos.serverspace.co.uk
base                                                                            | 3.7 kB     00:00
extras                                                                          | 3.4 kB     00:00
rpmforge                                                                        | 1.9 kB     00:00
updates                                                                         | 3.4 kB     00:00
vz-base                                                                         |  951 B     00:00
vz-updates                                                                      |  951 B     00:00
Setting up Install Process
Package glib-networking-2.28.6.1-2.2.el6.x86_64 already installed and latest version
Package glibc-devel-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Package 1:glib-devel-1.2.10-33.el6.rf.x86_64 already installed and latest version
Package glibc-utils-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Package glibmm24-doc-2.22.1-1.el6.x86_64 already installed and latest version
Package glibc-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Package glib2-doc-2.28.8-4.el6.noarch already installed and latest version
Package glibmm24-devel-2.22.1-1.el6.x86_64 already installed and latest version
Package glibmm24-2.22.1-1.el6.x86_64 already installed and latest version
Package glib2-static-2.28.8-4.el6.x86_64 already installed and latest version
Package 1:glib-1.2.10-33.el6.rf.x86_64 already installed and latest version
Package glibc-static-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Package glib2-2.28.8-4.el6.x86_64 already installed and latest version
Package glib2-devel-2.28.8-4.el6.x86_64 already installed and latest version
Package glibc-headers-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Package glibc-common-2.12-1.149.el6_6.9.x86_64 already installed and latest version
Nothing to do
[root@SimCraftWorkShop x64]#
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

try ldd on the factorio binary, i.e:

Code: Select all

ldd /home/minecraft/factorio/bin/x64/factorio
This will give you a list of libraries and if they are installed or missing, please see https://forums.factorio.com/forum/vie ... 543#p94543 where I explain the install process on linux
Hosting a factorio server? Take a look at this || init script ||.
Mikerman50
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jul 18, 2015 11:40 am
Contact:

Re: [linux] Dedicated server init script

Post by Mikerman50 »

this may take a while hehe.

Code: Select all

[root@SimCraftWorkShop x64]# ldd /home/minecraft/factorio/bin/x64/factorio
/home/minecraft/factorio/bin/x64/factorio: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/minecraft/factorio/bin/x64/factorio)
/home/minecraft/factorio/bin/x64/factorio: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by /home/minecraft/factorio/bin/x64/factorio)
/home/minecraft/factorio/bin/x64/factorio: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by /home/minecraft/factorio/bin/x64/factorio)
        linux-vdso.so.1 =>  (0x00007fff14dfe000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3908b49000)
        libasound.so.2 => /lib64/libasound.so.2 (0x00007f390885e000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f3908520000)
        libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007f3908316000)
        libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007f3908114000)
        libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007f3907f0a000)
        libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007f3907cfb000)
        libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f3907a98000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f390788f000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f390760b000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f39073f5000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f3907060000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3908d71000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f3906e5c000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f3906c3e000)
        libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f3906a33000)
        libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f390682e000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f390661b000)
        libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x00007f39063f3000)
        libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f39061f1000)
        libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007f3905ff0000)
        libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 (0x00007f3905dd9000)
        libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 (0x00007f3905bd5000)
        libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007f39059d0000)
        libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f39057c4000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f39055a5000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f39053a1000)
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

by the looks of it you are only missing libc and libm unless Im misstaken; apt-get install libc libm
Hosting a factorio server? Take a look at this || init script ||.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

Thanks to Narc0tic we now have a more robust update process.
Also note that I've re-used the previous updater and made it into an installer of sorts.
Hosting a factorio server? Take a look at this || init script ||.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: [linux] Dedicated server init script

Post by Narc »

This is very nice indeed. If my server uptime weren't measured in the hundreds of days (and if I weren't the only one playing on it), I'd want this nice init script to help me make sure everything was running right.

Excellent stuff, good sir, keep up the excellent work.
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [linux] Dedicated server init script

Post by DaCyclops »

This has made running Factorio on a small footprint linux box much easier for a person like me with minimum linux knowledge (and not wanting to waste 1Gig of memory on WindowsOS).

one thing to note: Your implementation of the Updating via Narc's script, if it finds multiple updates, it will only apply the first one. Can workaround with multiple runs of "update" until it says it is done, but its a small thing to point out.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

DaCyclops wrote:This has made running Factorio on a small footprint linux box much easier for a person like me with minimum linux knowledge (and not wanting to waste 1Gig of memory on WindowsOS).

one thing to note: Your implementation of the Updating via Narc's script, if it finds multiple updates, it will only apply the first one. Can workaround with multiple runs of "update" until it says it is done, but its a small thing to point out.
Thank you, I'm glad it's of use =)
As for multiple updates, I'll have to have a look at the behaviour and see if I can come up with a way to handle it, I've registered an issue on github to keep track of it:
https://github.com/Bisa/factorio-init/issues/9
Hosting a factorio server? Take a look at this || init script ||.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

Now supports extra binary arguments (I've added --disallow-commands and --peer-to-peer as defaults)

(as of now, I'm only updating the master branch, I will get to denoting releases once I've figured out a way to correctly follow the semantic versioning paradigm)
Hosting a factorio server? Take a look at this || init script ||.
strech
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Sep 14, 2015 10:49 am
Contact:

Re: [linux] Dedicated server init script

Post by strech »

Hello, thank you for the script!

I was trying to set up the headless server (x64 12.7) with your init script on my ubuntu vps but I am extremely novice, I am mostly very good at googling and copy-pasting commands in the console.
The server by itself works with no problems, but when I launch your script with "service factorio start" i get a command not found at those lines:

Code: Select all

EXTRA_BINARGS="--disallow-commands --peer-to-peer"
INVOCATION="${BINARY} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY}" "${EXTRA_BINARGS}"
Where the binary location is

Code: Select all

BINARY=/opt/factorio/bin/x64/factorio
Calling those commands directly on the binary works without any problem...

Code: Select all

Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 2.6.32-042stab090.5 x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Mon Sep 14 07:28:37 2015 from xxxx

root@xxxxx:/opt/factorio-init# /opt/factorio/bin/x64/factorio --start-server                                                                                                              1.zip --autosave-interval 10 --autosave-slots 5 --latency-ms 270 --disallow-com                                                                                                             mands --peer-to-peer
   0.000 2015-09-14 07:47:26; Factorio 0.12.7 (Build 16743, linux64)
   0.000 Operating system: Linux
   0.000 Program arguments: "/opt/factorio/bin/x64/factorio" "--start-server" "1                                                                                                             .zip" "--autosave-interval" "10" "--autosave-slots" "5" "--latency-ms" "270" "--                                                                                                             disallow-commands" "--peer-to-peer"
   0.000 Read data path: /opt/factorio/data
   0.000 Write data path: /opt/factorio
   0.000 Binaries path: /opt/factorio/bin
   0.005 Running in headless mode
   0.007 Loading mod core 0.0.0 (data.lua)
   0.008 Loading mod base 0.12.7 (data.lua)
   0.259 Factorio initialised
   0.259 Info Router.cpp:557: Router peerID(65535) shutting down.
   0.259 Info Router.cpp:583: Router state -> Disconnected
   0.259 Info MultiplayerManager.cpp:862: networkTick(0) mapTick(-1) changing st                                                                                                             ate from(Ready) to(PreparedToHostGame)
   0.259 Info MultiplayerManager.cpp:862: networkTick(0) mapTick(-1) changing st                                                                                                             ate from(PreparedToHostGame) to(CreatingGame)
   0.259 Loading map /opt/factorio/saves/1.zip
   0.266 Info Scenario.cpp:160: Map version 0.12.7-3
   0.279 Info PosixUDPSocket.cpp:34: Opening socket at port 34197
   0.279 Info Router.cpp:583: Router state -> Connected
   0.279 Info Synchronizer.cpp:54: NetworkTick(0) initialized Synchronizer local                                                                                                              peer(0) latency(16).
   0.279 Hosting game at port 34197, peerID 0, session magic 2711
   0.279 Info MultiplayerManager.cpp:862: networkTick(0) mapTick(93) changing st                                                                                                             ate from(CreatingGame) to(InGame)
   0.279 Info NetworkInputHandler.cpp:40: mapTick(93) networkTick(0) initialized                                                                                                              NetworkInputHandler local peer(0).
   0.563 Info MultiplayerManager.cpp:1324: Received peer info for peer(0) userna                                                                                                             me(<server>).
   0.563 Info MultiplayerManager.cpp:999: networkTick(16) mapTick(93) received s                                                                                                             tateChanged peerID(0) oldState(Ready) newState(CreatingGame)
   0.563 Info MultiplayerManager.cpp:999: networkTick(16) mapTick(93) received s                                                                                                             tateChanged peerID(0) oldState(CreatingGame) newState(InGame)
What am I doing wrong?
Thank you for the help.

EDIT: I found a bug in the config file:
In line 70 of config.example there is:

Code: Select all

INVOCATION="${BINARY} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY}" "${EXTRA_BINARGS}"
And it should be:

Code: Select all

INVOCATION="${BINARY} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY} ${EXTRA_BINARGS}"
So basically the extra args should be under the same " " in INVOCATION, else it won't recognize the commands... Now it works like a charme!
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

strech wrote: EDIT: I found a bug in the config file:
In line 70 of config.example there is:

Code: Select all

INVOCATION="${BINARY} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY}" "${EXTRA_BINARGS}"
And it should be:

Code: Select all

INVOCATION="${BINARY} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY} ${EXTRA_BINARGS}"
So basically the extra args should be under the same " " in INVOCATION, else it won't recognize the commands... Now it works like a charme!
wow, sorry =) thanks for spotting - fixed for the next merge
Hosting a factorio server? Take a look at this || init script ||.
strech
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Sep 14, 2015 10:49 am
Contact:

Re: [linux] Dedicated server init script

Post by strech »

Bisa wrote: wow, sorry =) thanks for spotting - fixed for the next merge
Thanks to you for the script, today I tested your script with narc0tiq's updater script and it was smooth and cool! ;)

P.s.: it's strech not streTch :P
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

strech wrote:P.s.: it's strech not streTch :P
ouch sorry :oops:
Hosting a factorio server? Take a look at this || init script ||.
matadorpants
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 15, 2015 2:52 am
Contact:

Re: [linux] Dedicated server init script

Post by matadorpants »

Can you tell me what exactly the --peer-to-peer flag does?

I've noticed that with it we get an "Uploading" message any time someone connects, yet without it, we don't get the message, but still appear to freeze while it's uploaded. I'm just looking for some further details on how this works.

Thanks.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [linux] Dedicated server init script

Post by Bisa »

matadorpants wrote:Can you tell me what exactly the --peer-to-peer flag does?
It toggles the use of peer-to-peer when starting the "server", it's the equivalent of toggling the peer-to-peer checkbox when starting a multiplayer from your GUI client.

As for the technical details on what --peer-to-peer actually does please refer to the lengthy discussion regarding factorios peer-to-peer model (my script simply uses the binary and passes arguments to it).
In short, it toggles the mode in which the server acts as a strictly peer-to-peer "peer" or takes on a more traditional server role where other peers need not communicate with others just the server.
Hosting a factorio server? Take a look at this || init script ||.
Post Reply

Return to “Multiplayer / Dedicated Server”