Subject: Re: Bacula PID directory
To: None <tech-pkg@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-pkg
Date: 10/29/2005 19:03:18
--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sat, Oct 29, 2005 at 10:39:36AM -0600, Sverre Froyen wrote:
> In /usr/pkgsrc/sysutils/bacula/Makefile.common, BACULA_PIDDIR is defined as
> ${VARBASE}/run/bacula. This causes the bacula daemons to fail with the
> error,
Can you try the attached patch?
Joerg
--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bacula.diff"
Index: files/bacula-dir.sh
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/bacula/files/bacula-dir.sh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 bacula-dir.sh
--- files/bacula-dir.sh 6 Nov 2004 16:17:38 -0000 1.1.1.1
+++ files/bacula-dir.sh 29 Oct 2005 17:03:04 -0000
@@ -11,8 +11,17 @@
rcvar=$name
command="@PREFIX@/sbin/bacula-dir"
required_files="@BACULA_ETCDIR@/bacula-dir.conf"
-pidfile="@BACULA_PIDDIR@/bacula-dir.9101.pid"
+piddir="@BACULA_PIDDIR@"
+pidfile="${piddir}/bacula-sd.9103.pid"
command_args="-c ${required_files} -u @BACULA_DIR_USER@ -g @BACULA_GROUP@"
+start_precmd=bacula_prestart
+
+bacula_prestart()
+{
+ [ -d "${piddir}" ] && return 0
+ mkdir -p "${piddir}"
+ chown "@BACULA_SD_USER@" "${piddir}"
+}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
Index: files/bacula-fd.sh
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/bacula/files/bacula-fd.sh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 bacula-fd.sh
--- files/bacula-fd.sh 6 Nov 2004 16:17:38 -0000 1.1.1.1
+++ files/bacula-fd.sh 29 Oct 2005 17:03:04 -0000
@@ -11,8 +11,17 @@
rcvar=$name
command="@PREFIX@/sbin/bacula-fd"
required_files="@BACULA_ETCDIR@/bacula-fd.conf"
-pidfile="@BACULA_PIDDIR@/bacula-fd.9102.pid"
+piddir="@BACULA_PIDDIR@"
+pidfile="${piddir}/bacula-sd.9103.pid"
command_args="-c ${required_files}"
+start_precmd=bacula_prestart
+
+bacula_prestart()
+{
+ [ -d "${piddir}" ] && return 0
+ mkdir -p "${piddir}"
+ chown "@BACULA_SD_USER@" "${piddir}"
+}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
Index: files/bacula-sd.sh
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/bacula/files/bacula-sd.sh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 bacula-sd.sh
--- files/bacula-sd.sh 6 Nov 2004 16:17:38 -0000 1.1.1.1
+++ files/bacula-sd.sh 29 Oct 2005 17:03:04 -0000
@@ -11,8 +11,17 @@
rcvar=$name
command="@PREFIX@/sbin/bacula-sd"
required_files="@BACULA_ETCDIR@/bacula-sd.conf"
-pidfile="@BACULA_PIDDIR@/bacula-sd.9103.pid"
+piddir="@BACULA_PIDDIR@"
+pidfile="${piddir}/bacula-sd.9103.pid"
command_args="-c ${required_files} -u @BACULA_SD_USER@ -g @BACULA_GROUP@"
+start_precmd=bacula_prestart
+
+bacula_prestart()
+{
+ [ -d "${piddir}" ] && return 0
+ mkdir -p "${piddir}"
+ chown "@BACULA_SD_USER@" "${piddir}"
+}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
--1yeeQ81UyVL57Vl7--