summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fa8321e)
-- kevin
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1549
a5681a0c-68f1-0310-ab6d-
d61299d08faa
fd = open_pidfile();
if (fd < 0) return fd;
fd = open_pidfile();
if (fd < 0) return fd;
if (!stay_foreground)
{
pid_t child;
if (!stay_foreground)
{
pid_t child;
child = fork ();
if (child < 0)
child = fork ();
if (child < 0)
- /* Change into the /tmp directory. */
- base_dir = (config_base_dir != NULL)
- ? config_base_dir
- : "/tmp";
- status = chdir (base_dir);
- if (status != 0)
- {
- fprintf (stderr, "daemonize: chdir (%s) failed.\n", base_dir);
- return (-1);
- }
-
/* Become session leader */
setsid ();
/* Become session leader */
setsid ();
dup (0);
} /* if (!stay_foreground) */
dup (0);
} /* if (!stay_foreground) */
+ /* Change into the /tmp directory. */
+ base_dir = (config_base_dir != NULL)
+ ? config_base_dir
+ : "/tmp";
+ status = chdir (base_dir);
+ if (status != 0)
+ {
+ fprintf (stderr, "daemonize: chdir (%s) failed.\n", base_dir);
+ return (-1);
+ }
+
install_signal_handlers();
openlog ("rrdcached", LOG_PID, LOG_DAEMON);
install_signal_handlers();
openlog ("rrdcached", LOG_PID, LOG_DAEMON);