forked from pool/util-linux
Accepting request 258555 from home:sbrabec:branches:util-linux
- Fix mis-compilation of libuuid without uuidd support (bnc#900935). - Fix uuidd socket activation (bnc#900935). - Remove obsolete sysvinit script for uuidd. - Remove no more needed uuidd permissions stuff. - Replace PreReq for obsolete pwdutils by names of binaries. - Add fstrim service scripts and rcfstrim helper. OBS-URL: https://build.opensuse.org/request/show/258555 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=264
This commit is contained in:
parent
da8e6cf85d
commit
758223c093
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 17 21:18:43 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
- Fix mis-compilation of libuuid without uuidd support
|
||||
(bnc#900935).
|
||||
- Fix uuidd socket activation (bnc#900935).
|
||||
- Remove obsolete sysvinit script for uuidd.
|
||||
- Remove no more needed uuidd permissions stuff.
|
||||
- Replace PreReq for obsolete pwdutils by names of binaries.
|
||||
- Add fstrim service scripts and rcfstrim helper.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 8 21:04:34 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
|
@ -152,7 +152,6 @@ Source28: mkzimage_cmdline.8
|
||||
Source29: mkzimage_cmdline.c
|
||||
Source31: addnote.c
|
||||
#
|
||||
Source50: uuidd.rc
|
||||
Source51: blkid.conf
|
||||
##
|
||||
## util-linux patches
|
||||
@ -219,6 +218,7 @@ Supplements: packageand(util-linux:systemd)
|
||||
Provides: util-linux:/usr/lib/systemd/system/fstrim.service
|
||||
# Service files are being migrated during the update from SLE < 12 and openSUSE <= 13.1
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
%else
|
||||
# ERROR: No build_* variables are set.
|
||||
%endif
|
||||
@ -350,12 +350,11 @@ This package contains low-level util-linux utilities that use systemd.
|
||||
%package -n uuidd
|
||||
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
|
||||
Group: System/Filesystems
|
||||
PreReq: %fillup_prereq
|
||||
PreReq: %insserv_prereq
|
||||
PreReq: permissions
|
||||
PreReq: pwdutils
|
||||
Requires(pre): /usr/sbin/groupadd
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
# uuidd bash-completion moved to a correct package
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
|
||||
%description -n uuidd
|
||||
The uuidd package contains a userspace daemon (uuidd) which guarantees
|
||||
@ -394,6 +393,13 @@ pushd ../klogconsole
|
||||
popd
|
||||
|
||||
%build
|
||||
#BEGIN CONFIG ALTER
|
||||
%if !%build_util_linux_systemd
|
||||
# We are not building util_linux_systemd => we are not building uuidd
|
||||
# But we want libuuid with support of uuidd. The default configure disables it as well.
|
||||
sed -i '/^AM_CONDITIONAL.*BUILD_UUIDD/a AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])' configure.ac
|
||||
%endif
|
||||
#END CONFIG ALTER
|
||||
%if %build_util_linux
|
||||
pushd ../klogconsole
|
||||
# klogconsole build
|
||||
@ -570,6 +576,8 @@ export SUID_LDFLAGS="-pie"
|
||||
--without-python \
|
||||
%endif
|
||||
#
|
||||
# Safety check: HAVE_UUIDD should be always 1:
|
||||
grep -q 'HAVE_UUIDD 1' config.h
|
||||
make %{?_smp_mflags}
|
||||
#
|
||||
%if %build_util_linux
|
||||
@ -767,17 +775,18 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
|
||||
# install systemd files manually, don't use Makefile that expect build of utilities and its dependencies.
|
||||
%endif
|
||||
%if %build_util_linux_systemd
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||
mkdir -p %{buildroot}/bin
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
|
||||
mkdir -p %{buildroot}/run/uuidd
|
||||
install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
|
||||
mkdir -p %{buildroot}/usr/lib/systemd/system-preset
|
||||
ln -s %{_bindir}/logger %{buildroot}/bin
|
||||
# clock.txt from uuidd is a ghost file
|
||||
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
|
||||
# rcuuidd helper
|
||||
ln -sf ../..%{_sysconfdir}/init.d/uuidd %{buildroot}%{_sbindir}/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcfstrim
|
||||
# Use socket activated uuidd by default.
|
||||
echo -e 'enable uuidd.socket\nenable uuidd.service' >%{buildroot}/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%if !%build_util_linux
|
||||
%make_install
|
||||
%endif
|
||||
@ -845,24 +854,42 @@ fi
|
||||
%endif
|
||||
|
||||
%if %build_util_linux_systemd
|
||||
%pre -n uuidd
|
||||
%{_sbindir}/groupadd -r uuidd 2>/dev/null || :
|
||||
%{_sbindir}/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
# Note: This is not a perfect solution: fstrim is part of util-linux, fstrim services are part of util-linux-systemd (for build loop prevention reasons).
|
||||
# If only util-linux is updated, restart of fstrim service does not happen.
|
||||
# Maybe we should move fstrim to util-linux-systemd in the next version.
|
||||
%pre -n util-linux-systemd
|
||||
%{service_add_pre fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n uuidd
|
||||
%{stop_on_removal uuidd}
|
||||
%post -n util-linux-systemd
|
||||
%{service_add_post fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n util-linux-systemd
|
||||
%{service_del_preun fstrim.service fstrim.timer}
|
||||
|
||||
%postun -n util-linux-systemd
|
||||
%{service_del_postun fstrim.service fstrim.timer}
|
||||
|
||||
%pre -n uuidd
|
||||
/usr/sbin/groupadd -r uuidd 2>/dev/null || :
|
||||
/usr/sbin/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
%{service_add_pre uuidd.socket uuidd.service}
|
||||
# trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset.
|
||||
if [ $1 -gt 1 ] ; then
|
||||
if ! test -f /usr/lib/systemd/system-preset/50-uuidd.preset ; then
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.socket-new-in-upgrade
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.service-new-in-upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
%post -n uuidd
|
||||
%{fillup_and_insserv -n uuidd}
|
||||
%set_permissions %{_sbindir}/uuidd
|
||||
%{service_add_post uuidd.socket uuidd.service}
|
||||
|
||||
%preun -n uuidd
|
||||
%{service_del_preun uuidd.socket uuidd.service}
|
||||
|
||||
%postun -n uuidd
|
||||
%{restart_on_update uuidd}
|
||||
%{insserv_cleanup}
|
||||
|
||||
%verifyscript -n uuidd
|
||||
%verify_permissions -e %{_sbindir}/uuidd
|
||||
%{service_del_postun uuidd.socket uuidd.service}
|
||||
%endif
|
||||
|
||||
%if %build_util_linux
|
||||
@ -1276,21 +1303,22 @@ fi
|
||||
%{_datadir}/bash-completion/logger
|
||||
%{_mandir}/man1/logger.1.gz
|
||||
%{_mandir}/man1/lslogins.1.gz
|
||||
%{_sbindir}/rcfstrim
|
||||
%{_unitdir}/fstrim.service
|
||||
%{_unitdir}/fstrim.timer
|
||||
|
||||
%files -n uuidd
|
||||
%defattr(-, root, root)
|
||||
%verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd
|
||||
%{_sbindir}/uuidd
|
||||
%attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid
|
||||
%ghost %{_localstatedir}/lib/libuuid/clock.txt
|
||||
%attr(-,uuidd,uuidd) %ghost %dir /run/uuidd
|
||||
%{_datadir}/bash-completion/uuidd
|
||||
%{_initddir}/uuidd
|
||||
%{_mandir}/man8/uuidd.8.gz
|
||||
%{_sbindir}/rcuuidd
|
||||
%{_unitdir}/uuidd.service
|
||||
%{_unitdir}/uuidd.socket
|
||||
/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%endif
|
||||
|
||||
%if %build_python_libmount
|
||||
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 17 21:18:43 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
- Fix mis-compilation of libuuid without uuidd support
|
||||
(bnc#900935).
|
||||
- Fix uuidd socket activation (bnc#900935).
|
||||
- Remove obsolete sysvinit script for uuidd.
|
||||
- Remove no more needed uuidd permissions stuff.
|
||||
- Replace PreReq for obsolete pwdutils by names of binaries.
|
||||
- Add fstrim service scripts and rcfstrim helper.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 8 21:04:34 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
|
@ -152,7 +152,6 @@ Source28: mkzimage_cmdline.8
|
||||
Source29: mkzimage_cmdline.c
|
||||
Source31: addnote.c
|
||||
#
|
||||
Source50: uuidd.rc
|
||||
Source51: blkid.conf
|
||||
##
|
||||
## util-linux patches
|
||||
@ -219,6 +218,7 @@ Supplements: packageand(util-linux:systemd)
|
||||
Provides: util-linux:/usr/lib/systemd/system/fstrim.service
|
||||
# Service files are being migrated during the update from SLE < 12 and openSUSE <= 13.1
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
%else
|
||||
# ERROR: No build_* variables are set.
|
||||
%endif
|
||||
@ -350,12 +350,11 @@ This package contains low-level util-linux utilities that use systemd.
|
||||
%package -n uuidd
|
||||
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
|
||||
Group: System/Filesystems
|
||||
PreReq: %fillup_prereq
|
||||
PreReq: %insserv_prereq
|
||||
PreReq: permissions
|
||||
PreReq: pwdutils
|
||||
Requires(pre): /usr/sbin/groupadd
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
# uuidd bash-completion moved to a correct package
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
|
||||
%description -n uuidd
|
||||
The uuidd package contains a userspace daemon (uuidd) which guarantees
|
||||
@ -394,6 +393,13 @@ pushd ../klogconsole
|
||||
popd
|
||||
|
||||
%build
|
||||
#BEGIN CONFIG ALTER
|
||||
%if !%build_util_linux_systemd
|
||||
# We are not building util_linux_systemd => we are not building uuidd
|
||||
# But we want libuuid with support of uuidd. The default configure disables it as well.
|
||||
sed -i '/^AM_CONDITIONAL.*BUILD_UUIDD/a AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])' configure.ac
|
||||
%endif
|
||||
#END CONFIG ALTER
|
||||
%if %build_util_linux
|
||||
pushd ../klogconsole
|
||||
# klogconsole build
|
||||
@ -570,6 +576,8 @@ export SUID_LDFLAGS="-pie"
|
||||
--without-python \
|
||||
%endif
|
||||
#
|
||||
# Safety check: HAVE_UUIDD should be always 1:
|
||||
grep -q 'HAVE_UUIDD 1' config.h
|
||||
make %{?_smp_mflags}
|
||||
#
|
||||
%if %build_util_linux
|
||||
@ -767,17 +775,18 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
|
||||
# install systemd files manually, don't use Makefile that expect build of utilities and its dependencies.
|
||||
%endif
|
||||
%if %build_util_linux_systemd
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||
mkdir -p %{buildroot}/bin
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
|
||||
mkdir -p %{buildroot}/run/uuidd
|
||||
install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
|
||||
mkdir -p %{buildroot}/usr/lib/systemd/system-preset
|
||||
ln -s %{_bindir}/logger %{buildroot}/bin
|
||||
# clock.txt from uuidd is a ghost file
|
||||
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
|
||||
# rcuuidd helper
|
||||
ln -sf ../..%{_sysconfdir}/init.d/uuidd %{buildroot}%{_sbindir}/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcfstrim
|
||||
# Use socket activated uuidd by default.
|
||||
echo -e 'enable uuidd.socket\nenable uuidd.service' >%{buildroot}/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%if !%build_util_linux
|
||||
%make_install
|
||||
%endif
|
||||
@ -845,24 +854,42 @@ fi
|
||||
%endif
|
||||
|
||||
%if %build_util_linux_systemd
|
||||
%pre -n uuidd
|
||||
%{_sbindir}/groupadd -r uuidd 2>/dev/null || :
|
||||
%{_sbindir}/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
# Note: This is not a perfect solution: fstrim is part of util-linux, fstrim services are part of util-linux-systemd (for build loop prevention reasons).
|
||||
# If only util-linux is updated, restart of fstrim service does not happen.
|
||||
# Maybe we should move fstrim to util-linux-systemd in the next version.
|
||||
%pre -n util-linux-systemd
|
||||
%{service_add_pre fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n uuidd
|
||||
%{stop_on_removal uuidd}
|
||||
%post -n util-linux-systemd
|
||||
%{service_add_post fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n util-linux-systemd
|
||||
%{service_del_preun fstrim.service fstrim.timer}
|
||||
|
||||
%postun -n util-linux-systemd
|
||||
%{service_del_postun fstrim.service fstrim.timer}
|
||||
|
||||
%pre -n uuidd
|
||||
/usr/sbin/groupadd -r uuidd 2>/dev/null || :
|
||||
/usr/sbin/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
%{service_add_pre uuidd.socket uuidd.service}
|
||||
# trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset.
|
||||
if [ $1 -gt 1 ] ; then
|
||||
if ! test -f /usr/lib/systemd/system-preset/50-uuidd.preset ; then
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.socket-new-in-upgrade
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.service-new-in-upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
%post -n uuidd
|
||||
%{fillup_and_insserv -n uuidd}
|
||||
%set_permissions %{_sbindir}/uuidd
|
||||
%{service_add_post uuidd.socket uuidd.service}
|
||||
|
||||
%preun -n uuidd
|
||||
%{service_del_preun uuidd.socket uuidd.service}
|
||||
|
||||
%postun -n uuidd
|
||||
%{restart_on_update uuidd}
|
||||
%{insserv_cleanup}
|
||||
|
||||
%verifyscript -n uuidd
|
||||
%verify_permissions -e %{_sbindir}/uuidd
|
||||
%{service_del_postun uuidd.socket uuidd.service}
|
||||
%endif
|
||||
|
||||
%if %build_util_linux
|
||||
@ -1276,21 +1303,22 @@ fi
|
||||
%{_datadir}/bash-completion/logger
|
||||
%{_mandir}/man1/logger.1.gz
|
||||
%{_mandir}/man1/lslogins.1.gz
|
||||
%{_sbindir}/rcfstrim
|
||||
%{_unitdir}/fstrim.service
|
||||
%{_unitdir}/fstrim.timer
|
||||
|
||||
%files -n uuidd
|
||||
%defattr(-, root, root)
|
||||
%verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd
|
||||
%{_sbindir}/uuidd
|
||||
%attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid
|
||||
%ghost %{_localstatedir}/lib/libuuid/clock.txt
|
||||
%attr(-,uuidd,uuidd) %ghost %dir /run/uuidd
|
||||
%{_datadir}/bash-completion/uuidd
|
||||
%{_initddir}/uuidd
|
||||
%{_mandir}/man8/uuidd.8.gz
|
||||
%{_sbindir}/rcuuidd
|
||||
%{_unitdir}/uuidd.service
|
||||
%{_unitdir}/uuidd.socket
|
||||
/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%endif
|
||||
|
||||
%if %build_python_libmount
|
||||
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 17 21:18:43 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
- Fix mis-compilation of libuuid without uuidd support
|
||||
(bnc#900935).
|
||||
- Fix uuidd socket activation (bnc#900935).
|
||||
- Remove obsolete sysvinit script for uuidd.
|
||||
- Remove no more needed uuidd permissions stuff.
|
||||
- Replace PreReq for obsolete pwdutils by names of binaries.
|
||||
- Add fstrim service scripts and rcfstrim helper.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 8 21:04:34 CEST 2014 - sbrabec@suse.cz
|
||||
|
||||
|
@ -152,7 +152,6 @@ Source28: mkzimage_cmdline.8
|
||||
Source29: mkzimage_cmdline.c
|
||||
Source31: addnote.c
|
||||
#
|
||||
Source50: uuidd.rc
|
||||
Source51: blkid.conf
|
||||
##
|
||||
## util-linux patches
|
||||
@ -219,6 +218,7 @@ Supplements: packageand(util-linux:systemd)
|
||||
Provides: util-linux:/usr/lib/systemd/system/fstrim.service
|
||||
# Service files are being migrated during the update from SLE < 12 and openSUSE <= 13.1
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
%else
|
||||
# ERROR: No build_* variables are set.
|
||||
%endif
|
||||
@ -350,12 +350,11 @@ This package contains low-level util-linux utilities that use systemd.
|
||||
%package -n uuidd
|
||||
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
|
||||
Group: System/Filesystems
|
||||
PreReq: %fillup_prereq
|
||||
PreReq: %insserv_prereq
|
||||
PreReq: permissions
|
||||
PreReq: pwdutils
|
||||
Requires(pre): /usr/sbin/groupadd
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
# uuidd bash-completion moved to a correct package
|
||||
Conflicts: util-linux < 2.25
|
||||
%systemd_requires
|
||||
|
||||
%description -n uuidd
|
||||
The uuidd package contains a userspace daemon (uuidd) which guarantees
|
||||
@ -394,6 +393,13 @@ pushd ../klogconsole
|
||||
popd
|
||||
|
||||
%build
|
||||
#BEGIN CONFIG ALTER
|
||||
%if !%build_util_linux_systemd
|
||||
# We are not building util_linux_systemd => we are not building uuidd
|
||||
# But we want libuuid with support of uuidd. The default configure disables it as well.
|
||||
sed -i '/^AM_CONDITIONAL.*BUILD_UUIDD/a AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])' configure.ac
|
||||
%endif
|
||||
#END CONFIG ALTER
|
||||
%if %build_util_linux
|
||||
pushd ../klogconsole
|
||||
# klogconsole build
|
||||
@ -570,6 +576,8 @@ export SUID_LDFLAGS="-pie"
|
||||
--without-python \
|
||||
%endif
|
||||
#
|
||||
# Safety check: HAVE_UUIDD should be always 1:
|
||||
grep -q 'HAVE_UUIDD 1' config.h
|
||||
make %{?_smp_mflags}
|
||||
#
|
||||
%if %build_util_linux
|
||||
@ -767,17 +775,18 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
|
||||
# install systemd files manually, don't use Makefile that expect build of utilities and its dependencies.
|
||||
%endif
|
||||
%if %build_util_linux_systemd
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||
mkdir -p %{buildroot}/bin
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
|
||||
mkdir -p %{buildroot}/run/uuidd
|
||||
install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
|
||||
mkdir -p %{buildroot}/usr/lib/systemd/system-preset
|
||||
ln -s %{_bindir}/logger %{buildroot}/bin
|
||||
# clock.txt from uuidd is a ghost file
|
||||
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
|
||||
# rcuuidd helper
|
||||
ln -sf ../..%{_sysconfdir}/init.d/uuidd %{buildroot}%{_sbindir}/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rcfstrim
|
||||
# Use socket activated uuidd by default.
|
||||
echo -e 'enable uuidd.socket\nenable uuidd.service' >%{buildroot}/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%if !%build_util_linux
|
||||
%make_install
|
||||
%endif
|
||||
@ -845,24 +854,42 @@ fi
|
||||
%endif
|
||||
|
||||
%if %build_util_linux_systemd
|
||||
%pre -n uuidd
|
||||
%{_sbindir}/groupadd -r uuidd 2>/dev/null || :
|
||||
%{_sbindir}/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
# Note: This is not a perfect solution: fstrim is part of util-linux, fstrim services are part of util-linux-systemd (for build loop prevention reasons).
|
||||
# If only util-linux is updated, restart of fstrim service does not happen.
|
||||
# Maybe we should move fstrim to util-linux-systemd in the next version.
|
||||
%pre -n util-linux-systemd
|
||||
%{service_add_pre fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n uuidd
|
||||
%{stop_on_removal uuidd}
|
||||
%post -n util-linux-systemd
|
||||
%{service_add_post fstrim.service fstrim.timer}
|
||||
|
||||
%preun -n util-linux-systemd
|
||||
%{service_del_preun fstrim.service fstrim.timer}
|
||||
|
||||
%postun -n util-linux-systemd
|
||||
%{service_del_postun fstrim.service fstrim.timer}
|
||||
|
||||
%pre -n uuidd
|
||||
/usr/sbin/groupadd -r uuidd 2>/dev/null || :
|
||||
/usr/sbin/useradd -r -g uuidd -c "User for uuidd" \
|
||||
-d /var/run/uuidd uuidd 2>/dev/null || :
|
||||
%{service_add_pre uuidd.socket uuidd.service}
|
||||
# trick: service existed before, but it had no preset before 13.2 and in SLE12. Force %%service_add_post to run preset.
|
||||
if [ $1 -gt 1 ] ; then
|
||||
if ! test -f /usr/lib/systemd/system-preset/50-uuidd.preset ; then
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.socket-new-in-upgrade
|
||||
echo -n "" >/run/rpm-%{name}-update-uuidd.service-new-in-upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
%post -n uuidd
|
||||
%{fillup_and_insserv -n uuidd}
|
||||
%set_permissions %{_sbindir}/uuidd
|
||||
%{service_add_post uuidd.socket uuidd.service}
|
||||
|
||||
%preun -n uuidd
|
||||
%{service_del_preun uuidd.socket uuidd.service}
|
||||
|
||||
%postun -n uuidd
|
||||
%{restart_on_update uuidd}
|
||||
%{insserv_cleanup}
|
||||
|
||||
%verifyscript -n uuidd
|
||||
%verify_permissions -e %{_sbindir}/uuidd
|
||||
%{service_del_postun uuidd.socket uuidd.service}
|
||||
%endif
|
||||
|
||||
%if %build_util_linux
|
||||
@ -1276,21 +1303,22 @@ fi
|
||||
%{_datadir}/bash-completion/logger
|
||||
%{_mandir}/man1/logger.1.gz
|
||||
%{_mandir}/man1/lslogins.1.gz
|
||||
%{_sbindir}/rcfstrim
|
||||
%{_unitdir}/fstrim.service
|
||||
%{_unitdir}/fstrim.timer
|
||||
|
||||
%files -n uuidd
|
||||
%defattr(-, root, root)
|
||||
%verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd
|
||||
%{_sbindir}/uuidd
|
||||
%attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid
|
||||
%ghost %{_localstatedir}/lib/libuuid/clock.txt
|
||||
%attr(-,uuidd,uuidd) %ghost %dir /run/uuidd
|
||||
%{_datadir}/bash-completion/uuidd
|
||||
%{_initddir}/uuidd
|
||||
%{_mandir}/man8/uuidd.8.gz
|
||||
%{_sbindir}/rcuuidd
|
||||
%{_unitdir}/uuidd.service
|
||||
%{_unitdir}/uuidd.socket
|
||||
/usr/lib/systemd/system-preset/50-uuidd.preset
|
||||
%endif
|
||||
|
||||
%if %build_python_libmount
|
||||
|
77
uuidd.rc
77
uuidd.rc
@ -1,77 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: uuidd
|
||||
# Required-Start: $time $local_fs $remote_fs
|
||||
# Should-Start:
|
||||
# Required-Stop: $time $local_fs $remote_fs
|
||||
# Should-Stop:
|
||||
# Default-Start: 2 3 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: UUID generating daemon
|
||||
# Description: UUID generating daemon
|
||||
### END INIT INFO
|
||||
#
|
||||
|
||||
|
||||
UUIDD_BIN=/usr/sbin/uuidd
|
||||
UUIDD_PID_PATH=/var/run/uuidd
|
||||
UUIDD_OPTIONS="-q -T 0"
|
||||
|
||||
test -x $UUIDD_BIN || { echo "$UUIDD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
. /etc/rc.status
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting uuidd "
|
||||
mkdir -p $UUIDD_PID_PATH
|
||||
chown uuidd:uuidd $UUIDD_PID_PATH
|
||||
/sbin/startproc -u uuidd -g uuidd $UUIDD_BIN $UUIDD_OPTIONS
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down uuidd "
|
||||
/sbin/killproc -TERM $UUIDD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart|force-reload)
|
||||
## Do a restart only if the service was active before.
|
||||
## Note: try-restart is now part of LSB (as of 1.9).
|
||||
## RH has a similar command named condrestart.
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
# Remember status and be quiet
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
reload)
|
||||
rc_failed 3
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service uuidd "
|
||||
/sbin/checkproc $UUIDD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
Loading…
Reference in New Issue
Block a user