diff --git a/0009-remove-rundir-install.patch b/0009-remove-rundir-install.patch index 39a063b..ef5886d 100644 --- a/0009-remove-rundir-install.patch +++ b/0009-remove-rundir-install.patch @@ -1,4 +1,4 @@ -From 248b4bd1e3adc51bceebc932efbd71f86c2171cb Mon Sep 17 00:00:00 2001 +From 41afafe153da87753aa91d5669c2ddbd0b720afb Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 16 May 2022 17:50:09 +0200 Subject: [PATCH] build: remove rundir install diff --git a/0010-services-switch-logutil-and-pmieutil-scripts-from-ty.patch b/0010-services-switch-logutil-and-pmieutil-scripts-from-ty.patch new file mode 100644 index 0000000..44e7743 --- /dev/null +++ b/0010-services-switch-logutil-and-pmieutil-scripts-from-ty.patch @@ -0,0 +1,319 @@ +From e6d7bb6873531beb5b013a49e0b094cd7680cf89 Mon Sep 17 00:00:00 2001 +From: Mark Goodwin +Date: Mon, 30 Aug 2021 11:22:19 +1000 +Subject: [PATCH] services: switch logutil and pmieutil scripts from type + oneshot to exec + +Switches the "daily" and "check" and related services from Type=oneshot +to Type=exec (or Type=simple for older versions of systemd that do +not support Type=exec) and nuke KillMode=none. Explicitly specify +Restart=none, even though it's the default, to be clear that these +timer invoked service scripts are not long running service daemons +and are expected to exit normally. + +These changes are a precursor to further improvements to the long +running PCP services and systemd integration. + +All tests in the logutil and pmieutil QA groups are passing and soak +testing on several platforms has not shown any new issues (and the +systemd warnings about "Support for KillMode=none is deprecated" are +gone). + +Resolves: RHBZ#1942844 +Resolves: Fedora BZ#1897945 +Resolves: https://github.com/performancecopilot/pcp/issues/1186 +Obsoletes the earlier PR#1355. + +(cherry picked from commit 705b657107e8c812c96fa8b74d0f5d6384b00888) +Reviewed-by: David Disseldorp +References: bsc#1186511 +--- + configure | 13 +++++++++++++ + configure.ac | 14 ++++++++++++++ + src/include/builddefs.in | 3 +++ + src/pmfind/GNUmakefile | 1 + + src/pmfind/pmfind.service.in | 4 ++-- + src/pmie/GNUmakefile | 2 ++ + src/pmie/pmie_check.service.in | 4 ++-- + src/pmie/pmie_daily.service.in | 4 ++-- + src/pmlogger/GNUmakefile | 5 +++++ + src/pmlogger/pmlogger_check.service.in | 4 ++-- + src/pmlogger/pmlogger_daily-poll.service.in | 4 ++-- + src/pmlogger/pmlogger_daily.service.in | 4 ++-- + src/pmlogger/pmlogger_daily_report-poll.service.in | 4 ++-- + src/pmlogger/pmlogger_daily_report.service.in | 4 ++-- + 14 files changed, 54 insertions(+), 16 deletions(-) + +diff --git a/configure b/configure +index cc44637a5..51bd43fe9 100755 +--- a/configure ++++ b/configure +@@ -882,6 +882,7 @@ PACKAGE_BUILD + PACKAGE_REVISION + PACKAGE_MINOR + PACKAGE_MAJOR ++sd_service_type + enable_systemd + pcp_systemdunit_dir + SYSTEMD_SYSTEMUNITDIR +@@ -5933,9 +5934,21 @@ fi + done + + $have_sd_daemon || echo WARNING: using systemd, but header systemd/sd-daemon.h not installed ++ ++fi ++ ++sd_service_type="simple" ++if $enable_systemd ++then ++ systemd_version=`systemd-analyze --version | $AWK '/^systemd/ {print $2}'` ++ if test "$systemd_version" -ge 239 ++ then ++ sd_service_type="exec" ++ fi + fi + + ++ + . ./VERSION.pcp + PACKAGE_VERSION=${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_REVISION} + +diff --git a/configure.ac b/configure.ac +index 9e1c04c8b..ea5967a77 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -789,7 +789,21 @@ then + dnl is being used + AC_CHECK_HEADERS([systemd/sd-daemon.h], [have_sd_daemon=true], [have_sd_daemon=false]) + $have_sd_daemon || echo WARNING: using systemd, but header systemd/sd-daemon.h not installed ++ ++fi ++ ++sd_service_type="simple" ++if $enable_systemd ++then ++ dnl if systemd version is 239 or newer, use type=exec for logutil scripts ++ dnl else fallback to type=simple (e.g. on centos7 and some other platforms) ++ systemd_version=`systemd-analyze --version | $AWK '/^systemd/ {print $2}'` ++ if test "$systemd_version" -ge 239 ++ then ++ sd_service_type="exec" ++ fi + fi ++AC_SUBST(sd_service_type) + + dnl NB: No AC_PREFIX_DEFAULT is needed, as the default configure invocation + dnl targets a build for non-system directories such as /usr/local. +diff --git a/src/include/builddefs.in b/src/include/builddefs.in +index 02ecb4142..c5bc2d955 100644 +--- a/src/include/builddefs.in ++++ b/src/include/builddefs.in +@@ -918,6 +918,9 @@ PCP_GROUP = @pcp_group@ + PCP_USER_INSTALL = @pcp_user_install@ + PCP_GROUP_INSTALL = @pcp_group_install@ + ++# systemd service type for logutil scripts ++SD_SERVICE_TYPE=@sd_service_type@ ++ + PCPLIB = -lpcp + PCPLIB_EXTRAS = $(LIB_FOR_MATH) $(LIB_FOR_PTHREADS) $(LIB_FOR_DLOPEN) $(LIB_FOR_RT) + ifneq "$(PCPLIB)" "$(LIB_FOR_BASENAME)" +diff --git a/src/pmfind/GNUmakefile b/src/pmfind/GNUmakefile +index 7271b4869..d23e894c6 100644 +--- a/src/pmfind/GNUmakefile ++++ b/src/pmfind/GNUmakefile +@@ -65,6 +65,7 @@ pmfind.service : pmfind.service.in + -e 's;@PCP_SYSCONFIG_DIR@;'$(PCP_SYSCONFIG_DIR)';' \ + -e 's;@PCP_BINADM_DIR@;'$(PCP_BINADM_DIR)';' \ + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + crontab: crontab.in +diff --git a/src/pmfind/pmfind.service.in b/src/pmfind/pmfind.service.in +index 8ecd4fea6..2eb7eeafc 100644 +--- a/src/pmfind/pmfind.service.in ++++ b/src/pmfind/pmfind.service.in +@@ -6,8 +6,8 @@ After=pmie_check.timer pmlogger_check.timer + BindsTo=pmfind.timer + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + TimeoutSec=60 + Environment="PMFIND_CHECK_PARAMS=-C -q" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmfind +diff --git a/src/pmie/GNUmakefile b/src/pmie/GNUmakefile +index cd1d36e1d..cf381b444 100644 +--- a/src/pmie/GNUmakefile ++++ b/src/pmie/GNUmakefile +@@ -82,6 +82,7 @@ pmie_check.service : pmie_check.service.in + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmie_daily.service : pmie_daily.service.in +@@ -92,6 +93,7 @@ pmie_daily.service : pmie_daily.service.in + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + crontab: crontab.in +diff --git a/src/pmie/pmie_check.service.in b/src/pmie/pmie_check.service.in +index 00b55408a..29418df23 100644 +--- a/src/pmie/pmie_check.service.in ++++ b/src/pmie/pmie_check.service.in +@@ -5,8 +5,8 @@ ConditionPathExists=!@CRONTAB_PATH@ + PartOf=pmie.service + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + TimeoutStartSec=25m + Environment="PMIE_CHECK_PARAMS=-C" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmie_timers +diff --git a/src/pmie/pmie_daily.service.in b/src/pmie/pmie_daily.service.in +index fc52fd792..e93446ce8 100644 +--- a/src/pmie/pmie_daily.service.in ++++ b/src/pmie/pmie_daily.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmie_daily(1) + ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + Environment="PMIE_DAILY_PARAMS=-X xz -x 3" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmie_timers + ExecStart=@PCP_BINADM_DIR@/pmie_daily $PMIE_DAILY_PARAMS +diff --git a/src/pmlogger/GNUmakefile b/src/pmlogger/GNUmakefile +index 92694f430..931d64fdf 100644 +--- a/src/pmlogger/GNUmakefile ++++ b/src/pmlogger/GNUmakefile +@@ -101,6 +101,7 @@ pmlogger_daily.service : pmlogger_daily.service.in + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmlogger_daily-poll.service : pmlogger_daily-poll.service.in +@@ -111,6 +112,7 @@ pmlogger_daily-poll.service : pmlogger_daily-poll.service.in + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmlogger_check.service : pmlogger_check.service.in +@@ -121,6 +123,7 @@ pmlogger_check.service : pmlogger_check.service.in + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmlogger_daily_report.service : pmlogger_daily_report.service.in +@@ -132,6 +135,7 @@ pmlogger_daily_report.service : pmlogger_daily_report.service.in + -e 's;@PCP_SA_DIR@;'$(PCP_SA_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmlogger_daily_report-poll.service : pmlogger_daily_report-poll.service.in +@@ -143,6 +147,7 @@ pmlogger_daily_report-poll.service : pmlogger_daily_report-poll.service.in + -e 's;@PCP_SA_DIR@;'$(PCP_SA_DIR)';' \ + -e 's;@PCP_GROUP@;'$(PCP_GROUP)';' \ + -e 's;@PCP_USER@;'$(PCP_USER)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + crontab : crontab.in +diff --git a/src/pmlogger/pmlogger_check.service.in b/src/pmlogger/pmlogger_check.service.in +index fe0f347e1..ddcee72a5 100644 +--- a/src/pmlogger/pmlogger_check.service.in ++++ b/src/pmlogger/pmlogger_check.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmlogger_check(1) + ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + TimeoutStartSec=25m + Environment="PMLOGGER_CHECK_PARAMS=-C --skip-primary" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers +diff --git a/src/pmlogger/pmlogger_daily-poll.service.in b/src/pmlogger/pmlogger_daily-poll.service.in +index 69c1738f8..29c4e62c0 100644 +--- a/src/pmlogger/pmlogger_daily-poll.service.in ++++ b/src/pmlogger/pmlogger_daily-poll.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmlogger_daily(1) + ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + Environment="PMLOGGER_DAILY_POLL_PARAMS=-p" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers + ExecStart=@PCP_BINADM_DIR@/pmlogger_daily $PMLOGGER_DAILY_POLL_PARAMS +diff --git a/src/pmlogger/pmlogger_daily.service.in b/src/pmlogger/pmlogger_daily.service.in +index 44b79e6a5..8a07f5caa 100644 +--- a/src/pmlogger/pmlogger_daily.service.in ++++ b/src/pmlogger/pmlogger_daily.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmlogger_daily(1) + ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + TimeoutStartSec=1h + Environment="PMLOGGER_DAILY_PARAMS=-E" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers +diff --git a/src/pmlogger/pmlogger_daily_report-poll.service.in b/src/pmlogger/pmlogger_daily_report-poll.service.in +index 67a986ff2..2b186648e 100644 +--- a/src/pmlogger/pmlogger_daily_report-poll.service.in ++++ b/src/pmlogger/pmlogger_daily_report-poll.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmlogger_daily_report(1) + ConditionPathExists=!@CRONTAB_DAILY_REPORT_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + Environment="PMLOGGER_DAILY_REPORT_POLL_PARAMS=-o @PCP_SA_DIR@ -p" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers + ExecStart=@PCP_BINADM_DIR@/pmlogger_daily_report $PMLOGGER_DAILY_REPORT_POLL_PARAMS +diff --git a/src/pmlogger/pmlogger_daily_report.service.in b/src/pmlogger/pmlogger_daily_report.service.in +index d09489882..5937e129a 100644 +--- a/src/pmlogger/pmlogger_daily_report.service.in ++++ b/src/pmlogger/pmlogger_daily_report.service.in +@@ -4,8 +4,8 @@ Documentation=man:pmlogger_daily_report(1) + ConditionPathExists=!@CRONTAB_DAILY_REPORT_PATH@ + + [Service] +-Type=oneshot +-KillMode=none ++Type=@SD_SERVICE_TYPE@ ++Restart=no + TimeoutSec=120 + Environment="PMLOGGER_DAILY_REPORT_PARAMS=-o @PCP_SA_DIR@" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers +-- +2.35.3 + diff --git a/pcp.changes b/pcp.changes index 3a1be8c..1c7cdb5 100644 --- a/pcp.changes +++ b/pcp.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jun 8 21:33:14 UTC 2022 - David Disseldorp + +- Workaround intermittent build-time package preun failures by dropping + PMDA Remove script invocation; (bsc#1197796) + +------------------------------------------------------------------- +Tue Jun 7 16:43:41 UTC 2022 - David Disseldorp + +- Adjust systemd service types and remove deprecated KillMode=none; + (bsc#1186511) + + 0010-services-switch-logutil-and-pmieutil-scripts-from-ty.patch + ------------------------------------------------------------------- Mon May 16 14:22:19 UTC 2022 - David Disseldorp diff --git a/pcp.spec b/pcp.spec index 62a0b87..18039fb 100644 --- a/pcp.spec +++ b/pcp.spec @@ -88,6 +88,8 @@ Patch5: 0005-SUSE-fy-pmsnap-control-path.patch Patch6: 0006-pmsnap-control-var-www-srv-www.patch # PATCH-FIX-UPSTREAM, ddiss@suse.de Patch9: 0009-remove-rundir-install.patch +# PATCH-FIX-UPSTREAM, ddiss@suse.de +Patch10: 0010-services-switch-logutil-and-pmieutil-scripts-from-ty.patch %if 0%{?fedora} || 0%{?rhel} %global disable_selinux 0 @@ -551,7 +553,6 @@ Performance Co-Pilot (PCP) run-time configuration # # pcp-libs # - %package -n %{lib_pkg} Summary: Performance Co-Pilot run-time libraries License: %{license_lgplv21plus} @@ -2358,7 +2359,6 @@ Supplements: pcp This package contains the PCP Performance Metrics Domain Agent (PMDA) for collecting metrics about web server logs. - # end pcp-pmda-weblog # end C pmdas @@ -2423,7 +2423,9 @@ Requires: %{lib_pkg} = %{version}-%{release} %description system-tools This PCP module contains additional system monitoring tools written in python. -%endif #end pcp-system-tools +%endif +#end pcp-system-tools + %if !%{disable_qt} # # pcp-gui package for Qt tools @@ -2507,6 +2509,7 @@ updated policy package. %patch5 -p1 %patch6 -p1 %patch9 -p1 +%patch10 -p1 autoconf @@ -2810,16 +2813,6 @@ getent passwd pcp >/dev/null || \ useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp exit 0 -%if !%{disable_rpm} -%preun pmda-rpm -%{pmda_remove "$1" "rpm"} -%endif - -%if !%{disable_systemd} -%preun pmda-systemd -%{pmda_remove "$1" "systemd"} -%endif - %if 0%{?suse_version} && !%{disable_systemd} %preun zeroconf %service_del_preun pmlogger_daily_report.timer pmlogger_daily_report-poll.timer