I would like to set a one-shot service to active even though systemd marks it as failed. How can I archive this?
Background:
Two node cluster with DRBD. Back in the days the state of the DRBD was managed by a simple script like:
# active.sh
drbdadm primary all
mount /dev/drbd0
# inactive:
umount /dev/drbd0
drbdadm secondary all
Now I have converted this logic to a one-shot systemd unit. The problem is, that on the current primary node the start of this service fails because drbdadm returns an error code for the device already in primary state.
This is desired in normal operation but not this very first time. I would like to set the service to active since effectively it is. Systemd just doesn't know it (which is perfectly OK, I just need a way to tell him that it's running).