source: trunk/server/fedora/specs/openafs-systemd.spec.patch @ 2089

Last change on this file since 2089 was 2089, checked in by geofft, 13 years ago
openafs.spec: Don't attempt to restart OpenAFS on upgrade (Trac: #274) systemd is actually rather capable of leaving the OpenAFS client in an incredibly broken state, thanks to its willingness to track services and kill their processes. We should not attempt to restart it on upgrade, whether a normal upgrade or a migration from SysV initscripts. In the former case, it's fine (and correct) for the old AFS to keep running; in the latter case, the unit file is capable of correctly shutting down an initscript-launched client. The same is true for the OpenAFS server. This brings the packaging in line with the SysV-style initscript code in the specfile, which does not attempt to restart the service, as well as with e.g. Debian's packaging, which uses --no-restart-on-upgrade.
File size: 5.5 KB
  • openafs.spec

    old new  
    224224BuildRoot: %{_tmppath}/%{name}-%{version}-root
    225225Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
    226226Group: Networking/Filesystems
    227 BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
     227BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison, systemd-units
    228228%if 0%{?fedora}
    229229BuildRequires: perl-devel perl-ExtUtils-Embed
    230230%endif
     
    326326%package client
    327327Provides: scripts-openafs-client
    328328Requires: binutils, openafs = %{version}
     329%if 0%{?fedora} >= 15
     330Requires: systemd-units
     331Requires(post): systemd-units, systemd-sysv
     332Requires(preun): systemd-units
     333Requires(postun): systemd-units
     334%endif
    329335
    330336%if %{fedorakmod}
    331337Requires: %{name}-kmod >= %{version}
     
    350356Requires: openafs = %{version}
    351357Summary: OpenAFS Filesystem Server
    352358Group: Networking/Filesystems
     359%if 0%{?fedora} >= 15
     360Requires: systemd-units
     361Requires(post): systemd-units, systemd-sysv
     362Requires(preun): systemd-units
     363Requires(postun): systemd-units
     364%endif
    353365
    354366%description server
    355367The AFS distributed filesystem.  AFS is a distributed filesystem
     
    10051017mkdir -p $RPM_BUILD_ROOT%{_sbindir}
    10061018mkdir -p $RPM_BUILD_ROOT%{_libdir}
    10071019mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
     1020%if 0%{?fedora} < 15
    10081021mkdir -p $RPM_BUILD_ROOT%{initdir}
     1022%else
     1023mkdir -p $RPM_BUILD_ROOT%{_unitdir}
     1024mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
     1025%endif
    10091026mkdir -p $RPM_BUILD_ROOT/etc/openafs
    10101027mkdir -p $RPM_BUILD_ROOT%{pamdir}
    10111028mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
     
    10351052
    10361053# Copy root.client config files
    10371054install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
     1055%if 0%{?fedora} < 15
    10381056install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
    10391057install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
     1058%else
     1059install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
     1060install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
     1061install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
     1062%endif
    10401063
    10411064# Copy PAM modules
    10421065install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
     
    13181341fi
    13191342
    13201343%post client
     1344%if 0%{?fedora} < 15
    13211345chkconfig --add openafs-client
     1346%else
     1347if [ $1 -eq 1 ] ; then
     1348    # Initial installation
     1349    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1350fi
     1351%endif
    13221352if [ ! -d /afs ]; then
    13231353        mkdir /afs
    13241354        chown root.root /afs
     
    13351365
    13361366%post server
    13371367#on an upgrade, don't enable if we were disabled
     1368%if 0%{?fedora} < 15
    13381369if [ $1 = 1 ] ; then
    13391370  chkconfig --add openafs-server
    13401371fi
    13411372%{initdir}/openafs-server condrestart
     1373%else
     1374if [ $1 -eq 1 ] ; then
     1375    # Initial installation
     1376    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1377fi
     1378%endif
    13421379
    13431380%if %{build_authlibs}
    13441381%post authlibs
     
    13541391fi
    13551392
    13561393%preun client
     1394%if 0%{?fedora} < 15
    13571395if [ $1 = 0 ] ; then
    13581396        %{initdir}/openafs-client stop
    13591397        chkconfig --del openafs-client
    13601398fi
     1399%else
     1400if [ $1 -eq 0 ] ; then
     1401        # Package removal, not upgrade
     1402        /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
     1403        /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
     1404fi
     1405%endif
    13611406
    13621407%preun server
     1408%if 0%{?fedora} < 15
    13631409if [ $1 = 0 ] ; then
    13641410        %{initdir}/openafs-server stop
    13651411        chkconfig --del openafs-server
    13661412fi
     1413%else
     1414if [ $1 -eq 0 ] ; then
     1415        /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
     1416        /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
     1417fi
     1418%endif
     1419
     1420%postun client
     1421/bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1422
     1423%postun server
     1424/bin/systemctl daemon-reload >/dev/null 2>&1 || :
    13671425
    13681426%if %{build_dkmspkg}
    13691427%post -n dkms-%{name}
     
    14211479%endif
    14221480%endif
    14231481
     1482%triggerun -- openafs-client < 1.6.0-1
     1483# Save the current service runlevel info
     1484# User must manually run systemd-sysv-convert --apply httpd
     1485# to migrate them to systemd targets
     1486/usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
     1487
     1488# Run this because the SysV package being removed won't do it
     1489/sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
     1490
     1491%triggerun -- openafs-server < 1.6.0-1
     1492# Save the current service runlevel info
     1493# User must manually run systemd-sysv-convert --apply httpd
     1494# to migrate them to systemd targets
     1495/usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
     1496
     1497# Run this because the SysV package being removed won't do it
     1498/sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
     1499
    14241500##############################################################################
    14251501###
    14261502### file lists
     
    14581534%{pamdir}/pam_afs.krb.so
    14591535%{pamdir}/pam_afs.so.1
    14601536%{pamdir}/pam_afs.so
     1537%if 0%{?fedora} < 15
    14611538%{initdir}/openafs-client
     1539%else
     1540%{_unitdir}/openafs-client.service
     1541%{_sysconfdir}/sysconfig/modules/openafs-client.modules
     1542%endif
    14621543%{_mandir}/man1/cmdebug.*
    14631544%{_mandir}/man1/copyauth.*
    14641545%{_mandir}/man1/up.*
     
    15061587%{_sbindir}/vldb_check
    15071588%{_sbindir}/vldb_convert
    15081589%{_sbindir}/voldump
     1590%if 0%{?fedora} < 15
    15091591%{initdir}/openafs-server
     1592%else
     1593%{_unitdir}/openafs-server.service
     1594%endif
    15101595%{_mandir}/man5/AuthLog.*
    15111596%{_mandir}/man5/BackupLog.*
    15121597%{_mandir}/man5/BosConfig.*
Note: See TracBrowser for help on using the repository browser.