exit_daemon("Fork failed", errno);
}
if (newpid) {
-#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
- sd_notifyf(0,
- "READY=0\nSTATUS=Starting process...\n"
- "MAINPID=%lu",
- (unsigned long) newpid);
-#endif /* HAVE_LIBSYSTEMD_DAEMON */
_exit(0);
}
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
+ } else {
+ sd_notify(0, "STATUS=Starting process...");
+#endif
}
/* detach from the terminal */
msg,
error);
#endif
- DBG_ERR("STATUS=daemon failed to start: %s, error code %d\n",
+ DBG_ERR("daemon failed to start: %s, error code %d\n",
msg, error);
exit(1);
}
sd_notifyf(0, "READY=1\nSTATUS=%s: ready to serve connections...",
daemon);
#endif
- DBG_ERR("STATUS=daemon '%s' finished starting up and ready to serve "
+ DBG_ERR("daemon '%s' finished starting up and ready to serve "
"connections\n", daemon);
}
daemon = "Samba";
}
#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
- sd_notifyf(0, "\nSTATUS=%s: %s", daemon, msg);
+ sd_notifyf(0, "STATUS=%s: %s", daemon, msg);
#endif
- DBG_ERR("STATUS=daemon '%s' : %s\n", daemon, msg);
+ DBG_ERR("daemon '%s' : %s\n", daemon, msg);
}