1 |
commit: f9aa2491329e3b770bfa24a8139c8fde245f1867 |
2 |
Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 7 07:23:25 2022 +0000 |
4 |
Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 7 07:30:14 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9aa2491 |
7 |
|
8 |
app-backup/bareos: fix pid file creation |
9 |
|
10 |
Closes: https://bugs.gentoo.org/832805 |
11 |
Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org> |
12 |
|
13 |
...eos-21.0.0-r1.ebuild => bareos-21.0.0-r2.ebuild} | 11 +++-------- |
14 |
app-backup/bareos/files/bareos-dir-21.confd | 2 +- |
15 |
app-backup/bareos/files/bareos-dir-21.initd | 17 ++++------------- |
16 |
app-backup/bareos/files/bareos-fd-21.confd | 7 +++++++ |
17 |
app-backup/bareos/files/bareos-fd-21.initd | 21 +++++++++++++++++++++ |
18 |
app-backup/bareos/files/bareos-sd-21.confd | 10 ++++++++++ |
19 |
app-backup/bareos/files/bareos-sd-21.initd | 21 +++++++++++++++++++++ |
20 |
7 files changed, 67 insertions(+), 22 deletions(-) |
21 |
|
22 |
diff --git a/app-backup/bareos/bareos-21.0.0-r1.ebuild b/app-backup/bareos/bareos-21.0.0-r2.ebuild |
23 |
similarity index 96% |
24 |
rename from app-backup/bareos/bareos-21.0.0-r1.ebuild |
25 |
rename to app-backup/bareos/bareos-21.0.0-r2.ebuild |
26 |
index 787a7074b9fc..4baeaaf6c0ec 100644 |
27 |
--- a/app-backup/bareos/bareos-21.0.0-r1.ebuild |
28 |
+++ b/app-backup/bareos/bareos-21.0.0-r2.ebuild |
29 |
@@ -332,21 +332,16 @@ src_install() { |
30 |
myscripts="bareos-fd" |
31 |
if ! use clientonly; then |
32 |
if use director; then |
33 |
- myscripts+=" bareos-dir-21" |
34 |
+ myscripts+=" bareos-dir" |
35 |
fi |
36 |
if use storage-daemon; then |
37 |
myscripts+=" bareos-sd" |
38 |
fi |
39 |
fi |
40 |
for script in ${myscripts}; do |
41 |
- # copy over init script and config to a temporary location |
42 |
- # so we can modify them as needed |
43 |
- cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd" |
44 |
- cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd" |
45 |
- |
46 |
# install init script and config |
47 |
- newinitd "${T}/${script}".initd "${script/-21/}" |
48 |
- newconfd "${T}/${script}".confd "${script/-21/}" |
49 |
+ newinitd "${FILESDIR}/${script}-21".initd "${script}" |
50 |
+ newconfd "${FILESDIR}/${script}-21".confd "${script}" |
51 |
done |
52 |
|
53 |
# install systemd unit files |
54 |
|
55 |
diff --git a/app-backup/bareos/files/bareos-dir-21.confd b/app-backup/bareos/files/bareos-dir-21.confd |
56 |
index 3ad4b7482f93..4e2ee55d8924 100644 |
57 |
--- a/app-backup/bareos/files/bareos-dir-21.confd |
58 |
+++ b/app-backup/bareos/files/bareos-dir-21.confd |
59 |
@@ -1,4 +1,4 @@ |
60 |
-# Copyright 1999-2019 Gentoo Authors |
61 |
+# Copyright 1999-2022 Gentoo Authors |
62 |
# Distributed under the terms of the GNU General Public License v2 |
63 |
|
64 |
# Config file for /etc/init.d/bareos-dir |
65 |
|
66 |
diff --git a/app-backup/bareos/files/bareos-dir-21.initd b/app-backup/bareos/files/bareos-dir-21.initd |
67 |
index 7100b615105c..916ee13b36ce 100644 |
68 |
--- a/app-backup/bareos/files/bareos-dir-21.initd |
69 |
+++ b/app-backup/bareos/files/bareos-dir-21.initd |
70 |
@@ -1,5 +1,5 @@ |
71 |
#!/sbin/openrc-run |
72 |
-# Copyright 1999-2021 Gentoo Authors |
73 |
+# Copyright 1999-2022 Gentoo Authors |
74 |
# Distributed under the terms of the GNU General Public License v2 |
75 |
|
76 |
depend() { |
77 |
@@ -9,23 +9,14 @@ depend() { |
78 |
|
79 |
start() { |
80 |
ebegin "Starting bareos director" |
81 |
- # g+w until #631598 is resolved |
82 |
- checkpath -d -m 0770 -o root:bareos /run/bareos |
83 |
+ checkpath -d -m 0750 -o root:bareos /run/bareos |
84 |
start-stop-daemon --start --quiet --exec /usr/sbin/bareos-dir \ |
85 |
- -- ${DIR_OPTIONS} |
86 |
- # harden pid file until #631598 is resolved |
87 |
- ewaitfile 10 /run/bareos/bareos-dir.9101.pid |
88 |
- chown root:bareos /run/bareos/bareos-dir.9101.pid |
89 |
+ -- -p /run/bareos/bareos-dir.9101.pid ${DIR_OPTIONS} |
90 |
eend $? |
91 |
} |
92 |
|
93 |
stop() { |
94 |
ebegin "Stopping bareos director" |
95 |
- # check pid file until #631598 is resolved |
96 |
- if [[ $(stat -c %U /run/bareos/bareos-dir.9101.pid) != "root" ]]; then |
97 |
- eerror "SECURITY ALERT: pid file is not root owned anymore?! (see #631598)" |
98 |
- else |
99 |
- start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-dir.9101.pid |
100 |
- fi |
101 |
+ start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-dir.9101.pid |
102 |
eend $? |
103 |
} |
104 |
|
105 |
diff --git a/app-backup/bareos/files/bareos-fd-21.confd b/app-backup/bareos/files/bareos-fd-21.confd |
106 |
new file mode 100644 |
107 |
index 000000000000..407f2a8828eb |
108 |
--- /dev/null |
109 |
+++ b/app-backup/bareos/files/bareos-fd-21.confd |
110 |
@@ -0,0 +1,7 @@ |
111 |
+# Copyright 1999-2022 Gentoo Authors |
112 |
+# Distributed under the terms of the GNU General Public License v2 |
113 |
+ |
114 |
+# Config file for /etc/init.d/bareos-fd |
115 |
+ |
116 |
+# Options for the file daemon. |
117 |
+FD_OPTIONS="-u root -g bareos" |
118 |
|
119 |
diff --git a/app-backup/bareos/files/bareos-fd-21.initd b/app-backup/bareos/files/bareos-fd-21.initd |
120 |
new file mode 100644 |
121 |
index 000000000000..f0632261a0c5 |
122 |
--- /dev/null |
123 |
+++ b/app-backup/bareos/files/bareos-fd-21.initd |
124 |
@@ -0,0 +1,21 @@ |
125 |
+#!/sbin/openrc-run |
126 |
+# Copyright 1999-2022 Gentoo Authors |
127 |
+# Distributed under the terms of the GNU General Public License v2 |
128 |
+ |
129 |
+depend() { |
130 |
+ use dns |
131 |
+} |
132 |
+ |
133 |
+start() { |
134 |
+ ebegin "Starting bareos file daemon" |
135 |
+ checkpath -d -m 0750 -o root:bareos /run/bareos |
136 |
+ start-stop-daemon --start --quiet --exec /usr/sbin/bareos-fd \ |
137 |
+ -- -p /run/bareos/bareos-fd.9102.pid ${FD_OPTIONS} |
138 |
+ eend $? |
139 |
+} |
140 |
+ |
141 |
+stop() { |
142 |
+ ebegin "Stopping bareos file daemon" |
143 |
+ start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-fd.9102.pid |
144 |
+ eend $? |
145 |
+} |
146 |
|
147 |
diff --git a/app-backup/bareos/files/bareos-sd-21.confd b/app-backup/bareos/files/bareos-sd-21.confd |
148 |
new file mode 100644 |
149 |
index 000000000000..2a67ae2b5523 |
150 |
--- /dev/null |
151 |
+++ b/app-backup/bareos/files/bareos-sd-21.confd |
152 |
@@ -0,0 +1,10 @@ |
153 |
+# Copyright 1999-2022 Gentoo Authors |
154 |
+# Distributed under the terms of the GNU General Public License v2 |
155 |
+ |
156 |
+# Config file for /etc/init.d/bareos-sd |
157 |
+ |
158 |
+# Options for the storage daemon. |
159 |
+# The storage daemon can be run as a non-root user, however |
160 |
+# please ensure that this user has proper permissions to |
161 |
+# access your backup devices. |
162 |
+SD_OPTIONS="-u bareos -g bareos" |
163 |
|
164 |
diff --git a/app-backup/bareos/files/bareos-sd-21.initd b/app-backup/bareos/files/bareos-sd-21.initd |
165 |
new file mode 100644 |
166 |
index 000000000000..07091dbd74c5 |
167 |
--- /dev/null |
168 |
+++ b/app-backup/bareos/files/bareos-sd-21.initd |
169 |
@@ -0,0 +1,21 @@ |
170 |
+#!/sbin/openrc-run |
171 |
+# Copyright 1999-2022 Gentoo Authors |
172 |
+# Distributed under the terms of the GNU General Public License v2 |
173 |
+ |
174 |
+depend() { |
175 |
+ use dns |
176 |
+} |
177 |
+ |
178 |
+start() { |
179 |
+ ebegin "Starting bareos storage daemon" |
180 |
+ checkpath -d -m 0750 -o root:bareos /run/bareos |
181 |
+ start-stop-daemon --start --quiet --exec /usr/sbin/bareos-sd \ |
182 |
+ -- -p /run/bareos/bareos-sd.9103.pid ${SD_OPTIONS} |
183 |
+ eend $? |
184 |
+} |
185 |
+ |
186 |
+stop() { |
187 |
+ ebegin "Stopping bareos storage daemon" |
188 |
+ start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-sd.9103.pid |
189 |
+ eend $? |
190 |
+} |