diff --git a/Use-run-instead-of-var-run.patch b/Use-run-instead-of-var-run.patch new file mode 100644 index 0000000..b96ea5e --- /dev/null +++ b/Use-run-instead-of-var-run.patch @@ -0,0 +1,118 @@ +From: Thomas Renninger +Subject: Use /run instead of /var/run +References: 1185173 +Patch-Mainline: +Git-commit: 734ea9b68e505688c0a5929e1dcd0f13e8a6605c +Git-repo: git@github.com:watologo1/openhpi.git.git + +In FHS 3.0, /var/run is replaced by /run: + +https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html + + +Signed-off-by: +diff --git a/README.daemon b/README.daemon +index c7925ed1..a433003a 100644 +--- a/README.daemon ++++ b/README.daemon +@@ -84,7 +84,7 @@ listen on for client connections. If a configuration file is not found the + the daemon will listen on port 4743 by default. + + Currently, if you are not running as the root user, you must override the default +-PID file location. Normally the PID file is created in the /var/run subdirectory. ++PID file location. Normally the PID file is created in the /run subdirectory. + This directory is not writable by normal users and only the root user can write + to this location. Thus the daemon will fail when run as a normal user if the PID + file location is not overridden. To override the PID file location you can use +diff --git a/docs/man/openhpid.8.pod b/docs/man/openhpid.8.pod +index 010bc510..5c2126d2 100644 +--- a/docs/man/openhpid.8.pod ++++ b/docs/man/openhpid.8.pod +@@ -20,7 +20,7 @@ file as a command line option (-c) to override the default file. + A command option (-p) or environment variable determines the port number the + daemon will listen on for client connections. The default port is 4743. + +-The daemon creates a PID file in the /var/run subdirectory. This directory is ++The daemon creates a PID file in the /run subdirectory. This directory is + only writable by the root user. Thus the daemon will fail when run as a normal + user if the PID file location is not overridden. + To override the PID file location you can use the -f command line option. +diff --git a/openhpid/openhpid-posix.cpp b/openhpid/openhpid-posix.cpp +index 9214013e..08bcf5ab 100644 +--- a/openhpid/openhpid-posix.cpp ++++ b/openhpid/openhpid-posix.cpp +@@ -333,7 +333,7 @@ static void sig_handler( int signum ) + int main(int argc, char *argv[]) + { + int ipvflags; +- const char *pidfile = "/var/run/openhpid.pid"; ++ const char *pidfile = "/run/openhpid.pid"; + GError *error = NULL; + GOptionContext *context; + +diff --git a/openhpid/openhpid.service.in b/openhpid/openhpid.service.in +index 69b1348c..59a7791b 100644 +--- a/openhpid/openhpid.service.in ++++ b/openhpid/openhpid.service.in +@@ -4,7 +4,7 @@ After=syslog.target + + [Service] + Type=forking +-PIDFile=/var/run/openhpid.pid ++PIDFile=/run/openhpid.pid + ExecStart=@sbindir@/openhpid -c @sysconfdir@/openhpi/openhpi.conf + + [Install] +diff --git a/openhpid/openhpid.sh.in b/openhpid/openhpid.sh.in +index ab60e176..4870da85 100644 +--- a/openhpid/openhpid.sh.in ++++ b/openhpid/openhpid.sh.in +@@ -19,7 +19,7 @@ + # APIs for client programs. + # processname: openhpid + # config: the standard openhpi conf file specified on the command line or the env. +-# pidfile: /var/run/openhpid.pid ++# pidfile: /run/openhpid.pid + # + # Author(s): + # W. David Ashley +@@ -148,10 +148,10 @@ stop() { + + nolsb) + echo -n "Stopping $prog: " +- if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != "" ++ if test -f /run/openhpid.pid && test "`cat /run/openhpid.pid`" != "" + then +- kill "`cat /var/run/openhpid.pid`" +- RETVAL=$? ++ kill "`cat /run/openhpid.pid`" ++ RETVAL=$? + else + RETVAL=0 + fi +@@ -161,10 +161,10 @@ stop() { + + print_outcome + +- if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid ++ if test "$RETVAL" -eq 0 && test -f /run/openhpid.pid + then + rm -f /var/lock/openhpid +- rm -f /var/run/openhpid.pid ++ rm -f /run/openhpid.pid + fi + + } +@@ -191,9 +191,9 @@ dstatus() { + fi + ;; + gentoo | nolsb) +- if test -f /var/run/openhpid.pid && +- test "`cat /var/run/openhpid.pid`" != "" && +- kill -s 0 "`cat /var/run/openhpid.pid`" ++ if test -f /run/openhpid.pid && ++ test "`cat /run/openhpid.pid`" != "" && ++ kill -s 0 "`cat /run/openhpid.pid`" + then + echo "$prog is running" + else diff --git a/openhpi-3.4.0-systemd.patch b/openhpi-3.4.0-systemd.patch index ad25d4b..69dd981 100644 --- a/openhpi-3.4.0-systemd.patch +++ b/openhpi-3.4.0-systemd.patch @@ -83,7 +83,7 @@ Index: openhpi-3.8.0/openhpid/openhpid.service.in + +[Service] +Type=forking -+PIDFile=/run/openhpid.pid ++PIDFile=/var/run/openhpid.pid +ExecStart=@sbindir@/openhpid -c @sysconfdir@/openhpi/openhpi.conf + +[Install] diff --git a/openhpi.changes b/openhpi.changes index 0b9e832..88ef82b 100644 --- a/openhpi.changes +++ b/openhpi.changes @@ -2,6 +2,10 @@ Tue Apr 27 14:26:51 UTC 2021 - Thomas Renninger - Use /run not /var/run for PID file creation (bsc#1185173) +A Use-run-instead-of-var-run.patch + Be aware that the patch has been submitted mainstream, therefore + the git hash tag, but may not have been accepted. + Activity in the project is rather low... ------------------------------------------------------------------- Thu Oct 4 18:56:16 UTC 2018 - Jan Engelhardt diff --git a/openhpi.spec b/openhpi.spec index 1103aa7..92a81fe 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -30,6 +30,7 @@ Patch0: unlink-pidfile-on-error.patch Patch2: openhpi-3.4.0-systemd.patch Patch3: fix_openipmi_typedef_selector_change.patch Patch4: fix_implicit_declarations.patch +Patch5: Use-run-instead-of-var-run.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-toys