Coder Social home page Coder Social logo

factorio-init's Introduction

Factorio Init Script

A simple factorio init script for linux

Debugging

If you find yourself wondering why stuff is not working the way you expect:

  • Check the logs, I suggest you tail -f /opt/factorio/factorio-current.log in a separate session
  • Enable debugging in the config and/or:
  • Try running the same commands as the factorio user (/opt/factorio-init/factorio invocation will tell you what the factorio user tries to run at start)
$ /opt/factorio-init invocation
#  Run this as the factorio user, example:
$ sudo -u factorio 'whatever invocation gave you'
# You should see some output in your terminal here, hopefully giving
# you a hint of what is going wrong

Install

  • Create a directory where you want to store this script along with configuration. (either copy-paste the files or clone from github):
$ cd '/opt'
$ git clone https://github.com/Bisa/factorio-init.git
  • Rename config.example to config and modify the values within according to your setup.

Systemd

  • Copy the example service, adjust & reload
$ cp /opt/factorio-init/factorio.service.example /etc/systemd/system/factorio.service
# Edit the service file to suit your environment then reload systemd
$ systemctl daemon-reload
  • Verify that the server starts
$ systemctl start factorio
$ systemctl status -l factorio
# Remember to enable the service at startup if you want that:
$ systemctl enable factorio

SysvInit

  • Symlink the init script:
$ ln -s /opt/factorio-init/factorio /etc/init.d/factorio
# Make the script executable:
$ chmod +x /opt/factorio-init/factorio
# Try it out:
$ service factorio help
# Do not forget to enable the service at boot if you want that.

Thank You

  • To all who find this script useful in one way or the other
  • A big thank you to Wube for making Factorio
  • A special thanks to NoPantsMcDance, Oxyd, HanziQ, TheFactorioCube and all other frequent users of the #factorio channel @ esper.net
  • Thank you to Salzig for pointing me in the right direction when it comes to input redirection
  • At last, but not least; Thank you to all contributors and users posting issues in my github project or on the factorio forums

You are all a great source of motivation, thank you.

License

This code is realeased with the MIT license, see the LICENSE file.

factorio-init's People

Contributors

arendjanh avatar bisa avatar kwlockwo avatar nbugrov avatar r41d avatar shanemcc avatar zack-shoylev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.