[pkg-bacula-commits] [bacula] 01/01: Replace local patch by upstream patch

Sven Hartge hartge-guest at moszumanska.debian.org
Sat Oct 28 13:48:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

hartge-guest pushed a commit to branch no-foreground-pidfile
in repository bacula.

commit 1ba750bafcdea188ee9ef799e1ad50ba43769229
Author: Sven Hartge <sven at svenhartge.de>
Date:   Sat Oct 28 15:46:47 2017 +0200

    Replace local patch by upstream patch
---
 debian/patches/no-pid-option.patch          | 298 ++++++++++++++++++++++++++++
 debian/patches/no-pid-when-foreground.patch |  89 ---------
 2 files changed, 298 insertions(+), 89 deletions(-)

diff --git a/debian/patches/no-pid-option.patch b/debian/patches/no-pid-option.patch
new file mode 100644
index 0000000..099bd87
--- /dev/null
+++ b/debian/patches/no-pid-option.patch
@@ -0,0 +1,298 @@
+diff --git a/bacula/manpages/bacula-dir.8 b/bacula/manpages/bacula-dir.8
+index 1fdc89b..662bc4e 100644
+--- a/bacula/manpages/bacula-dir.8
++++ b/bacula/manpages/bacula-dir.8
+@@ -2,7 +2,7 @@
+ .\" 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
+@@ -43,6 +43,9 @@ Set the group/gid to run as.
+ .BI \-m
+ Print kaboom output (for debugging).
+ .TP
++.BI \-P
++Do not create a PID file.
++.TP
+ .BI \-r\  job
+ Run <job>.
+ .TP
+diff --git a/bacula/manpages/bacula-fd.8 b/bacula/manpages/bacula-fd.8
+index 4f2c584..c5f2194 100644
+--- a/bacula/manpages/bacula-fd.8
++++ b/bacula/manpages/bacula-fd.8
+@@ -2,7 +2,7 @@
+ .\" 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
+@@ -48,6 +48,9 @@ Keep readall permission when dropping privileges.
+ .BI \-m
+ Print kaboom output (for debugging).
+ .TP
++.BI \-P
++Do not create a PID file.
++.TP
+ .BI \-s
+ No signals (for debugging).
+ .TP
+diff --git a/bacula/manpages/bacula-sd.8 b/bacula/manpages/bacula-sd.8
+index 56ee778..4a54c26 100644
+--- a/bacula/manpages/bacula-sd.8
++++ b/bacula/manpages/bacula-sd.8
+@@ -2,7 +2,7 @@
+ .\" 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
+@@ -40,6 +40,9 @@ Run in foreground (for debugging).
+ .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
+diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c
+index c950080..545aa6f 100644
+--- a/bacula/src/dird/dird.c
++++ b/bacula/src/dird/dird.c
+@@ -64,6 +64,7 @@ void init_device_resources();
+ 
+ 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;
+@@ -131,6 +132,7 @@ static void usage()
+       "     -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"
+@@ -190,7 +192,7 @@ int main (int argc, char *argv[])
+    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) {
+@@ -235,6 +237,10 @@ int main (int argc, char *argv[])
+          prt_kaboom = true;
+          break;
+ 
++      case 'P':                    /* no pid file */
++         make_pid_file = false;
++         break;
++
+       case 'r':                    /* run job */
+          if (runjob != NULL) {
+             free(runjob);
+@@ -307,8 +313,10 @@ int main (int argc, char *argv[])
+ 
+    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));
+    }
+@@ -673,7 +681,9 @@ void terminate_dird(int sig)
+    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();
+diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c
+index b9a7d74..7e684b1 100644
+--- a/bacula/src/filed/filed.c
++++ b/bacula/src/filed/filed.c
+@@ -46,6 +46,7 @@ extern struct s_cmds cmds[];
+ 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;
+@@ -63,11 +64,13 @@ static void usage()
+       "     -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"
+       "     -u               userid\n"
+       "     -v               verbose user messages\n"
++      "     -x               do not create pid file\n"
+       "     -?               print this message.\n"
+       "\n"), 2000, VERSION, BDATE);
+ 
+@@ -99,7 +102,7 @@ int main (int argc, char *argv[])
+    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) {
+@@ -143,6 +146,10 @@ int main (int argc, char *argv[])
+          prt_kaboom = true;
+          break;
+ 
++      case 'P':
++         make_pid_file = false;
++         break;
++
+       case 's':
+          no_signals = true;
+          break;
+@@ -228,8 +235,10 @@ int main (int argc, char *argv[])
+    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));
+ 
+@@ -285,8 +294,10 @@ void terminate_filed(int sig)
+    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) {
+diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c
+index 9ca4c56..3f0f9c4 100644
+--- a/bacula/src/stored/stored.c
++++ b/bacula/src/stored/stored.c
+@@ -64,7 +64,8 @@ static pthread_t server_tid;
+ 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;
+@@ -84,6 +85,7 @@ static void usage()
+       "     -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"
+@@ -148,7 +150,7 @@ int main (int argc, char *argv[])
+       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) {
+@@ -188,6 +190,11 @@ int main (int argc, char *argv[])
+          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;
+@@ -196,6 +203,10 @@ int main (int argc, char *argv[])
+          forge_on = true;
+          break;
+ 
++      case 'P':                    /* no pid file */
++         make_pid_file = false;
++         break;
++
+       case 's':                    /* no signals */
+          no_signals = true;
+          break;
+@@ -212,11 +223,6 @@ int main (int argc, char *argv[])
+          verbose++;
+          break;
+ 
+-      /* Temp code to enable new match_bsr() code, not documented */
+-      case 'i':
+-         use_new_match_all = 1;
+-         break;
+-
+       case '?':
+       default:
+          usage();
+@@ -270,9 +276,10 @@ int main (int argc, char *argv[])
+ 
+    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));
+ 
+@@ -741,8 +748,10 @@ void terminate_stored(int sig)
+    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);
diff --git a/debian/patches/no-pid-when-foreground.patch b/debian/patches/no-pid-when-foreground.patch
deleted file mode 100644
index 96e8aaa..0000000
--- a/debian/patches/no-pid-when-foreground.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff --git a/src/dird/dird.c b/src/dird/dird.c
-index 9bde2ebb..a5e4ed47 100644
---- a/src/dird/dird.c
-+++ b/src/dird/dird.c
-@@ -311,8 +311,10 @@ int main (int argc, char *argv[])
- 
-    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 (!foreground) {
-+          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));
-    }
-@@ -677,7 +679,9 @@ void terminate_dird(int sig)
-    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 (!foreground) {
-+          delete_pid_file(director->pid_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
-+      }
-    }
-    term_scheduler();
-    term_job_server();
-diff --git a/src/filed/filed.c b/src/filed/filed.c
-index 28b2baff..bf3bf294 100644
---- a/src/filed/filed.c
-+++ b/src/filed/filed.c
-@@ -233,8 +233,10 @@ int main (int argc, char *argv[])
-    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 (!foreground) {
-+      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));
- 
-@@ -293,8 +295,10 @@ void terminate_filed(int sig)
-    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 (!foreground) {
-+         delete_pid_file(me->pid_directory,
-+                         "bacula-fd", get_first_port_host_order(me->FDaddrs));
-+		  }
-    }
- 
-    if (configfile != NULL) {
-diff --git a/src/stored/stored.c b/src/stored/stored.c
-index 5886433d..d347164d 100644
---- a/src/stored/stored.c
-+++ b/src/stored/stored.c
-@@ -276,9 +276,10 @@ int main (int argc, char *argv[])
- 
-    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 (!foreground) {
-+      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));
- 
-@@ -747,8 +748,10 @@ void terminate_stored(int sig)
-    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 (!foreground) {
-+         delete_pid_file(me->pid_directory,
-+                         "bacula-sd", get_first_port_host_order(me->sdaddrs));
-+		  }
-    }
- 
-    Dmsg1(200, "In terminate_stored() sig=%d\n", sig);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list