* never close stderr (but debug might dup it onto a log file) */
close_low_fds(do_fork, !log_stdout, false);
}
+
+_PUBLIC_ void exit_daemon(const char *msg, int error)
+{
+#ifdef HAVE_SYSTEMD
+ if (msg == NULL) {
+ msg = strerror(error);
+ }
+
+ sd_notifyf(0, "STATUS=daemon failed to start: %s\n"
+ "ERRNO=%i",
+ msg,
+ error);
+#endif
+ DEBUG(0, ("STATUS=daemon failed to start: %s, error code %d\n", msg, error));
+ exit(1);
+}
**/
_PUBLIC_ void become_daemon(bool do_fork, bool no_process_group, bool log_stdout);
+/**
+ Exit daemon and print error message to the log at level 0
+ Optionally report failure to systemd if systemd integration is enabled
+**/
+_PUBLIC_ void exit_daemon(const char *msg, int error);
+
/**
* @brief Get a password from the console.
*