Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| bda1d2135c | |||
| c89b5c3970 | |||
| fc78c3b878 | |||
| a3079c1233 | |||
| b19ad3b719 | |||
| aafd984439 |
118
Use-run-instead-of-var-run.patch
Normal file
118
Use-run-instead-of-var-run.patch
Normal file
@@ -0,0 +1,118 @@
|
||||
From: Thomas Renninger <trenn@suse.com>
|
||||
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: <trenn@suse.com>
|
||||
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 <dashley@us.ibm.com>
|
||||
@@ -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
|
||||
14
_service
14
_service
@@ -1,16 +1,16 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<service name="obs_scm" mode="localonly">
|
||||
<param name="scm">git</param>
|
||||
<param name="version">HEAD</param>
|
||||
<param name="url">https://github.com/open-hpi/openhpi.git</param>
|
||||
<!--param name="revision">3.8.0</param-->
|
||||
<param name="version">3.8.0</param>
|
||||
<param name="exclude">.git</param>
|
||||
<param name="versionformat">3.8.0.g%h</param>
|
||||
<param name="filename">openhpi</param>
|
||||
<param name="changesgenerate">disable</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
<service name="set_version" mode="localonly"/>
|
||||
<service name="tar" mode="buildtime"/>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">*.tar</param>
|
||||
<param name="compression">xz</param>
|
||||
</service>
|
||||
<service name="set_version" mode="disabled"/>
|
||||
</services>
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
From d82555d0f32fc341d8f3e58a08f63894a3eb7ce0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
|
||||
Date: Tue, 6 Mar 2012 11:23:01 +0100
|
||||
Subject: [PATCH] add support for systemd
|
||||
|
||||
New configure parameter is introduced (--with-systemdsystemunitdir) and when set
|
||||
it means that systemd service file will be installed instead of the classis initscript.
|
||||
---
|
||||
configure.ac | 12 ++++++++++++
|
||||
openhpid/Makefile.am | 7 +++++++
|
||||
openhpid/openhpid.service.in | 11 +++++++++++
|
||||
3 files changed, 30 insertions(+)
|
||||
create mode 100644 openhpid/openhpid.service.in
|
||||
|
||||
Index: openhpi-3.8.0/configure.ac
|
||||
===================================================================
|
||||
--- openhpi-3.8.0.orig/configure.ac 2018-09-19 22:47:00.000000000 +0200
|
||||
+++ openhpi-3.8.0/configure.ac 2018-09-25 11:47:35.199528830 +0200
|
||||
@@ -775,6 +775,17 @@ AC_ARG_ENABLE([man],
|
||||
AC_SUBST(MAN,"")
|
||||
fi])
|
||||
|
||||
+dnl systemd system unit files location
|
||||
+AC_ARG_WITH([systemdsystemunitdir],
|
||||
+ AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR@:>@],[systemd system unit files location]),
|
||||
+ [enable_systemd=yes],
|
||||
+ [enable_systemd=no])
|
||||
+
|
||||
+dnl enable systemd and set unit dir
|
||||
+AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
|
||||
+unitdir=$with_systemdsystemunitdir
|
||||
+AC_SUBST(unitdir)
|
||||
+
|
||||
AC_CONFIG_FILES([openhpi.spec
|
||||
openhpi.pc
|
||||
rt-env.sh
|
||||
@@ -818,6 +829,7 @@ AC_CONFIG_FILES([openhpi.spec
|
||||
docs/man/Makefile
|
||||
openhpid/Makefile
|
||||
openhpid/openhpid.sh
|
||||
+ openhpid/openhpid.service
|
||||
openhpid/t/Makefile
|
||||
openhpid/t/ohpi/Makefile
|
||||
hpi_shell/Makefile
|
||||
Index: openhpi-3.8.0/openhpid/Makefile.am
|
||||
===================================================================
|
||||
--- openhpi-3.8.0.orig/openhpid/Makefile.am 2018-09-19 22:47:00.000000000 +0200
|
||||
+++ openhpi-3.8.0/openhpid/Makefile.am 2018-09-25 11:47:35.199528830 +0200
|
||||
@@ -28,6 +28,7 @@ DIST_SUBDIRS = t
|
||||
|
||||
EXTRA_DIST = \
|
||||
openhpid.sh.in \
|
||||
+ openhpid.service.in \
|
||||
Makefile.mingw32 \
|
||||
openhpid-win32.cpp \
|
||||
version.rc
|
||||
@@ -83,11 +84,17 @@ endif
|
||||
|
||||
|
||||
install-data-local:
|
||||
+if ENABLE_SYSTEMD
|
||||
+ $(mkinstalldirs) $(DESTDIR)$(unitdir)
|
||||
+ $(INSTALL) -m 0644 openhpid.service $(DESTDIR)$(unitdir)
|
||||
+else
|
||||
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d
|
||||
$(INSTALL) -m 0755 openhpid.sh $(DESTDIR)$(sysconfdir)/init.d/openhpid
|
||||
+endif
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(sysconfdir)/init.d/openhpid
|
||||
+ rm -f $(DESTDIR)$(unitdir)/openhpid.service
|
||||
|
||||
clean-local:
|
||||
rm -f *~ core core.*
|
||||
Index: openhpi-3.8.0/openhpid/openhpid.service.in
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ openhpi-3.8.0/openhpid/openhpid.service.in 2018-09-25 11:47:35.199528830 +0200
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+Description=Daemon providing access to the SAF Hardware Platform Interface
|
||||
+After=syslog.target
|
||||
+
|
||||
+[Service]
|
||||
+Type=forking
|
||||
+PIDFile=/var/run/openhpid.pid
|
||||
+ExecStart=@sbindir@/openhpid -c @sysconfdir@/openhpi/openhpi.conf
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
3
openhpi-3.8.0.ge4631e8a.obscpio
Normal file
3
openhpi-3.8.0.ge4631e8a.obscpio
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:30dcf3dc73e055e927d839e788282290e806322fe85206221edfc86d3458270b
|
||||
size 28210701
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:059c168a41a38128e9d99c62a3998f102ed1b9351ae0828a77e6f3abd428dadc
|
||||
size 9511504
|
||||
@@ -1,3 +1,35 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 26 09:04:06 UTC 2023 - trenn@suse.de
|
||||
|
||||
- Fix build error due to deprecated net-snmp included variable
|
||||
DES is removed from net-snmp(-devel)
|
||||
Therefore disable the plugin making use of it (snmp_bc)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 11 11:11:11 UTC 2022 - olaf@aepfle.de
|
||||
|
||||
- some sort of openssl is required for building
|
||||
- tcpd-devel is not required for building
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 3 11:31:43 UTC 2021 - Thomas Renninger <trenn@suse.de>
|
||||
|
||||
- Update _service file to use obs_scm and local/buildmode
|
||||
- Remove group rights on config file (bsc#1190042)
|
||||
- Remove mainline patches:
|
||||
D openhpi-3.4.0-systemd.patch
|
||||
D unlink-pidfile-on-error.patch
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 27 14:26:51 UTC 2021 - Thomas Renninger <trenn@suse.de>
|
||||
|
||||
- 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 <jengelh@inai.de>
|
||||
|
||||
|
||||
4
openhpi.obsinfo
Normal file
4
openhpi.obsinfo
Normal file
@@ -0,0 +1,4 @@
|
||||
name: openhpi
|
||||
version: 3.8.0.ge4631e8a
|
||||
mtime: 1556837697
|
||||
commit: e4631e8a229b68dd4b1a2d1ec7d09f75c9ae6381
|
||||
25
openhpi.spec
25
openhpi.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package openhpi
|
||||
#
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
|
||||
Name: openhpi
|
||||
Version: 3.8.0
|
||||
Version: 3.8.0.ge4631e8a
|
||||
Release: 0
|
||||
Summary: Implementation of SA Forum's Hardware Platform Interface (HPI)
|
||||
License: BSD-3-Clause
|
||||
Group: System/Monitoring
|
||||
URL: https://github.com/open-hpi/openhpi
|
||||
Source: openhpi-%{version}.tar.xz
|
||||
#Source1: openhpi-rpmlintrc
|
||||
Source2: AUTHORS
|
||||
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
|
||||
Patch1: fix_openipmi_typedef_selector_change.patch
|
||||
Patch2: fix_implicit_declarations.patch
|
||||
Patch3: Use-run-instead-of-var-run.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: docbook-toys
|
||||
@@ -42,7 +40,8 @@ BuildRequires: libtool
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: net-snmp-devel
|
||||
BuildRequires: tcpd-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pkgconfig(openssl)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
|
||||
%description
|
||||
@@ -76,14 +75,14 @@ Requires: e2fsprogs-devel
|
||||
Requires: gdbm-devel
|
||||
Requires: glib2-devel
|
||||
Requires: glibc-devel
|
||||
Requires: libopenhpi4 = %{version}
|
||||
Requires: libstdc++-devel
|
||||
Requires: libtool
|
||||
Requires: ncurses-devel
|
||||
Requires: net-snmp-devel
|
||||
Requires: libopenhpi4 = %{version}
|
||||
Requires: openssl-devel
|
||||
Requires: popt-devel
|
||||
Requires: zlib-devel
|
||||
Requires: pkgconfig(openssl)
|
||||
|
||||
%description devel
|
||||
Contains additional files needed for a developer to create applications
|
||||
@@ -126,9 +125,11 @@ chmod a-x clients/*.[ch]
|
||||
|
||||
export CFLAGS="%{optflags} -fno-strict-aliasing -DGLIB_DISABLE_DEPRECATION_WARNINGS"
|
||||
export CXXFLAGS="${CFLAGS}"
|
||||
|
||||
# --disable-snmp_bc since usmDESPrivProtocol is not defined anymore
|
||||
%configure \
|
||||
--disable-static \
|
||||
--disable-ipmi --disable-sysfs --enable-daemon \
|
||||
--disable-ipmi --disable-sysfs --enable-daemon --disable-snmp_bc \
|
||||
--enable-ipmidirect --enable-simulator --enable-clients \
|
||||
--enable-ilo2_ribcl --enable-oa_soap \
|
||||
--with-systemdsystemunitdir=%{_unitdir} \
|
||||
@@ -167,7 +168,7 @@ echo "Check OPENHPI_UNCONFIGURED in %{_sysconfdir}/openhpi/openhpi.conf"
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%dir %attr(0750,root,root) %{_sysconfdir}/openhpi
|
||||
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/openhpi/*
|
||||
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/openhpi/*
|
||||
%license COPYING
|
||||
%doc ChangeLog README *.example
|
||||
%dir %{_localstatedir}/lib/openhpi
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
Index: openhpi-3.8.0/openhpid/openhpid-posix.cpp
|
||||
===================================================================
|
||||
--- openhpi-3.8.0.orig/openhpid/openhpid-posix.cpp 2018-09-19 22:47:00.000000000 +0200
|
||||
+++ openhpi-3.8.0/openhpid/openhpid-posix.cpp 2018-09-25 11:47:01.165511254 +0200
|
||||
@@ -439,6 +439,7 @@ int main(int argc, char *argv[])
|
||||
INFO("Socket timeout(sec): %d.", sock_timeout);
|
||||
|
||||
if (oh_init()) { // Initialize OpenHPI
|
||||
+ unlink(pidfile);
|
||||
CRIT("There was an error initializing OpenHPI. Exiting.");
|
||||
return 8;
|
||||
}
|
||||
Reference in New Issue
Block a user