service calling on_update_failure.sh
This commit is contained in:
19
misc/atbupdatetool.service
Normal file
19
misc/atbupdatetool.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=ATB update tool
|
||||
|
||||
[Service]
|
||||
Environment=XDG_RUNTIME_DIR=/var/run/user/0
|
||||
# get START_DATE of service. Use '-' to ensure that file exists
|
||||
EnvironmentFile=-/tmp/start_date.env
|
||||
# EnvironmentFile=-/tmp/stop_date.env
|
||||
ExecStartPre=/bin/bash -c 'printf "%%s\n" START_DATE=$(date +"%%Y-%%m-%%d%%H:%%M:%%S") > /tmp/start_date.env'
|
||||
|
||||
ExecStart=/opt/app/tools/atbupdate/ATBUpdateTool --platform wayland
|
||||
|
||||
ExecStartPre=dbus-send --system --type=method_call --dest='eu.atb.ptu.systemcontrol' '/systemcontrol' eu.atb.ptu.systemcontrol.startBackgroundTask string:UPDATE_TOOL
|
||||
ExecStopPost=dbus-send --system --type=method_call --dest='eu.atb.ptu.systemcontrol' '/systemcontrol' eu.atb.ptu.systemcontrol.finishedBackgroundTask string:UPDATE_TOOL
|
||||
# execute script to check if update-tool contains errors not sent to ISMAS.
|
||||
# ExecStopPost=/bin/bash -c 'printf "%%s\n" STOP_DATE=$(date +"%%Y-%%m-%%d%%H:%%M:%%S") > /tmp/stop_date.env'
|
||||
ExecStopPost=/bin/bash -c '[ -f /opt/app/tools/atbupdate/on_update_failure.sh ] && /opt/app/tools/atbupdate/on_update_failure.sh ${START_DATE}'
|
||||
|
||||
#StandardOutput=????
|
Reference in New Issue
Block a user