From 4a544f5274fecc18b4cbb26dd6336aaba218bfd3 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 13 Jan 2020 09:05:54 +0000 Subject: [PATCH] 4.1 GA, spec file cleanups, update all pieces for the /var/run -> /run changes --- mdadm.spec | 57 +++++++++++----------- mdmonitor.init | 118 ---------------------------------------------- mdmonitor.service | 2 +- sources | 2 +- 4 files changed, 29 insertions(+), 150 deletions(-) delete mode 100755 mdmonitor.init diff --git a/mdadm.spec b/mdadm.spec index f4f6e10..537de7c 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,20 +1,19 @@ Name: mdadm Version: 4.1 -%define subversion rc2 -Release: rc2.0.5%{?dist}.2 +#define subversion rc2 +Release: 1%{?subversion:.%{subversion}}%{?dist} Summary: The mdadm program controls Linux md devices (software RAID arrays) URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ License: GPLv2+ -Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}-%{subversion}.tar.xz -Source1: mdmonitor.init -Source2: raid-check -Source3: mdadm.rules -Source4: mdadm-raid-check-sysconfig -Source5: mdadm-cron -Source6: mdmonitor.service -Source7: mdadm.conf -Source8: mdadm_event.conf +Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}%{?subversion:-%{subversion}}.tar.xz +Source1: raid-check +Source2: mdadm.rules +Source3: mdadm-raid-check-sysconfig +Source4: mdadm-cron +Source5: mdmonitor.service +Source6: mdadm.conf +Source7: mdadm_event.conf # Build without -Werror. From Debian. Patch00: https://sources.debian.org/data/main/m/mdadm/4.1-2/debian/patches/debian-no-Werror.diff#/mdadm-4.1-no-Werror.patch @@ -29,8 +28,6 @@ Requires(post): systemd coreutils Requires(preun): systemd Requires(postun): systemd coreutils -%define _hardened_build 1 - %description The mdadm program is used to create, manage, and monitor Linux MD (software RAID) devices. As such, it provides similar functionality to the raidtools @@ -39,37 +36,32 @@ almost all functions without a configuration file, though a configuration file can be used to help with some common tasks. %prep -%setup -q -n %{name}-%{version}_%{subversion} - -# Fedora customization patches -%patch00 -p1 -b .no-Werror -%patch97 -p1 -b .udev -%patch98 -p1 -b .static +%autosetup -p1 -n %{name}-%{version}%{?subversion:_%{subversion}} %build make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm mdmon %install make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install install-systemd -install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/raid-check -install -Dp -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules -install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/raid-check -install -Dp -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/cron.d/raid-check -mkdir -p -m 710 %{buildroot}/var/run/mdadm +install -Dp -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/raid-check +install -Dp -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules +install -Dp -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/raid-check +install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.d/raid-check +mkdir -p -m 710 %{buildroot}/run/mdadm # systemd mkdir -p %{buildroot}%{_unitdir} -install -m644 %{SOURCE6} %{buildroot}%{_unitdir} +install -m644 %{SOURCE5} %{buildroot}%{_unitdir} # tmpfile mkdir -p %{buildroot}%{_tmpfilesdir} -install -m 0644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/%{name}.conf +install -m 0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf mkdir -p %{buildroot}%{_localstatedir}/run/ -install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/ +install -d -m 0710 %{buildroot}/run/%{name}/ # abrt mkdir -p %{buildroot}/etc/libreport/events.d -install -m644 %{SOURCE8} %{buildroot}/etc/libreport/events.d +install -m644 %{SOURCE7} %{buildroot}/etc/libreport/events.d %post %systemd_post mdmonitor.service @@ -83,7 +75,7 @@ install -m644 %{SOURCE8} %{buildroot}/etc/libreport/events.d %files %license COPYING -%doc TODO ChangeLog mdadm.conf-example misc/* +%doc mdadm.conf-example misc/* %{_udevrulesdir}/* %{_sbindir}/* %{_unitdir}/* @@ -91,11 +83,16 @@ install -m644 %{SOURCE8} %{buildroot}/etc/libreport/events.d /usr/lib/systemd/system-shutdown/* %config(noreplace) %{_sysconfdir}/cron.d/* %config(noreplace) %{_sysconfdir}/sysconfig/* -%dir %{_localstatedir}/run/%{name}/ +%dir /run/%{name}/ %config(noreplace) %{_tmpfilesdir}/%{name}.conf /etc/libreport/events.d/* %changelog +* Mon Jan 13 2020 Peter Robinson 4.1-1 +- Update to 4.1 GA +- Spec cleanups and updates +- Update mdadm.pid location (rhbz 1701114, rhbz 1557623, rhbz 1557623) + * Sun Dec 15 2019 Julian Sikorski - 4.1-rc2.0.5.2 - Fix invalid substitution type error - Resolves bz1740662, bz1749859 diff --git a/mdmonitor.init b/mdmonitor.init deleted file mode 100755 index 03f3e95..0000000 --- a/mdmonitor.init +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# mdmonitor This starts, stops, and reloads the mdadm-based -# software RAID monitoring and management facility -# -# chkconfig: 2345 15 85 -# description: software RAID monitoring and management -# config: /etc/mdadm.conf -# -# Copyright 2002 Red Hat, Inc. -# -### BEGIN INIT INFO -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start and stop the MD software RAID monitor -# Description: The mdmonitor service checks the status of all software -# RAID arrays on the system. In the event that any of the arrays -# transition into a degraded state, it notifies the system -# administrator. Other options are available, see the mdadm.conf -# and mdadm man pages for possible ways to configure this service. -### END INIT INFO - -PIDPATH=/var/run/mdadm -PIDFILE=/var/run/mdadm/mdadm.pid -PATH=/sbin:/usr/sbin:$PATH -RETVAL=0 -OPTIONS="--monitor --scan -f --pid-file=$PIDFILE" - -prog=mdmonitor - -# Source function library. -. /etc/rc.d/init.d/functions - - -usage () -{ - echo "Usage: service $prog {start|stop|status|restart|try-restart|force-reload}" - RETVAL=1 -} - - -start () -{ -# (Re)start mdmon to take over monitoring of mdmon started from the initrd - for i in /dev/md/*.pid; do - if [ -r $i ]; then - origprog="$prog"; prog="mdmon" - action $"Starting $prog: " /sbin/mdmon --takeover --all - prog="$origprog" - break - fi - done -# Make sure configuration file exists and has information we can use -# MAILADDR or PROGRAM or both must be set in order to run mdadm --monitor - [ -f /etc/mdadm.conf ] || return 6 - grep '^\(MAILADDR\|PROGRAM\) .' /etc/mdadm.conf >/dev/null 2>&1 || return 6 - # Create our directory if it isn't there yet - if [ ! -d $PIDPATH ]; then - mkdir -m 0700 $PIDPATH >&/dev/null - RC=$? - [ -x /sbin/restorecon ] && /sbin/restorecon $PIDPATH - if [ $RC -ne 0 ]; then - echo -n "Failed to create /var/run/mdadm" - failure - echo - return 1 - fi - fi - if [ -f "$PIDFILE" ]; then - checkpid `cat $PIDFILE` && return 0 - fi - echo -n $"Starting $prog: " - cd / - daemon --user=root mdadm ${OPTIONS} - ret=$? - [ $ret -eq "0" ] && touch /var/lock/subsys/$prog - echo - return $ret -} - -stop () -{ - [ -f /var/lock/subsys/$prog ] || return 0 - echo -n "Killing $prog: " - killproc mdadm - echo - rm -f $PIDFILE - rm -f /var/lock/subsys/$prog -} - -restart () -{ - stop - start -} - -condrestart () -{ - [ -e /var/lock/subsys/$prog ] && restart || return 0 -} - - -case "$1" in - start|stop|restart|condrestart|try-restart|force-reload) - [ `id -u` != "0" ] && exit 4 ;; -esac - -case "$1" in - start) start; RETVAL=$? ;; - stop) stop; RETVAL=$? ;; - status) status -p $PIDFILE $prog ; RETVAL=$? ;; - restart) restart; RETVAL=$? ;; - reload) RETVAL=3 ;; - condrestart|try-restart|force-reload) condrestart; RETVAL=$? ;; - *) usage ; RETVAL=2 ;; -esac - -exit $RETVAL diff --git a/mdmonitor.service b/mdmonitor.service index 94618f1..2ddd1de 100644 --- a/mdmonitor.service +++ b/mdmonitor.service @@ -6,7 +6,7 @@ ConditionPathExists=/etc/mdadm.conf Type=forking PIDFile=/run/mdadm/mdadm.pid EnvironmentFile=-/etc/sysconfig/mdmonitor -ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid +ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/run/mdadm/mdadm.pid [Install] WantedBy=multi-user.target diff --git a/sources b/sources index bbad1b8..8f50f97 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mdadm-4.1-rc2.tar.xz) = f4c9dc2961ccdf00f082be493525a3814ddd831e9aa67bfb4a4128c74b7887948adec85781dda795cf18d8bfd3df4d5bb01584e7f85435c96caf4111e806bc13 +SHA512 (mdadm-4.1.tar.xz) = 0859c5d3e786345d93ff2c3b291ca8866ba60f1375479e5b4d343124f6824140a8268d42b8ae603b069edba761aa30aaf20d49e9ec54dfcbad34bad3bea0e433