diff --git a/nfs-client.nfs.conf b/nfs-client.nfs.conf new file mode 100644 index 0000000..21758b6 --- /dev/null +++ b/nfs-client.nfs.conf @@ -0,0 +1,4 @@ + +# When nfs is stopped or restarted, nfs-client must too. +[Unit] +PartOf=nfs.service diff --git a/nfs-server.nfsserver.conf b/nfs-server.nfsserver.conf new file mode 100644 index 0000000..575e110 --- /dev/null +++ b/nfs-server.nfsserver.conf @@ -0,0 +1,4 @@ + +# When nfsserver is stopped or restarted, nfs-server must too. +[Unit] +PartOf=nfsserver.service diff --git a/nfs-utils.changes b/nfs-utils.changes index ac58aa4..20669e5 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 29 22:50:04 UTC 2019 - Neil Brown + +- Restored nfs.service nad nfserver.service wrappers + as "install images" need these still. + ------------------------------------------------------------------- Tue Dec 4 00:03:00 UTC 2018 - Neil Brown @@ -30,6 +36,7 @@ Thu Oct 25 05:32:30 UTC 2018 - Neil Brown 0002-mount-call-setgroups-before-setuid.patch 0003-nfs-server-generator-handle-noauto-mounts-correctly.patch nsm-headers.patch + sysmacros.patch ------------------------------------------------------------------- Mon Aug 6 07:29:37 UTC 2018 - schwab@suse.de diff --git a/nfs-utils.spec b/nfs-utils.spec index 6440684..1402159 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -1,7 +1,7 @@ # # spec file for package nfs-utils # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -38,6 +38,10 @@ Source7: fw-client Source8: fw-server Source11: idmapd.conf Source13: nfs-utils.rpmlintrc +Source15: nfsserver.service +Source16: nfs.service +Source17: nfs-server.nfsserver.conf +Source18: nfs-client.nfs.conf Source20: nfs-mountd.options.conf Source21: nfs-server.options.conf Source22: rpc-gssd.options.conf @@ -184,6 +188,10 @@ done %install make %{?_smp_mflags} DESTDIR=%{buildroot} install +install -D -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/nfsserver.service +install -D -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/nfs.service +install -D -m 644 %{SOURCE17} %{buildroot}%{_unitdir}/nfs-server.service.d/nfsserver.conf +install -D -m 644 %{SOURCE18} %{buildroot}%{_unitdir}/nfs-client.target.d/nfs.conf find %{buildroot} -type f -name '*.la' -delete -print install -D -m 644 %{SOURCE20} %{buildroot}%{_unitdir}/nfs-mountd.service.d/options.conf install -D -m 644 %{SOURCE21} %{buildroot}%{_unitdir}/nfs-server.service.d/options.conf @@ -193,7 +201,9 @@ install -D -m 644 %{SOURCE24} %{buildroot}%{_unitdir}/rpc-statd-notify.service.d install -D -m 644 %{SOURCE25} %{buildroot}%{_unitdir}/rpc-svcgssd.service.d/options.conf install -D -m 644 %{SOURCE26} %{buildroot}%{_sysconfdir}/nfs.conf install -D -m 644 %{SOURCE27} %{buildroot}%{_prefix}/lib/tmpfiles.d/nfs-kernel-server.conf +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfsserver ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs-server +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs-client # sysconfig-data mkdir -p %{buildroot}%{_fillupdir} @@ -218,7 +228,7 @@ chmod 644 %{buildroot}%{_sbindir}/{mountstats,nfsiostat} /usr/bin/getent passwd statd >/dev/null || \ /usr/sbin/useradd -r -c 'NFS statd daemon' \ -s /sbin/nologin -d %{_localstatedir}/lib/nfs -g nogroup statd -%service_add_pre auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service +%service_add_pre nfs.service auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service %post -n nfs-client chown statd:nogroup %{_localstatedir}/lib/nfs > /dev/null 2>&1 || : @@ -238,23 +248,23 @@ fi # %set_permissions /sbin/mount.nfs /sbin/ldconfig -%service_add_post auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service +%service_add_post nfs.service auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service %preun -n nfs-client -%service_del_preun auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service +%service_del_preun nfs.service auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service %postun -n nfs-client /sbin/ldconfig -%service_del_postun auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service +%service_del_postun nfs.service auth-rpcgss-module.service nfs-idmapd.service nfs-blkmap.service rpc-statd-notify.service rpc-gssd.service rpc-statd.service rpc-svcgssd.service %verifyscript -n nfs-client %verify_permissions -e /sbin/mount.nfs %pre -n nfs-kernel-server -%service_add_pre nfs-svcgssd.service nfs-mountd.service nfs-server.service +%service_add_pre nfsserver.service nfs-svcgssd.service nfs-mountd.service nfs-server.service %preun -n nfs-kernel-server -%service_del_preun nfs-svcgssd.service nfs-mountd.service nfs-server.service +%service_del_preun nfsserver.service nfs-svcgssd.service nfs-mountd.service nfs-server.service %post -n nfs-kernel-server ### migrate from /var/lock/subsys @@ -266,12 +276,12 @@ if [ -f %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd ]; then mv %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd /run/nfs fi ### -%service_add_post nfs-mountd.service nfs-server.service +%service_add_post nfsserver.service nfs-mountd.service nfs-server.service %tmpfiles_create nfs-kernel-server.conf %set_permissions /var/lib/nfs/rmtab %postun -n nfs-kernel-server -%service_del_postun nfs-mountd.service nfs-server.service +%service_del_postun nfsserver.service nfs-mountd.service nfs-server.service %verifyscript -n nfs-kernel-server %verify_permissions -e /var/lib/nfs/rmtab @@ -290,6 +300,7 @@ fi %attr(0755,root,root) %{_sbindir}/nfsiostat %{_sbindir}/nfsidmap %{_sbindir}/nfsstat +%{_sbindir}/rcnfs %{_sbindir}/rcnfs-client %{_sbindir}/rpc.gssd %{_sbindir}/rpc.idmapd @@ -316,6 +327,9 @@ fi %{_unitdir}/rpc-svcgssd.service %{_unitdir}/rpc-svcgssd.service.d %{_unitdir}/var-lib-nfs-rpc_pipefs.mount +%{_unitdir}/nfs.service +%dir %{_unitdir}/nfs-client.target.d +%{_unitdir}/nfs-client.target.d/nfs.conf %dir /usr/lib/systemd/system-generators /usr/lib/systemd/system-generators/nfs-server-generator /usr/lib/systemd/system-generators/rpc-pipefs-generator @@ -360,8 +374,11 @@ fi %{_unitdir}/nfs-server.service %{_unitdir}/nfs-server.service.d %{_unitdir}/proc-fs-nfsd.mount +%{_unitdir}/nfsserver.service +%{_unitdir}/nfs-server.service.d/nfsserver.conf %{_prefix}/lib/tmpfiles.d/nfs-kernel-server.conf %{_sbindir}/exportfs +%{_sbindir}/rcnfsserver %{_sbindir}/rcnfs-server %{_sbindir}/rpc.mountd %{_sbindir}/rpc.nfsd diff --git a/nfs.service b/nfs.service new file mode 100644 index 0000000..ad879f7 --- /dev/null +++ b/nfs.service @@ -0,0 +1,23 @@ +[Unit] +Description=Alias for NFS client +# The systemd alias mechanism (using symlinks) isn't rich enough. +# If you "systemctl enable" an alias, it doesn't enable the +# target. +# This service file creates a sufficiently rich alias for nfs-client +# (which is the canonical upstream name) +# "start", "stop", "restart", "reload" on this will do the same to nfs-client. +# "enable" on this will only enable this service, but when it starts, that +# starts nfs-client, so it is effectively enabled. +# nfs-server.d/nfsserver.conf is part of this service. + +Requires= nfs-client.target +PropagatesReloadTo=nfs-client.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/true + +[Install] +WantedBy=multi-user.target + diff --git a/nfsserver.service b/nfsserver.service new file mode 100644 index 0000000..028cfdc --- /dev/null +++ b/nfsserver.service @@ -0,0 +1,26 @@ +[Unit] +Description=Alias for NFS server +# The systemd alias mechanism (using symlinks) isn't rich enough. +# If you "systemctl enable" an alias, it doesn't enable the +# target. +# This service file creates a sufficiently rich alias for nfs-server +# (which is the canonical upstream name) +# "start", "stop", "restart", "reload" on this will do the same to nfs-server. +# "enable" on this will only enable this service, but when it starts, that +# starts nfs-server, so it is effectively enabled. +# nfs-server.d/nfsserver.conf is part of this service. + +Requires= nfs-server.service + +[Service] +Type=oneshot +ExecStart=/bin/true +RemainAfterExit=yes +# Can't just PropagatesReloadTo to nfs-server.service +# as reload fails if we don't have our own ExecReload +# So copy that from nfs-server.service +ExecReload=/usr/sbin/exportfs -r + +[Install] +WantedBy=multi-user.target +