Accepting request 482469 from home:kukuk:branches:Base:System
- Convert rpmconfigcheck init script to systemd unit OBS-URL: https://build.opensuse.org/request/show/482469 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=390
This commit is contained in:
parent
f5955f21b5
commit
7e7de860a3
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 17 18:14:37 UTC 2017 - kukuk@suse.com
|
||||||
|
|
||||||
|
- Convert rpmconfigcheck init script to systemd unit
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Mar 6 12:37:48 UTC 2017 - rguenther@suse.com
|
Mon Mar 6 12:37:48 UTC 2017 - rguenther@suse.com
|
||||||
|
|
||||||
|
11
rpm.spec
11
rpm.spec
@ -59,6 +59,7 @@ Source9: sysconfig.services-rpm
|
|||||||
Source10: beecrypt-4.1.2.tar.bz2
|
Source10: beecrypt-4.1.2.tar.bz2
|
||||||
Source11: db-4.8.30.tar.bz2
|
Source11: db-4.8.30.tar.bz2
|
||||||
Source12: baselibs.conf
|
Source12: baselibs.conf
|
||||||
|
Source13: rpmconfigcheck.service
|
||||||
Patch1: beecrypt-4.1.2.diff
|
Patch1: beecrypt-4.1.2.diff
|
||||||
Patch2: db.diff
|
Patch2: db.diff
|
||||||
Patch3: rpm-4.12.0.1-fix-bashisms.patch
|
Patch3: rpm-4.12.0.1-fix-bashisms.patch
|
||||||
@ -309,10 +310,10 @@ install -m 644 db3/db.h %{buildroot}/usr/include/rpm
|
|||||||
for f in %{buildroot}/%{_libdir}/*.la; do
|
for f in %{buildroot}/%{_libdir}/*.la; do
|
||||||
sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f
|
sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f
|
||||||
done
|
done
|
||||||
mkdir -p %{buildroot}/etc/init.d
|
|
||||||
install -m 755 %{SOURCE8} %{buildroot}/etc/init.d
|
|
||||||
mkdir -p %{buildroot}/usr/sbin
|
mkdir -p %{buildroot}/usr/sbin
|
||||||
ln -sf ../../etc/init.d/rpmconfigcheck %{buildroot}/usr/sbin/rcrpmconfigcheck
|
install -m 755 %{SOURCE8} %{buildroot}/usr/sbin
|
||||||
|
mkdir -p %{buildroot}/usr/lib/systemd/system
|
||||||
|
install -m 644 %{SOURCE13} %{buildroot}/usr/lib/systemd/system/
|
||||||
cp -a suse_macros %{buildroot}/usr/lib/rpm
|
cp -a suse_macros %{buildroot}/usr/lib/rpm
|
||||||
mkdir -p %{buildroot}/usr/lib/rpm/macros.d
|
mkdir -p %{buildroot}/usr/lib/rpm/macros.d
|
||||||
mkdir -p %{buildroot}/usr/lib/rpm/suse
|
mkdir -p %{buildroot}/usr/lib/rpm/suse
|
||||||
@ -401,8 +402,8 @@ rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion va
|
|||||||
/bin/rpm
|
/bin/rpm
|
||||||
/usr/bin/*
|
/usr/bin/*
|
||||||
%exclude /usr/bin/rpmbuild
|
%exclude /usr/bin/rpmbuild
|
||||||
/etc/init.d/rpmconfigcheck
|
/usr/sbin/rpmconfigcheck
|
||||||
/usr/sbin/rcrpmconfigcheck
|
/usr/lib/systemd/system/rpmconfigcheck.service
|
||||||
/usr/lib/rpm
|
/usr/lib/rpm
|
||||||
%{_libdir}/rpm-plugins
|
%{_libdir}/rpm-plugins
|
||||||
%{_libdir}/librpm.so.*
|
%{_libdir}/librpm.so.*
|
||||||
|
@ -3,34 +3,14 @@
|
|||||||
#
|
#
|
||||||
# Author: Michael Schroeder <feedback@suse.de>
|
# Author: Michael Schroeder <feedback@suse.de>
|
||||||
#
|
#
|
||||||
# /etc/init.d/rpmconfigcheck
|
|
||||||
# /usr/sbin/rcrpmconfigcheck
|
|
||||||
#
|
|
||||||
# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
|
# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
|
||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: rpmconfigcheck
|
|
||||||
# Required-Start: $remote_fs
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Default-Start: 2 3 5
|
|
||||||
# Default-Stop:
|
|
||||||
# Description: rpm config file scan
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# First reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
configcheckfile=/var/adm/rpmconfigcheck
|
configcheckfile=/var/adm/rpmconfigcheck
|
||||||
packages=/var/lib/rpm/Packages
|
packages=/var/lib/rpm/Packages
|
||||||
|
|
||||||
test -z "$1" && set start
|
if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
|
||||||
|
echo "Searching for unresolved configuration files"
|
||||||
case "$1" in
|
|
||||||
start|restart|try-restart|reload|force-reload)
|
|
||||||
if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
|
|
||||||
echo -n "Searching for unresolved configuration files"
|
|
||||||
if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
|
if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
|
||||||
test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
|
test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
|
||||||
rpm -qalc | sort | perl -lne '-e "$_.rpmnew" and print "$_.rpmnew"; -e "$_.rpmorig" and print "$_.rpmorig"; -e "$_.rpmsave" and print "$_.rpmsave"' > $configcheckfile
|
rpm -qalc | sort | perl -lne '-e "$_.rpmnew" and print "$_.rpmnew"; -e "$_.rpmorig" and print "$_.rpmorig"; -e "$_.rpmsave" and print "$_.rpmsave"' > $configcheckfile
|
||||||
@ -39,9 +19,7 @@ case "$1" in
|
|||||||
while read l; do
|
while read l; do
|
||||||
test -e $l && echo $l
|
test -e $l && echo $l
|
||||||
done < $configcheckfile.old > $configcheckfile
|
done < $configcheckfile.old > $configcheckfile
|
||||||
true
|
|
||||||
fi
|
fi
|
||||||
rc_status -v
|
|
||||||
if test -s $configcheckfile; then
|
if test -s $configcheckfile; then
|
||||||
echo "Please check the following files (see /var/adm/rpmconfigcheck):"
|
echo "Please check the following files (see /var/adm/rpmconfigcheck):"
|
||||||
sed -e 's/^/ /' < $configcheckfile
|
sed -e 's/^/ /' < $configcheckfile
|
||||||
@ -64,17 +42,4 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
|
rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
|
||||||
fi
|
fi
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
rc_failed 4
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_exit
|
|
||||||
|
10
rpmconfigcheck.service
Normal file
10
rpmconfigcheck.service
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
|
||||||
|
After=local-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/sbin/rpmconfigcheck
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
Loading…
Reference in New Issue
Block a user