refactor(moonraker): update service file and add env file
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
1
resources/moonraker.env
Normal file
1
resources/moonraker.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
MOONRAKER_ARGS="/home/%USER%/moonraker/moonraker/moonraker.py -d %PRINTER_DATA%"
|
||||||
@@ -1,20 +1,19 @@
|
|||||||
#Systemd Moonraker Service
|
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Systemd Moonraker Service for instance moonraker-%INST%
|
Description=API Server for Klipper SV1 %INST%
|
||||||
Documentation=https://moonraker.readthedocs.io/
|
Documentation=https://moonraker.readthedocs.io/
|
||||||
After=network.target
|
Requires=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=MOONRAKER_CONF=%CFG%
|
|
||||||
Environment=MOONRAKER_LOG=%LOG%
|
|
||||||
Type=simple
|
Type=simple
|
||||||
SupplementaryGroups=moonraker-admin
|
|
||||||
User=%USER%
|
User=%USER%
|
||||||
|
SupplementaryGroups=moonraker-admin
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=%ENV%/bin/python %DIR%/moonraker/moonraker.py -c ${MOONRAKER_CONF} -l ${MOONRAKER_LOG}
|
WorkingDirectory=/home/%USER%/moonraker
|
||||||
|
EnvironmentFile=%ENV_FILE%
|
||||||
|
ExecStart=%ENV%/bin/python $MOONRAKER_ARGS
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
Reference in New Issue
Block a user