In this thread I try to create a rather complex service.
The service has 2-3 ExecStartPre lines that try to do something, which is evaluated in sh -c "Command". If the command is false, the service should cancel and repeat after a given time to check again.
The service doesnt output any usable error messages and I wonder how to do that.
I tried
ExecStartPre=<check for stuff> || sh -c 'echo "Error: check failed" >&2'
thanks! I did a pretty big overhaul and put everything into a way better script.
The systemd stuff is now very minimal, while the script handles the logic. The timer deals with the planned running action (every day at 20:00, if not met then as soon as possible min 10min after boot), the service repeats itself when not ran successfully (need to check if that works)