stop arch user services from starting if a configuration file doesn't exist
This commit is contained in:
parent
53bcd28ba2
commit
87ba7fa98b
@ -11,12 +11,16 @@ Description=copyparty file server
|
|||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
SyslogIdentifier=copyparty
|
SyslogIdentifier=copyparty
|
||||||
Environment=PYTHONUNBUFFERED=x
|
|
||||||
WorkingDirectory=/var/lib/copyparty-jail
|
WorkingDirectory=/var/lib/copyparty-jail
|
||||||
|
Environment=PYTHONUNBUFFERED=x
|
||||||
|
Environment=PRTY_CONFIG=%h/.config/copyparty/copyparty.conf
|
||||||
ExecReload=/bin/kill -s USR1 $MAINPID
|
ExecReload=/bin/kill -s USR1 $MAINPID
|
||||||
|
|
||||||
|
# exit if user config doesn't exist
|
||||||
|
ExecStartPre=/bin/bash -c 'if [[ ! -f "$PRTY_CONFIG" ]] ||; then echo "Config file ${PRTY_CONFIG} not found"; exit 1; fi'
|
||||||
|
|
||||||
# run copyparty
|
# run copyparty
|
||||||
ExecStart=/usr/bin/python3 /usr/bin/copyparty -c %h/.config/copyparty/copyparty.conf
|
ExecStart=/usr/bin/python3 /usr/bin/copyparty
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
@ -13,16 +13,21 @@
|
|||||||
Description=copyparty file server
|
Description=copyparty file server
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Type=notify
|
||||||
SyslogIdentifier=prisonparty
|
SyslogIdentifier=prisonparty
|
||||||
Environment=PYTHONUNBUFFERED=x
|
|
||||||
WorkingDirectory=/var/lib/copyparty-jail
|
WorkingDirectory=/var/lib/copyparty-jail
|
||||||
|
Environment=PYTHONUNBUFFERED=x
|
||||||
|
Environment=PRTY_CONFIG=%h/.config/copyparty/copyparty.conf
|
||||||
ExecReload=/bin/kill -s USR1 $MAINPID
|
ExecReload=/bin/kill -s USR1 $MAINPID
|
||||||
|
|
||||||
|
# exit if user config doesn't exist
|
||||||
|
ExecStartPre=/bin/bash -c 'if [[ ! -f "$PRTY_CONFIG" ]] ||; then echo "Config file ${PRTY_CONFIG} not found"; exit 1; fi'
|
||||||
|
|
||||||
# run copyparty
|
# run copyparty
|
||||||
ExecStart=/bin/bash /usr/bin/prisonparty /var/lib/copyparty-jail %u %u \
|
ExecStart=/bin/bash /usr/bin/prisonparty /var/lib/copyparty-jail %u %u \
|
||||||
%h/.config/copyparty \
|
%h/.config/copyparty \
|
||||||
-- \
|
-- \
|
||||||
/usr/bin/python3 /usr/bin/copyparty -c %h/.config/copyparty/copyparty.conf
|
/usr/bin/python3 /usr/bin/copyparty
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
Loading…
Reference in New Issue
Block a user