Skip to content
Snippets Groups Projects
Unverified Commit 9a541f88 authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott Committed by GitHub
Browse files

Merge pull request #125 from TheTechromancer/master

Example systemd services for auto-starting in Linux
parents 8ee050e7 bcceb23f
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,8 @@ This directory contains sample projects and configuration files for Fadecandy. ...@@ -22,6 +22,8 @@ This directory contains sample projects and configuration files for Fadecandy.
* JSON layout files and layout generators * JSON layout files and layout generators
* Compatible with the Open Pixel Control `gl_server`. * Compatible with the Open Pixel Control `gl_server`.
* Compatible with some of the Node.js examples. * Compatible with some of the Node.js examples.
* `systemd`
* Example systemd .service files for auto-starting on boot in Linux
LED Layouts LED Layouts
----------- -----------
......
Fadecandy systemd Examples
==========================
Once installed and enabled, these example systemd .service files will automatically start the Fadecandy server and one of the Python example scripts on boot. For Linux systems only.
Installation Procedure
----------------------
1. Ensure that the __fcserver__ executable resides in the directory specified in the .service file. (/opt/fadecandy/server/ in this example)
2. Copy the .service files into the /etc/systemd/system/ directory
~~~
$ cp fadecandy.service example-leds.service /etc/systemd/system/
~~~
3. Enable the services
~~~
$ systemctl enable fadecandy.service
$ systemctl enable example-leds.service
~~~
4. Start the services
~~~
$ systemctl start fadecandy.service
$ systemctl start example-leds.service
~~~
[Unit]
Description=Example LEDs
Requires=fadecandy.service
[Service]
Type=exec
WorkingDirectory=/opt/fadecandy/examples/python
ExecStart=/usr/bin/env python /opt/fadecandy/examples/python/chase.py
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=Fadecandy Server
After=network.target
[Service]
Type=exec
WorkingDirectory=/opt/fadecandy/server
ExecStart=/opt/fadecandy/server/fcserver config.json
Restart=always
[Install]
WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment