„README.md“ ändern
parent
516106ad1c
commit
507e46da17
30
README.md
30
README.md
|
@ -2,32 +2,10 @@
|
||||||
|
|
||||||
<img src="https://git.ping-mee.de/ebbe.bass/server-rack-led/raw/branch/master/GPIO%20Pin.png">
|
<img src="https://git.ping-mee.de/ebbe.bass/server-rack-led/raw/branch/master/GPIO%20Pin.png">
|
||||||
|
|
||||||
# Install Python script as service
|
# Start on (re)boot
|
||||||
|
|
||||||
Requirements:
|
`sudo apt install screen -y`
|
||||||
- systemd (sudo apt install systemd -y)
|
|
||||||
|
|
||||||
Create service file:
|
`sudo crontab -e`
|
||||||
`sudo nano /etc/systemd/system/server-rack-led.service`
|
|
||||||
|
|
||||||
Content in the service file:
|
`@reboot /path/to/start.sh`
|
||||||
```
|
|
||||||
[Unit]
|
|
||||||
Description=Server Rack LED
|
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
Restart=always
|
|
||||||
ExecStart=/usr/bin/python3 /home/pi/server-rack-led/main.py
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
Reload daemon, enable service and start service:
|
|
||||||
```
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable server-rack-led.service
|
|
||||||
sudo systemctl start server-rack-led.service
|
|
||||||
```
|
|
Loading…
Reference in New Issue