head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2005.10.06.21.10.25;	author dragonheart;	state dead;
branches;
next	1.1;

1.1
date	2005.07.04.01.52.06;	author robbat2;	state Exp;
branches;
next	;


desc
@@


1.2
log
@randpass insecure file creation - bug #104986. Old version cleanout.
(Portage version: 2.0.53_rc3)
@
text
@#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/files/bacula-init2,v 1.1 2005/07/04 01:52:06 robbat2 Exp $

depend() {
	need net
	use mysql
}

opts="test"

DIR_USER=root
DIR_GROUP=bacula
SD_USER=root
SD_GROUP=bacula
FD_USER=root
FD_GROUP=bacula

# A client would only need to run the file daemon, so if thats the
# case for this machine just comment the other two out below here...
start() {
	ebegin "Starting bacula storage daemon"
	OPTIONS=''
	if [ "${SD_USER}" != '' ]; then
		OPTIONS="${OPTIONS} -u ${SD_USER}"
 	fi
										   
	if [ "${SD_GROUP}" != '' ]; then
		OPTIONS="${OPTIONS} -g ${SD_GROUP}"
	fi
	start-stop-daemon --start --quiet --exec /usr/sbin/bacula-sd \
		-- ${OPTIONS} -c /etc/bacula/bacula-sd.conf
	result=$?

	ebegin "Starting bacula file daemon"
	OPTIONS=''
	if [ "${FD_USER}" != '' ]; then
		OPTIONS="${OPTIONS} -u ${FD_USER}"
 	fi
										   
	if [ "${FD_GROUP}" != '' ]; then
		OPTIONS="${OPTIONS} -g ${FD_GROUP}"
	fi
	start-stop-daemon --start --quiet --exec /usr/sbin/bacula-fd \
		-- ${OPTIONS} -c /etc/bacula/bacula-fd.conf
	result=$(( $result + $? ))
	sleep 2

	ebegin "Starting bacula director"
	OPTIONS=''
	if [ "${DIR_USER}" != '' ]; then
		OPTIONS="${OPTIONS} -u ${DIR_USER}"
 	fi
										   
	if [ "${DIR_GROUP}" != '' ]; then
		OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
	fi
	start-stop-daemon --start --quiet --exec /usr/sbin/bacula-dir \
		-- ${OPTIONS} -c /etc/bacula/bacula-dir.conf
	result=$(( $result + $? ))

	eend $result
}

# The default port numbers appear in the pidfile paths below.
# Might wanna programmatically grab them from the config files
# or something...
stop() {
	ebegin "Stopping bacula file daemon"
	start-stop-daemon --stop --quiet --pidfile /var/run/bacula-fd.9102.pid
	result=$?
	ebegin "Stopping bacula storage daemon"
	start-stop-daemon --stop --quiet --pidfile /var/run/bacula-sd.9103.pid
	result=$(( $result + $? ))
	ebegin "Stopping bacula director"
	start-stop-daemon --stop --quiet --pidfile /var/run/bacula-dir.9101.pid
	result=$(( $result + $? ))
	eend $result
}

test() {
	ebegin "Testing bacula storage daemon configuration"
	/usr/sbin/bacula-sd -t -c /etc/bacula/bacula-sd.conf
	result=$?
	ebegin "Testing bacula file daemon configuration"
	/usr/sbin/bacula-fd -t -c /etc/bacula/bacula-fd.conf
	result=$(( $result + $? ))
	ebegin "Testing bacula director configuration"
	/usr/sbin/bacula-dir -t -c /etc/bacula/bacula-dir.conf
	result=$(( $result + $? ))
	eend $result
}
@


1.1
log
@Moved from app-admin/bacula to app-backup/bacula.
@
text
@d4 1
a4 1
# $Header: /var/cvsroot/gentoo-x86/app-admin/bacula/files/bacula-init2,v 1.1 2004/12/18 14:33:03 mholzer Exp $
@

