Integrated sd_notify to get status messages in systemd (#28)

* Integrated sd_notify to get status messages in systemd
* reset color attributes after use in string
This commit is contained in:
OlliC
2018-04-16 18:04:41 +02:00
committed by Marc Di Luzio
parent 9870790fdd
commit ce64b59381
4 changed files with 11 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
/* systemd dbus components */
static sd_bus *bus = NULL;
@@ -144,6 +145,7 @@ void game_mode_context_loop(GameModeContext *context)
}
LOG_MSG("Successfully initialised bus with name [%s]...\n", "com.feralinteractive.GameMode");
sd_notifyf(0,"STATUS=%sGameMode is ready to be activated.%s\n", "\x1B[1;36m", "\x1B[0m");
/* Now loop, waiting for callbacks */
for (;;) {