Fix systemd warning about use of /var/run

Resolves: rhbz#1869421
This commit is contained in:
Ondřej Lysoněk 2020-08-18 09:34:40 +02:00
parent c5217cea5f
commit e7371e4a9e
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 25f4f8793730ef3d170f1f2bd729a82fd61a4784 Mon Sep 17 00:00:00 2001
From: puneetse <22071208+puneetse@users.noreply.github.com>
Date: Wed, 11 Mar 2020 09:36:51 -0700
Subject: [PATCH] Change PIDFile path from /var/run to /run
/var/run is considered a legacy directory by systemd 239+ and having it in unit files causes a warning to be emitted to the journal.
---
prog/init/fancontrol.service | 2 +-
prog/init/sensord.service | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/prog/init/fancontrol.service b/prog/init/fancontrol.service
index 3ac1ed02..43293141 100644
--- a/prog/init/fancontrol.service
+++ b/prog/init/fancontrol.service
@@ -5,7 +5,7 @@ After=lm_sensors.service
[Service]
Type=simple
-PIDFile=/var/run/fancontrol.pid
+PIDFile=/run/fancontrol.pid
ExecStart=/usr/sbin/fancontrol
[Install]
diff --git a/prog/init/sensord.service b/prog/init/sensord.service
index 2448beeb..af2f0ae9 100644
--- a/prog/init/sensord.service
+++ b/prog/init/sensord.service
@@ -5,7 +5,7 @@ After=lm_sensors.service
[Service]
EnvironmentFile=/etc/sysconfig/sensord
Type=forking
-PIDFile=/var/run/sensord.pid
+PIDFile=/run/sensord.pid
ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon
[Install]
--
2.25.4

View File

@ -1,6 +1,6 @@
Name: lm_sensors
Version: 3.6.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Hardware monitoring tools
%define upstream_version %(echo %{version} | sed -e 's/\\./-/g')
@ -27,6 +27,9 @@ Source7: lm_sensors.service
# Downstream-only:
Patch0: 0001-Revert-unnecessary-soname-bump.patch
# Upstream patch:
Patch1: 0001-Change-PIDFile-path-from-var-run-to-run.patch
Requires: /usr/sbin/modprobe
%ifarch %{ix86} x86_64
Requires: /usr/sbin/dmidecode
@ -79,6 +82,7 @@ database, and warns of sensor alarms.
%prep
%setup -q -n lm-sensors-%{upstream_version}
%patch0 -p1
%patch1 -p1
# Remove currently unused files to make sure we've got the license right
rm -f prog/init/sysconfig-lm_sensors-convert prog/hotplug/unhide_ICH_SMBus
@ -199,6 +203,10 @@ fi
%changelog
* Tue Aug 18 2020 Ondřej Lysoněk <olysonek@redhat.com> - 3.6.0-5
- Fix systemd warning about use of /var/run
- Resolves: rhbz#1869421
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild