[Bug 1928259] Re: Package upgrade won't restart services

Andreas Hasenack 1928259 at bugs.launchpad.net
Tue May 25 18:56:36 UTC 2021


When it's masked, we get the error messages during package install, but it's not a fatal error, and services are not restarted. Looks like the correct outcome, given masking the service was a user's choice:
buntu at rpc-gssd-restart-1928259:~$ ps fxaw|grep rpc
  407 ?        I<     0:00  \_ [rpciod]
  524 ?        Ss     0:00 /usr/sbin/rpc.idmapd
  532 ?        Ss     0:00 /sbin/rpcbind -f -w
  643 ?        Ss     0:00 /usr/sbin/rpc.mountd --manage-gids
 2747 pts/0    S+     0:00              \_ grep --color=auto rpc
 1489 ?        Ss     0:00 /usr/sbin/rpc.svcgssd
 1490 ?        Ss     0:00 /usr/sbin/rpc.gssd
ubuntu at rpc-gssd-restart-1928259:~$ sudo apt install --reinstall nfs-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 5 not upgraded.
Need to get 243 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ahasenack/nfs-utils-restart-1928259/ubuntu bionic/main amd64 nfs-common amd64 1:1.3.4-2.1ubuntu5.5~ppa1 [243 kB]
Fetched 243 kB in 0s (4987 kB/s)
(Reading database ... 60533 files and directories currently installed.)
Preparing to unpack .../nfs-common_1%3a1.3.4-2.1ubuntu5.5~ppa1_amd64.deb ...
Unpacking nfs-common (1:1.3.4-2.1ubuntu5.5~ppa1) over (1:1.3.4-2.1ubuntu5.5~ppa1) ...
Setting up nfs-common (1:1.3.4-2.1ubuntu5.5~ppa1) ...
Failed to start nfs-utils.service: Unit nfs-utils.service is masked.
Failed to restart nfs-utils.service: Unit nfs-utils.service is masked.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.47) ...
ubuntu at rpc-gssd-restart-1928259:~$ ps fxaw|grep rpc
  407 ?        I<     0:00  \_ [rpciod]
  524 ?        Ss     0:00 /usr/sbin/rpc.idmapd
  532 ?        Ss     0:00 /sbin/rpcbind -f -w
  643 ?        Ss     0:00 /usr/sbin/rpc.mountd --manage-gids
 3283 pts/0    S+     0:00              \_ grep --color=auto rpc
 1489 ?        Ss     0:00 /usr/sbin/rpc.svcgssd
 1490 ?        Ss     0:00 /usr/sbin/rpc.gssd

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to nfs-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1928259

Title:
  Package upgrade won't restart services

Status in nfs-utils package in Ubuntu:
  New
Status in nfs-utils package in Debian:
  New

Bug description:
  Upgrading the nfs-common debian package will not restart its services.

  Specifically, the package tries to restart "nfs-utils.service", which is a "fake" service meant to coordinate all the other daemons that make up a modern NFS server. This service, however, as it is, cannot be enabled:
  $ sudo systemctl enable nfs-utils.service
  The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
  settings in the [Install] section, and DefaultInstance for template units).
  This means they are not meant to be enabled using systemctl.
  Possible reasons for having this kind of units are:
  1) A unit may be statically enabled by being symlinked from another unit's
     .wants/ or .requires/ directory.
  2) A unit's purpose may be to act as a helper for some other unit which has
     a requirement dependency on it.
  3) A unit may be started when needed via activation (socket, path, timer,
     D-Bus, udev, scripted systemctl call, ...).
  4) In case of template units, the unit is meant to be enabled with some
     instance name specified

  Granted, d/rules of the nfs-utils package doesn't even try:
      dh_systemd_enable -p nfs-common nfs-client.target                           
      dh_systemd_enable -p nfs-kernel-server nfs-server.service                   
      dh_installinit -pnfs-common -R                                              
      dh_systemd_start -p nfs-common --restart-after-upgrade nfs-utils.service    
      dh_systemd_start -p nfs-kernel-server --restart-after-upgrade nfs-server.service

  We can see it tries to start and restart it, but that won't work on disabled or non-started services: deb-systemd-invoke won't do it:
  # If the job is disabled and is not currently running, the job is not started or restarted.
  # However, if the job is disabled but has been forced into the running state, we *do* stop
  # and restart it since this is expected behaviour for the admin who forced the start.
  # We don't autostart static units either.

  The above can be seen while attempting a fresh install (or even upgrade) of nfs-common:
  (...)
  Setting up nfs-common (1:1.3.4-2.5ubuntu6) ...

  Creating config file /etc/idmapd.conf with new version
  Adding system user `statd' (UID 113) ...
  Adding new user `statd' (UID 113) with group `nogroup' ...
  Not creating home directory `/var/lib/nfs'.
  Created symlink /etc/systemd/system/multi-user.target.wants/nfs-client.target → /lib/systemd/system/nfs-client.target.
  Created symlink /etc/systemd/system/remote-fs.target.wants/nfs-client.target → /lib/systemd/system/nfs-client.target.
  nfs-utils.service is a disabled or a static unit, not starting it.
  ^^^^^^^^^^^^^^^^^

  $ systemctl status nfs-utils.service
  ● nfs-utils.service - NFS server and client services
       Loaded: loaded (/lib/systemd/system/nfs-utils.service; static)
       Active: inactive (dead)

  
  This was found while testing the fix for bug #1927745. In that bug, the affected service is rpc.gssd and it's critical that it be restarted, but it's not happening. It will only be restarted if nfs-utils.service is already "started".

  I'm marking this bug as "high" because it prevents valid fixes from
  being deployed after just upgrading a package.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1928259/+subscriptions



More information about the foundations-bugs mailing list