core: allow informing systemd about service status changes with RELOADING=1 and STOPPING=1 sd_notify() messages

This commit is contained in:
Lennart Poettering
2014-08-21 17:24:21 +02:00
parent 70af4d17da
commit 308d72dc1e
4 changed files with 185 additions and 48 deletions
+19 -3
View File
@@ -25,13 +25,29 @@
int main(int argc, char*argv[]) {
sd_notify(0, "STATUS=Starting up");
sd_notify(0,
"STATUS=Starting up");
sleep(5);
sd_notify(0,
"STATUS=Running\n"
"READY=1");
sleep(10);
sd_notify(0, "STATUS=Quitting");
sleep(5);
sd_notify(0,
"STATUS=Reloading\n"
"RELOADING=1");
sleep(5);
sd_notify(0,
"STATUS=Running\n"
"READY=1");
sleep(5);
sd_notify(0,
"STATUS=Quitting\n"
"STOPPING=1");
sleep(5);
return 0;
}