.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH BACULA\-DIR 8 "6 December 2009" "Kern Sibbald" "Network backup, recovery&verification"
+.TH BACULA\-DIR 8 "28 October 2017" "Kern Sibbald" "Network backup, recovery&verification"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
.BI \-m
Print kaboom output (for debugging).
.TP
+.BI \-P
+Do not create a PID file.
+.TP
.BI \-r\ job
Run <job>.
.TP
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH BACULA\-SD 8 "6 December 2009" "Kern Sibbald" "Network backup, recovery & verification"
+.TH BACULA\-SD 8 "28 October 2017" "Kern Sibbald" "Network backup, recovery & verification"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
.BI \-m
Print kaboom output (for debugging).
.TP
+.BI \-P
+Do not create a PID file.
+.TP
.BI \-s
No signals (for debugging).
.TP
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH BACULA\-SD 8 "6 December 2009" "Kern Sibbald" "Network backup, recovery & verification"
+.TH BACULA\-SD 8 "28 October 2017" "Kern Sibbald" "Network backup, recovery & verification"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
.BI \-g\ group
Set the group/gid to run as.
.TP
+.BI \-P
+Do not create a PID file.
+.TP
.BI \-p
Proceed in spite of I/O errors
.TP
static char *runjob = NULL;
static bool foreground = false;
+static bool make_pid_file = true; /* create pid file */
static void init_reload(void);
static CONFIG *config;
static bool test_config = false;
" -g groupid\n"
" -m print kaboom output (for debugging)\n"
" -r <job> run <job> now\n"
+ " -P do not create pid file\n"
" -s no signals\n"
" -t test - read configuration and exit\n"
" -u userid\n"
setup_daemon_message_queue();
console_command = run_console_command;
- while ((ch = getopt(argc, argv, "c:d:fg:mr:stu:v?T")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:fg:mPr:stu:v?T")) != -1) {
switch (ch) {
case 'c': /* specify config file */
if (configfile != NULL) {
prt_kaboom = true;
break;
+ case 'P': /* no pid file */
+ make_pid_file = false;
+ break;
+
case 'r': /* run job */
if (runjob != NULL) {
free(runjob);
if (!test_config) {
/* Create pid must come after we are a daemon -- so we have our final pid */
- create_pid_file(director->pid_directory, "bacula-dir",
- get_first_port_host_order(director->DIRaddrs));
+ if (make_pid_file) {
+ create_pid_file(director->pid_directory, "bacula-dir",
+ get_first_port_host_order(director->DIRaddrs));
+ }
read_state_file(director->working_directory, "bacula-dir",
get_first_port_host_order(director->DIRaddrs));
}
unload_plugins();
if (!test_config) {
write_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
- delete_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
+ if (make_pid_file) {
+ delete_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
+ }
}
term_scheduler();
term_job_server();
char *configfile = NULL;
static bool test_config = false;
static bool foreground = false;
+static bool make_pid_file = true; /* create pid file */
static workq_t dir_workq; /* queue of work from Director */
static pthread_t server_tid;
static CONFIG *config;
" -g groupid\n"
" -k keep readall capabilities\n"
" -m print kaboom output (for debugging)\n"
+ " -P do not create pid file\n"
" -s no signals (for debugging)\n"
" -t test configuration file and exit\n"
" -T set trace on\n"
daemon_start_time = time(NULL);
setup_daemon_message_queue();
- while ((ch = getopt(argc, argv, "c:d:fg:kmstTu:v?D:")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:fg:kmPstTu:v?D:")) != -1) {
switch (ch) {
case 'c': /* configuration file */
if (configfile != NULL) {
prt_kaboom = true;
break;
+ case 'P':
+ make_pid_file = false;
+ break;
+
case 's':
no_signals = true;
break;
lmgr_init_thread(); /* initialize the lockmanager stack */
/* Maximum 1 daemon at a time */
- create_pid_file(me->pid_directory, PROG_NAME,
- get_first_port_host_order(me->FDaddrs));
+ if (make_pid_file) {
+ create_pid_file(me->pid_directory, PROG_NAME,
+ get_first_port_host_order(me->FDaddrs));
+ }
read_state_file(me->working_directory, PROG_NAME,
get_first_port_host_order(me->FDaddrs));
if (!test_config) {
write_state_file(me->working_directory,
"bacula-fd", get_first_port_host_order(me->FDaddrs));
- delete_pid_file(me->pid_directory,
- "bacula-fd", get_first_port_host_order(me->FDaddrs));
+ if (make_pid_file) {
+ delete_pid_file(me->pid_directory,
+ "bacula-fd", get_first_port_host_order(me->FDaddrs));
+ }
}
if (configfile != NULL) {
static bool server_tid_valid = false;
/* Global static variables */
-static bool foreground = 0;
+static bool foreground = false;
+static bool make_pid_file = true; /* create pid file */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static workq_t dird_workq; /* queue for processing connections */
static CONFIG *config;
" -g <group> set groupid to group\n"
" -m print kaboom output (for debugging)\n"
" -p proceed despite I/O errors\n"
+ " -P do not create pid file\n"
" -s no signals (for debugging)\n"
" -t test - read config and exit\n"
" -u <user> userid to <user>\n"
Jmsg1(NULL, M_ABORT, 0, _("Tape block size (%d) is not a power of 2\n"), TAPE_BSIZE);
}
- while ((ch = getopt(argc, argv, "c:d:fg:mpstu:v?Ti")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:fg:mpPstu:v?Ti")) != -1) {
switch (ch) {
case 'c': /* configuration file */
if (configfile != NULL) {
gid = optarg;
break;
+ /* Temp code to enable new match_bsr() code, not documented */
+ case 'i':
+ use_new_match_all = 1;
+
+ break;
case 'm': /* print kaboom output */
prt_kaboom = true;
break;
forge_on = true;
break;
+ case 'P': /* no pid file */
+ make_pid_file = false;
+ break;
+
case 's': /* no signals */
no_signals = true;
break;
verbose++;
break;
- /* Temp code to enable new match_bsr() code, not documented */
- case 'i':
- use_new_match_all = 1;
- break;
-
case '?':
default:
usage();
my_name_is(0, (char **)NULL, me->hdr.name); /* Set our real name */
-
- create_pid_file(me->pid_directory, "bacula-sd",
- get_first_port_host_order(me->sdaddrs));
+ if (make_pid_file) {
+ create_pid_file(me->pid_directory, "bacula-sd",
+ get_first_port_host_order(me->sdaddrs));
+ }
read_state_file(me->working_directory, "bacula-sd",
get_first_port_host_order(me->sdaddrs));
if (!test_config) {
write_state_file(me->working_directory,
"bacula-sd", get_first_port_host_order(me->sdaddrs));
- delete_pid_file(me->pid_directory,
- "bacula-sd", get_first_port_host_order(me->sdaddrs));
+ if (make_pid_file) {
+ delete_pid_file(me->pid_directory,
+ "bacula-sd", get_first_port_host_order(me->sdaddrs));
+ }
}
Dmsg1(200, "In terminate_stored() sig=%d\n", sig);