Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bareos storage daemon user must be in groups tape and/or disk to be able to access tape devices. Due to different behavior of different distributions (install order if not always the same), every package that requires a specific group/user set this up on its own. preinstall: bareos-common: setup default daemon group bareos and user bareos bareos-filedaemon: setup fd group (bareos) and user (root) bareos-storage: setup sd group (bareos) and user (bareos) bareos-director: setup dir group (bareos) and user (bareos) postinstall: bareos-storage: call bareos-config setup_sd_user, which checks if sd group and user exists, otherwise it creates them, and add the sd user (bareos) to the groups tape and disk, if they exists. Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5 Fixes #99: user bareos unable to operate tape changer due to wrong permissions Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
- Loading branch information
Marco van Wieringen
committed
May 5, 2013
1 parent
c386481
commit 86b7b80
Showing
11 changed files
with
301 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
# preinst script for bareos | ||
# | ||
# see: dh_installdeb(1) | ||
|
||
set -e | ||
|
||
# summary of how this script can be called: | ||
# * <new-preinst> `install' | ||
# * <new-preinst> `install' <old-version> | ||
# * <new-preinst> `upgrade' <old-version> | ||
# * <old-preinst> `abort-upgrade' <new-version> | ||
# for details, see http://www.debian.org/doc/debian-policy/ or | ||
# the debian-policy package | ||
|
||
daemon_group=@dir_group@ | ||
daemon_user=@dir_user@ | ||
|
||
WORKING_DIR="@working_dir@" | ||
|
||
|
||
create_group() | ||
{ | ||
[ -z "$1" ] && return | ||
# creating group if he isn't already there. | ||
# use addgroup instead of groupadd, | ||
# because "addgroup" uses the next available number, | ||
# while "groupadd" uses uses GID_MIN -1 (999) | ||
getent group $1 > /dev/null || addgroup -q --system $1 | ||
} | ||
|
||
create_user() | ||
{ | ||
[ -z "$1" ] && return | ||
# creating user if he isn't already there. | ||
# use adduser instead of useradd, | ||
# because "adduser" uses the next available number, | ||
# while "useradd" uses uses UID_MIN -1 (999) | ||
getent passwd $1 > /dev/null || adduser -q --system --ingroup $daemon_group --home "$WORKING_DIR" --no-create-home --gecos "$1" $1 | ||
} | ||
|
||
|
||
case "$1" in | ||
install|upgrade) | ||
create_group ${daemon_group} | ||
create_user ${daemon_user} | ||
;; | ||
|
||
abort-upgrade) | ||
;; | ||
|
||
*) | ||
echo "preinst called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
# preinst script for bareos | ||
# | ||
# see: dh_installdeb(1) | ||
|
||
set -e | ||
|
||
# summary of how this script can be called: | ||
# * <new-preinst> `install' | ||
# * <new-preinst> `install' <old-version> | ||
# * <new-preinst> `upgrade' <old-version> | ||
# * <old-preinst> `abort-upgrade' <new-version> | ||
# for details, see http://www.debian.org/doc/debian-policy/ or | ||
# the debian-policy package | ||
|
||
daemon_group=@dir_group@ | ||
daemon_user=@dir_user@ | ||
|
||
WORKING_DIR="@working_dir@" | ||
|
||
|
||
create_group() | ||
{ | ||
[ -z "$1" ] && return | ||
# creating group if he isn't already there. | ||
# use addgroup instead of groupadd, | ||
# because "addgroup" uses the next available number, | ||
# while "groupadd" uses uses GID_MIN -1 (999) | ||
getent group $1 > /dev/null || addgroup -q --system $1 | ||
} | ||
|
||
create_user() | ||
{ | ||
[ -z "$1" ] && return | ||
# creating user if he isn't already there. | ||
# use adduser instead of useradd, | ||
# because "adduser" uses the next available number, | ||
# while "useradd" uses uses UID_MIN -1 (999) | ||
getent passwd $1 > /dev/null || adduser -q --system --ingroup $daemon_group --home "$WORKING_DIR" --no-create-home --gecos "$1" $1 | ||
} | ||
|
||
|
||
case "$1" in | ||
install|upgrade) | ||
create_group ${daemon_group} | ||
create_user ${daemon_user} | ||
;; | ||
|
||
abort-upgrade) | ||
;; | ||
|
||
*) | ||
echo "preinst called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.