From f3d4a987a4f687fbb608a0093b4a3ee4a72ea4a2 Mon Sep 17 00:00:00 2001 From: Dan Langille Date: Fri, 2 Jan 2004 17:21:21 +0000 Subject: [PATCH] Write PID, then drop privileges git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@982 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/dird.c | 4 ++-- bacula/src/filed/filed.c | 4 ++-- bacula/src/stored/stored.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index f68da92bd2..f47e5a959c 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -206,11 +206,11 @@ int main (int argc, char *argv[]) init_stack_dump(); /* grab new pid */ } - drop(uid, gid); /* reduce priveleges if requested */ - /* Create pid must come after we are a daemon -- so we have our final pid */ create_pid_file(director->pid_directory, "bacula-dir", director->DIRport); + drop(uid, gid); /* reduce priveleges if requested */ + /* signal(SIGHUP, reload_config); */ init_console_msg(working_directory); diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c index 61c6ea2f3d..02165f8a25 100644 --- a/bacula/src/filed/filed.c +++ b/bacula/src/filed/filed.c @@ -211,11 +211,11 @@ Without that I don't know who I am :-(\n"), configfile); init_stack_dump(); /* set new pid */ } - drop(uid, gid); - /* Maximum 1 daemon at a time */ create_pid_file(me->pid_directory, "bacula-fd", me->FDport); + drop(uid, gid); + #ifdef BOMB me += 1000000; #endif diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index c3690464dc..0c81761050 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -185,10 +185,10 @@ int main (int argc, char *argv[]) init_stack_dump(); /* pick up new pid */ } - drop(uid, gid); - create_pid_file(me->pid_directory, "bacula-sd", me->SDport); + drop(uid, gid); + /* Ensure that Volume Session Time and Id are both * set and are both non-zero. */ -- 2.39.5