Blame SOURCES/galera-paths.patch

9852d1
diff -up galera-26.4.6/garb/files/garb.service.p2 galera-26.4.6/garb/files/garb.service
9852d1
--- galera-26.4.6/garb/files/garb.service.p2	2021-01-04 16:45:52.260966357 +0100
9852d1
+++ galera-26.4.6/garb/files/garb.service	2021-01-04 16:46:50.010572463 +0100
9852d1
@@ -12,7 +12,7 @@ Alias=garbd.service
9852d1
 
9852d1
 [Service]
9852d1
 User=nobody
9852d1
-ExecStart=/usr/bin/garb-systemd start
9852d1
+ExecStart=@bindir@/garb-systemd start
9852d1
 
9852d1
 # Use SIGINT because with the default SIGTERM
9852d1
 # garbd fails to reliably transition to 'destroyed' state
9852d1
diff -up galera-26.4.6/garb/files/garb.sh.p2 galera-26.4.6/garb/files/garb.sh
9852d1
--- galera-26.4.6/garb/files/garb.sh.p2	2020-10-22 12:19:37.000000000 +0200
9852d1
+++ galera-26.4.6/garb/files/garb.sh	2021-01-04 16:42:19.943738004 +0100
9852d1
@@ -5,7 +5,7 @@
9852d1
 # init.d script for garbd
9852d1
 #
9852d1
 # chkconfig: - 99 01
9852d1
-# config: /etc/sysconfig/garb | /etc/default/garb
9852d1
+# config: @sysconfdir@/sysconfig/garb | @sysconfdir@/default/garb
9852d1
 
9852d1
 ### BEGIN INIT INFO
9852d1
 # Provides:          garb
9852d1
@@ -25,10 +25,10 @@
9852d1
 if [ -f /etc/redhat-release ]; then
9852d1
 	. /etc/init.d/functions
9852d1
 	. /etc/sysconfig/network
9852d1
-	config=/etc/sysconfig/garb
9852d1
+	config=@sysconfdir@/sysconfig/garb
9852d1
 else
9852d1
 	. /lib/lsb/init-functions
9852d1
-	config=/etc/default/garb
9852d1
+	config=@sysconfdir@/default/garb
9852d1
 fi
9852d1
 
9852d1
 log_failure() {
9852d1
@@ -41,9 +41,9 @@ log_failure() {
9852d1
 	fi
9852d1
 }
9852d1
 
9852d1
-PIDFILE=/var/run/garbd
9852d1
+PIDFILE=/var/run/@scl_prefix@garbd
9852d1
 
9852d1
-prog=$(which garbd)
9852d1
+prog="$(scl enable @scl@ -- which garbd)"
9852d1
 
9852d1
 program_start() {
9852d1
 	local rcode
9852d1
@@ -150,6 +150,19 @@ restart() {
9852d1
 	start
9852d1
 }
9852d1
 
9852d1
+# We have to re-enable SCL environment, because /sbin/service
9852d1
+# clears almost all environment variables.
9852d1
+# Since X_SCLS is cleared as well, we lose information about other
9852d1
+# collections enabled.
9852d1
+source @scl_scripts@/garbd-service-environment
9852d1
+source scl_source enable $@scl_upper@_SCLS_ENABLED
9852d1
+
9852d1
+# we want start daemon only inside "scl enable" invocation
9852d1
+if ! scl_enabled @scl@ ; then
9852d1
+    echo "Collection @scl@ has to be listed in @scl_scripts@/garbd-service-environment"
9852d1
+    exit 1
9852d1
+fi
9852d1
+
9852d1
 # See how we were called.
9852d1
 case "$1" in
9852d1
   start)
9852d1
diff -up galera-26.4.6/garb/files/garb-systemd.p2 galera-26.4.6/garb/files/garb-systemd
9852d1
--- galera-26.4.6/garb/files/garb-systemd.p2	2021-01-04 16:42:19.943738004 +0100
9852d1
+++ galera-26.4.6/garb/files/garb-systemd	2021-01-04 16:44:07.793869930 +0100
9852d1
@@ -4,7 +4,7 @@
9852d1
 if [[ -f /etc/debian_version ]]; then
9852d1
   config=/etc/default/garb
9852d1
 else
9852d1
-  config=/etc/sysconfig/garb
9852d1
+  config=@sysconfdir@/sysconfig/garb
9852d1
 fi
9852d1
 
9852d1
 log_failure() {
9852d1
@@ -13,7 +13,7 @@ log_failure() {
9852d1
 
9852d1
 program_start() {
9852d1
   echo "Starting garbd"
9852d1
-  /usr/bin/garbd "$@"
9852d1
+  scl enable @scl@ -- @bindir@/garbd "$@"
9852d1
 }
9852d1
 
9852d1
 start() {