|
|
65f427 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
1d9031 |
From: Robbie Harwood <rharwood@redhat.com>
|
|
|
1d9031 |
Date: Mon, 8 Nov 2021 17:58:09 -0500
|
|
|
1d9031 |
Subject: [PATCH] Replace /var/run with /run
|
|
|
1d9031 |
|
|
|
1d9031 |
This change is in violation of the FHS and is forced by systemd being
|
|
|
1d9031 |
obnoxious and logging warnings about it as if it's some kind of problem.
|
|
|
1d9031 |
|
|
|
1d9031 |
This commit is a subset of the work in
|
|
|
1d9031 |
02d473fbfd782863a0dcef7e44822d1e7e56a4b3,
|
|
|
1d9031 |
f97d3b04a2eafb42272ede24e1353dd0a7f4347c,
|
|
|
1d9031 |
5f9058677e7241cc88b4e8620654bbaa08a4bce4, and
|
|
|
1d9031 |
cffa10d9b5eec9a9def3533b181a32b64fc29913 (all by pjones) because they
|
|
|
1d9031 |
don't backport well.
|
|
|
1d9031 |
|
|
|
1d9031 |
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
|
|
1d9031 |
---
|
|
|
1d9031 |
src/daemon.h | 4 ++--
|
|
|
65f427 |
src/Makefile | 2 +-
|
|
|
1d9031 |
src/macros.pesign | 12 ++++++------
|
|
|
1d9031 |
src/pesign-authorize | 2 +-
|
|
|
1d9031 |
src/pesign.service.in | 2 +-
|
|
|
1d9031 |
src/pesign.sysvinit.in | 10 +++++-----
|
|
|
1d9031 |
src/tmpfiles.conf | 2 +-
|
|
|
1d9031 |
7 files changed, 17 insertions(+), 17 deletions(-)
|
|
|
1d9031 |
|
|
|
1d9031 |
diff --git a/src/daemon.h b/src/daemon.h
|
|
|
1d9031 |
index d97eab9..db42c16 100644
|
|
|
1d9031 |
--- a/src/daemon.h
|
|
|
1d9031 |
+++ b/src/daemon.h
|
|
|
1d9031 |
@@ -49,7 +49,7 @@ typedef enum {
|
|
|
1d9031 |
} pesignd_cmd;
|
|
|
1d9031 |
|
|
|
1d9031 |
#define PESIGND_VERSION 0x2a9edaf0
|
|
|
1d9031 |
-#define SOCKPATH "/var/run/pesign/socket"
|
|
|
1d9031 |
-#define PIDFILE "/var/run/pesign.pid"
|
|
|
1d9031 |
+#define SOCKPATH "/run/pesign/socket"
|
|
|
1d9031 |
+#define PIDFILE "/run/pesign.pid"
|
|
|
1d9031 |
|
|
|
1d9031 |
#endif /* DAEMON_H */
|
|
|
65f427 |
diff --git a/src/Makefile b/src/Makefile
|
|
|
65f427 |
index 7d68fa1..a11e2b4 100644
|
|
|
65f427 |
--- a/src/Makefile
|
|
|
65f427 |
+++ b/src/Makefile
|
|
|
65f427 |
@@ -68,7 +68,7 @@ install_sysvinit: pesign.sysvinit
|
|
|
65f427 |
install :
|
|
|
65f427 |
$(INSTALL) -d -m 700 $(INSTALLROOT)/etc/pki/pesign/
|
|
|
65f427 |
$(INSTALL) -d -m 700 $(INSTALLROOT)/etc/pki/pesign-rh-test/
|
|
|
65f427 |
- $(INSTALL) -d -m 770 $(INSTALLROOT)/var/run/pesign/
|
|
|
65f427 |
+ $(INSTALL) -d -m 770 $(INSTALLROOT)/run/pesign/
|
|
|
65f427 |
$(INSTALL) -d -m 755 $(INSTALLROOT)$(bindir)
|
|
|
65f427 |
$(INSTALL) -m 755 authvar $(INSTALLROOT)$(bindir)
|
|
|
65f427 |
$(INSTALL) -m 755 pesign $(INSTALLROOT)$(bindir)
|
|
|
1d9031 |
diff --git a/src/macros.pesign b/src/macros.pesign
|
|
|
1d9031 |
index dfdac02..f135c29 100644
|
|
|
1d9031 |
--- a/src/macros.pesign
|
|
|
1d9031 |
+++ b/src/macros.pesign
|
|
|
1d9031 |
@@ -48,17 +48,17 @@
|
|
|
1d9031 |
"$(uname -m)" == "x86_64" ] && \\\
|
|
|
1d9031 |
grep -q ID=fedora /etc/os-release && \\\
|
|
|
1d9031 |
[[ "%{_buildhost}" =~ ^bkernel.* ]] && \\\
|
|
|
1d9031 |
- ! [ -S /var/run/pesign/socket ]; then \
|
|
|
1d9031 |
+ ! [ -S /run/pesign/socket ]; then \
|
|
|
1d9031 |
echo "No socket even though this is %{_buildhost}" \
|
|
|
1d9031 |
- ls -ld /var/run/pesign || : \
|
|
|
1d9031 |
- getfacl /var/run/pesign || : \
|
|
|
1d9031 |
- ls -l /var/run/pesign/socket || : \
|
|
|
1d9031 |
- getfacl /var/run/pesign/socket || : \
|
|
|
1d9031 |
+ ls -ld /run/pesign || : \
|
|
|
1d9031 |
+ getfacl /run/pesign || : \
|
|
|
1d9031 |
+ ls -l /run/pesign/socket || : \
|
|
|
1d9031 |
+ getfacl /run/pesign/socket || : \
|
|
|
1d9031 |
echo =========== env ============== \
|
|
|
1d9031 |
set \
|
|
|
1d9031 |
echo =========== env ============== \
|
|
|
1d9031 |
exit 1 \
|
|
|
1d9031 |
- elif [ -S /var/run/pesign/socket ]; then \
|
|
|
1d9031 |
+ elif [ -S /run/pesign/socket ]; then \
|
|
|
1d9031 |
%{_pesign_client} -t %{__pesign_client_token} \\\
|
|
|
1d9031 |
-c %{__pesign_client_cert} \\\
|
|
|
1d9031 |
%{-i} %{-o} %{-e} %{-s} %{-C} \
|
|
|
1d9031 |
diff --git a/src/pesign-authorize b/src/pesign-authorize
|
|
|
1d9031 |
index a496f60..83a30cd 100755
|
|
|
1d9031 |
--- a/src/pesign-authorize
|
|
|
1d9031 |
+++ b/src/pesign-authorize
|
|
|
1d9031 |
@@ -47,7 +47,7 @@ update_subdir() {
|
|
|
1d9031 |
done
|
|
|
1d9031 |
}
|
|
|
1d9031 |
|
|
|
1d9031 |
-for x in /var/run/pesign/ /etc/pki/pesign*/ ; do
|
|
|
1d9031 |
+for x in /run/pesign/ /etc/pki/pesign*/ ; do
|
|
|
1d9031 |
if [ -d "${x}" ]; then
|
|
|
1d9031 |
update_subdir "${x}"
|
|
|
1d9031 |
else
|
|
|
1d9031 |
diff --git a/src/pesign.service.in b/src/pesign.service.in
|
|
|
1d9031 |
index c75a000..4ac2199 100644
|
|
|
1d9031 |
--- a/src/pesign.service.in
|
|
|
1d9031 |
+++ b/src/pesign.service.in
|
|
|
1d9031 |
@@ -4,6 +4,6 @@ Description=Pesign signing daemon
|
|
|
1d9031 |
[Service]
|
|
|
1d9031 |
PrivateTmp=true
|
|
|
1d9031 |
Type=forking
|
|
|
1d9031 |
-PIDFile=/var/run/pesign.pid
|
|
|
1d9031 |
+PIDFile=/run/pesign.pid
|
|
|
1d9031 |
ExecStart=/usr/bin/pesign --daemonize
|
|
|
1d9031 |
ExecStartPost=@@LIBEXECDIR@@/pesign/pesign-authorize
|
|
|
1d9031 |
diff --git a/src/pesign.sysvinit.in b/src/pesign.sysvinit.in
|
|
|
1d9031 |
index b0e0f84..bf8edec 100644
|
|
|
1d9031 |
--- a/src/pesign.sysvinit.in
|
|
|
1d9031 |
+++ b/src/pesign.sysvinit.in
|
|
|
1d9031 |
@@ -4,7 +4,7 @@
|
|
|
1d9031 |
#
|
|
|
1d9031 |
# chkconfig: - 50 50
|
|
|
1d9031 |
# processname: /usr/bin/pesign
|
|
|
1d9031 |
-# pidfile: /var/run/pesign.pid
|
|
|
1d9031 |
+# pidfile: /run/pesign.pid
|
|
|
1d9031 |
### BEGIN INIT INFO
|
|
|
1d9031 |
# Provides: pesign
|
|
|
1d9031 |
# Default-Start:
|
|
|
1d9031 |
@@ -20,9 +20,9 @@ RETVAL=0
|
|
|
1d9031 |
|
|
|
1d9031 |
start(){
|
|
|
1d9031 |
echo -n "Starting pesign: "
|
|
|
1d9031 |
- mkdir /var/run/pesign 2>/dev/null &&
|
|
|
1d9031 |
- chown pesign:pesign /var/run/pesign &&
|
|
|
1d9031 |
- chmod 0770 /var/run/pesign
|
|
|
1d9031 |
+ mkdir /run/pesign 2>/dev/null &&
|
|
|
1d9031 |
+ chown pesign:pesign /run/pesign &&
|
|
|
1d9031 |
+ chmod 0770 /run/pesign
|
|
|
1d9031 |
daemon /usr/bin/pesign --daemonize
|
|
|
1d9031 |
RETVAL=$?
|
|
|
1d9031 |
echo
|
|
|
1d9031 |
@@ -32,7 +32,7 @@ start(){
|
|
|
1d9031 |
|
|
|
1d9031 |
stop(){
|
|
|
1d9031 |
echo -n "Stopping pesign: "
|
|
|
1d9031 |
- killproc -p /var/run/pesign.pid pesignd
|
|
|
1d9031 |
+ killproc -p /run/pesign.pid pesignd
|
|
|
1d9031 |
RETVAL=$?
|
|
|
1d9031 |
echo
|
|
|
1d9031 |
rm -f /var/lock/subsys/pesign
|
|
|
1d9031 |
diff --git a/src/tmpfiles.conf b/src/tmpfiles.conf
|
|
|
1d9031 |
index c1cf355..3375ad5 100644
|
|
|
1d9031 |
--- a/src/tmpfiles.conf
|
|
|
1d9031 |
+++ b/src/tmpfiles.conf
|
|
|
1d9031 |
@@ -1 +1 @@
|
|
|
1d9031 |
-D /var/run/pesign 0770 pesign pesign -
|
|
|
1d9031 |
+D /run/pesign 0770 pesign pesign -
|