* in the UNIX Environment"
*
* Initialize a daemon process completely detaching us from
- * any terminal processes.
+ * any terminal processes.
*
- */
+ */
/*
Copyright (C) 2000-2004 Kern Sibbald and John Walker
#include "bacula.h"
extern int debug_level;
-void
+void
daemon_start()
{
#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
* Become a daemon.
*/
- Dmsg0(200, "Enter daemon_start\n");
+ Dmsg0(900, "Enter daemon_start\n");
if ( (cpid = fork() ) < 0)
Emsg1(M_ABORT, 0, "Cannot fork to become daemon: %s\n", strerror(errno));
else if (cpid > 0)
exit(0); /* parent exits */
/* Child continues */
-
+
setsid();
/* In the PRODUCTION system, we close ALL
chdir("/");
#endif
- /*
+ /*
* Avoid creating files 666 but don't override any
* more restrictive mask set by the user.
*/
}
#endif /* HAVE_CYGWIN */
- Dmsg0(200, "Exit daemon_start\n");
+ Dmsg0(900, "Exit daemon_start\n");
}