[bacula/f16] Changes in sysconfig / init / systemd files
Simone Caronni
slaanesh at fedoraproject.org
Fri Dec 23 11:47:02 UTC 2011
commit 43bb97cf035320357e7aba414a61607ad3d25247
Author: Simone Caronni <negativo17 at gmail.com>
Date: Fri Dec 23 11:51:11 2011 +0100
Changes in sysconfig / init / systemd files
bacula-dir.init | 15 +--------------
bacula-dir.service | 4 +---
bacula-fd.init | 15 +--------------
bacula-fd.service | 4 +---
bacula-fd.sysconfig | 9 ++++++++-
bacula-sd.init | 15 +--------------
bacula-sd.service | 4 +---
bacula.spec | 2 ++
8 files changed, 16 insertions(+), 52 deletions(-)
---
diff --git a/bacula-dir.init b/bacula-dir.init
index 75ea041..02376ac 100644
--- a/bacula-dir.init
+++ b/bacula-dir.init
@@ -33,19 +33,6 @@ if [ "$DIR_GROUP" != '' ]; then
OPTS="$OPTS -g $DIR_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '^[^#].*_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
checkdatabase() {
# First, get the currently selected database backend from the
# alternatives system.
@@ -87,7 +74,7 @@ start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
# Removed for now, as the db might not be on localhost
# checkdatabase
daemon $prog $OPTS
diff --git a/bacula-dir.service b/bacula-dir.service
index 2f044af..432c925 100644
--- a/bacula-dir.service
+++ b/bacula-dir.service
@@ -5,11 +5,9 @@ After=network.target
[Service]
Environment=CONFIG=/etc/bacula/bacula-dir.conf
-Environment=DIR_USER=bacula
-Environment=DIR_GROUP=bacula
EnvironmentFile=-/etc/sysconfig/bacula-dir
ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG
-ExecStart=/usr/sbin/bacula-dir -f -c $CONFIG -u $DIR_USER -g $DIR_GROUP
+ExecStart=/usr/sbin/bacula-dir -f $OPTS -c $CONFIG -u $DIR_USER -g $DIR_GROUP
StandardOutput=syslog
Restart=always
diff --git a/bacula-fd.init b/bacula-fd.init
index 044eb19..60f257f 100644
--- a/bacula-fd.init
+++ b/bacula-fd.init
@@ -33,24 +33,11 @@ if [ "$FD_GROUP" != '' ]; then
OPTS="$OPTS -g $FD_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
daemon $prog $OPTS
RETVAL=$?
echo
diff --git a/bacula-fd.service b/bacula-fd.service
index 7185c2e..608c923 100644
--- a/bacula-fd.service
+++ b/bacula-fd.service
@@ -5,11 +5,9 @@ After=network.target
[Service]
Environment=CONFIG=/etc/bacula/bacula-fd.conf
-Environment=FD_USER=root
-Environment=FD_GROUP=root
EnvironmentFile=-/etc/sysconfig/bacula-fd
ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG
-ExecStart=/usr/sbin/bacula-fd -f -c $CONFIG -u $FD_USER -g $FD_GROUP
+ExecStart=/usr/sbin/bacula-fd -f $OPTS -c $CONFIG -u $FD_USER -g $FD_GROUP
IOSchedulingClass=idle
StandardOutput=syslog
Restart=always
diff --git a/bacula-fd.sysconfig b/bacula-fd.sysconfig
index 796ad1a..68dfb1e 100644
--- a/bacula-fd.sysconfig
+++ b/bacula-fd.sysconfig
@@ -2,4 +2,11 @@
# If no user is set bacula will run as root
FD_USER=root
-FD_GROUP=root
\ No newline at end of file
+FD_GROUP=root
+
+# Set the following options if you want to run bacula-fd with ReadAll
+# capabilities after UID/GID switch.
+# This allows the File Daemon to keep root read but drop write permission.
+# OPTS="-k"
+# FD_USER="bacula"
+# FD_GROUP="bacula"
diff --git a/bacula-sd.init b/bacula-sd.init
index 98bb972..6fb5e8d 100644
--- a/bacula-sd.init
+++ b/bacula-sd.init
@@ -32,19 +32,6 @@ if [ "$SD_GROUP" != '' ]; then
OPTS="$OPTS -g $SD_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '^[^#].*_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
checkdatabase() {
# First, get the currently selected database backend from the
# alternatives system.
@@ -86,7 +73,7 @@ start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
# Disabled, the DB does not necessarily run on the same machine
# checkdatabase
daemon $prog $OPTS
diff --git a/bacula-sd.service b/bacula-sd.service
index 57c851d..d32bee3 100644
--- a/bacula-sd.service
+++ b/bacula-sd.service
@@ -5,11 +5,9 @@ After=network.target
[Service]
Environment=CONFIG=/etc/bacula/bacula-sd.conf
-Environment=SD_USER=bacula
-Environment=SD_GROUP=disk
EnvironmentFile=-/etc/sysconfig/bacula-sd
ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG
-ExecStart=/usr/sbin/bacula-sd -f -c $CONFIG -u $SD_USER -g $SD_GROUP
+ExecStart=/usr/sbin/bacula-sd -f $OPTS -c $CONFIG -u $SD_USER -g $SD_GROUP
StandardOutput=syslog
Restart=always
diff --git a/bacula.spec b/bacula.spec
index bf01ea6..7402984 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -949,6 +949,8 @@ fi
- Remove SQLite 2 support for RHEL 4.
- Add HTML docs.
- Change SQL query file patch.
+- Add back sysconf files and remove redundant user/group in systemd
+ service files.
* Thu Dec 22 2011 Lukáš Nykrýn <lnykryn at redhat.com> - 5.0.3-14
- removed duplicity from logrotate file (#755970)
More information about the scm-commits
mailing list