summarylogtreecommitdiffstats
path: root/bareos-common.install
diff options
context:
space:
mode:
Diffstat (limited to 'bareos-common.install')
-rw-r--r--bareos-common.install25
1 files changed, 25 insertions, 0 deletions
diff --git a/bareos-common.install b/bareos-common.install
new file mode 100644
index 000000000000..4002a3aa5726
--- /dev/null
+++ b/bareos-common.install
@@ -0,0 +1,25 @@
+# arg 1: the new package version
+pre_install() {
+ # Create User/Group
+ getent group bareos > /dev/null || groupadd --system bareos
+ getent passwd bareos > /dev/null || useradd --system --gid bareos \
+ --home-dir /var/lib/bareos --no-create-home bareos
+
+}
+
+# arg 1: the new package version
+post_install() {
+ chown bareos:bareos /var/lib/bareos/
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ pre_install
+}
+
+# arg 1: the old package version
+post_remove() {
+ getent passwd bareos > /dev/null && userdel bareos
+ rm -f /etc/bareos/.rndpwd
+}