I have a C++ programm and it has two runtime states: active and waiting. I want to be able to change systemd status of the corresponding server (systemctl status
) from the code. I have seen that there are "active (running)" and "active (waiting)" statuses in systemd. Is there any opportunity to do it? Or at least when exactly are this systemd statuses set?
Those are systemd unit states and systemd manages them on its own, you can't directly set them. They are independent of the runtime states of your program.
According to the systemctl manual, the state has three parts:
The waiting state means the unit is waiting for an event. As of now, only automount, path and timer units have a waiting state.