package nut-client 2.7.1-1ubuntu5 failed to install/upgrade: subprocess installed post-installation script returned error exit status 6

Bug #1505288 reported by Barry Warsaw on 2015-10-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Undecided
Unassigned

Bug Description

wily dist-upgrade caused this failure.

ProblemType: Package
DistroRelease: Ubuntu 15.10
Package: nut-client 2.7.1-1ubuntu5
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.1-0ubuntu2
Architecture: amd64
Date: Mon Oct 12 11:50:28 2015
DuplicateSignature: package:nut-client:2.7.1-1ubuntu5:subprocess installed post-installation script returned error exit status 6
ErrorMessage: subprocess installed post-installation script returned error exit status 6
InstallationDate: Installed on 2011-07-12 (1552 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110705.1)
KernelVersion: Linux limelight 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
RelatedPackageVersions:
 dpkg 1.18.2ubuntu4
 apt 1.0.10.2ubuntu1
SourcePackage: nut
Title: package nut-client 2.7.1-1ubuntu5 failed to install/upgrade: subprocess installed post-installation script returned error exit status 6
UpgradeStatus: Upgraded to wily on 2011-12-23 (1388 days ago)
modified.conffile..etc.nut.nut.conf: [modified]
modified.conffile..etc.nut.upsmon.conf: [modified]
mtime.conffile..etc.nut.nut.conf: 2013-01-25T12:08:09.115231
mtime.conffile..etc.nut.upsmon.conf: 2014-01-10T17:48:44.157921

Related branches

Barry Warsaw (barry) wrote :
tags: removed: need-duplicate-check
Barry Warsaw (barry) wrote :

% sudo apt-get install --reinstall nut-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for nut-client:amd64

What?

Barry Warsaw (barry) wrote :

More headscratchers:

% locate nut-client.service | xargs ls -l
lrwxrwxrwx 1 root root 39 Jan 10 2014 /etc/systemd/system/nut-client.service -> /lib/systemd/system/nut-monitor.service
-rw-r--r-- 1 root root 0 Jan 10 2014 /var/lib/systemd/deb-systemd-helper-enabled/nut-client.service
% ls -l /etc/systemd/system/nut*
lrwxrwxrwx 1 root root 39 Jan 10 2014 /etc/systemd/system/nut-client.service -> /lib/systemd/system/nut-monitor.service

Barry Warsaw (barry) wrote :

Removing the bogus symlink lets me at least remove nut, nut-client, and nut-server and reinstall those packages.

Hi Barry,
the stale missed removal of the conffile seems still around but I fail to see the installation issue.

When upgrading from trusty to xenial I see:
/etc/systemd/system/nut-client.service -> /lib/systemd/system/nut-monitor.service

But even a follow on remove, install, reinstall, purge - all of them just work.
Even so the conffile (wel lit actually isn't considered by dpkg as one) should be removed on upgrade.

OTOH the symlink alone doesn't "hurt" systemd or nut in any way which kind of means it will fail to qualify as SRU as you know better than I do.

Is thre anything else that comes to your mind one needs to really get to the upgrade/uninstall issue that you have seen?

Your issue was around:

Setting up nut-client (2.7.1-1ubuntu5) ...
Failed to restart nut-client.service: Unit nut-client.service failed to load: No such file or directory.
invoke-rc.d: initscript nut-client, action "restart" failed.

That is the name of the now inexistent link.

But systemd uses the service it generated from the sysV init file for me at least?
systemctl status nut-client.service
● nut-client.service - LSB: Network UPS Tools monitor initscript
   Loaded: loaded (/etc/init.d/nut-client; bad; vendor preset: enabled)

Continuing "more headscratchers":

/lib/systemd/system/nut-monitor.service belongs to nut-clients:

# dpkg -S /lib/systemd/system/nut-monitor.service
nut-client: /lib/systemd/system/nut-monitor.service

I'd think that should be in nut-monitor package right?
But then I realized:

lrwxrwxrwx 1 root root 19 Aug 5 10:32 /lib/systemd/system/nut-client.service -> nut-monitor.service
-rw-r--r-- 1 root root 253 Aug 5 10:32 /lib/systemd/system/nut-monitor.service

By default it enters (but not breaks) a disabled by default mode.
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
   Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
   Active: failed (Result: protocol) since Mon 2019-08-05 11:35:18 UTC; 36s ago
  Process: 23388 ExecStart=/sbin/upsmon (code=exited, status=0/SUCCESS)

Aug 05 11:35:18 e systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Aug 05 11:35:18 e upsmon[23388]: upsmon disabled, please adjust the configuration to your needs
Aug 05 11:35:18 e upsmon[23388]: Then set MODE to a suitable value in /etc/nut/nut.conf to enable it
Aug 05 11:35:18 e systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: No such file or directory
Aug 05 11:35:18 e systemd[1]: nut-monitor.service: Failed with result 'protocol'.
Aug 05 11:35:18 e systemd[1]: Failed to start Network UPS Tools - power device monitor and shutdown controller.

I'd think that should maybe be an alias and a proper package dependency.

But lets take that aside for a while.
Install/Re-Install/Upgrade seem to be fixed at this version.
Therefore I'll reference this bug at an upcoming merge.

Laurent Bigonville (bigon) wrote :

"nut-monitor" is a GTK+ application to see the state of the UPS's

nut-monitor.service is the systemd service file starting the client part of nut, upsmon (aka ups monitor). nut-client was the name of the LSB initscript that was doing the same thing. the nut-client.service symlink is present to let systemd know that nut-client LSB script is doing the same as nut-monitor.service

Thanks for the explanation Laurent!

Now things make sense to us as well I guess.

And together with the fact that install/remove no more is an issue in the new versions things are good then.

Launchpad Janitor (janitor) wrote :
Download full text (4.3 KiB)

This bug was fixed in the package nut - 2.7.4-9ubuntu1

---------------
nut (2.7.4-9ubuntu1) eoan; urgency=medium

  * Merge with Debian unstable (LP: #1505288). Remaining changes:
    - remove Build-Depends on libpowerman0-dev
    - remove nut-powerman-pdu
      + debian/control: remove nut-powerman-pdu package
      + debian/nut-powerman-pdu.{install,manpages}: dropped for now
    - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install,
      debian/rules: Install apport hooks for all top-level nut packages.
    - debian/tests/test-nut.py: in the CVE_2012_2944 test, give nut at most
      + 5 seconds to shut down, instead of expecting it to be shut down
        immediately after sending the killall.
      + Additional indication on how to run tests for xenial+
    - d/nut-server.postinst, d/nut-cgi.postinst: ensure nut is member of group
      dialout (This existed, but was missed in the Changelog).
    - debian/libnutclient0.symbols: Correct symbols file for ppc64el.
    - Mark more symbols as optional (ppc64el, -O3).
  * Dropped changes (in Debian now):
    - debian/tests/control : Fix dep8 test failures:
       + Drop python-unit from dep8 dependencies since the python-test
         package has now been removed. The unittest module has shipped with
         Python since 2.1.
       + Add dep8 test dependency on python, since Python 2 is required and
         is not necessarily installed by default any more.

nut (2.7.4-9) unstable; urgency=medium

  [ Ondřej Nový ]
  * d/changelog: Remove trailing whitespaces
  * d/control: Remove XS-Testsuite field, not needed anymore

  [ Arnaud Quette ]
  * debian/control, debian/rules, debian/libnutscan1.install,
    debian/libnutscan-dev.install: distribute nut-scanner. (Closes: #921379
    LP: #1814314)

  [ Laurent Bigonville ]
  * Switch from cdbs to debhelper sequence
  * Bump debhelper compatibility version to 12
  * Add libltdl-dev to the build-dependencies and fix FTBFS when it is
    installed (Closes: #831740)
  * debian/control: Bump Standards-Version to 4.4.0 (no further changes)
  * debian/control: Add libnss3-dev to the dependencies of libupsclient-dev
  * debian/tests/control: Drop python-unit and depend against python package
    instead (Closes: #908963)
  * debian/control: Fix duplicate package descriptions to please lintian
  * debian/*.symbols: Add Build-Depends-Package field
  * debian/control, debian/watch: Use https for the Homepage and download page
  * debian/libnutclient0.symbols: Adjust the symbols due to C++ changes
  * debian/patches/0011-use-pkgconfig-module.patch: Use pkg-config module
    names instead of listing the libraries, to please lintian
  * Move pidfiles from /var/run/nut to /run/nut, there is nothing else to do
    since /var/run is a symlink to /run for some times now (policy 3.9.3)
  * debian/patches/0012-add-AEG-PROTECT-NAS-support.patch: Add support for
    recent AEG PROTECT NAS UPS, from upstream (Closes: #919112)
  * debian/nut-server.lintian-overrides: Override
    package-supports-alternative-init-but-no-init.d-script
    lib/systemd/system/nut-driver.service, in LSB world, the drivers are started
    by nut-server initscript
  * debian/nu...

Read more...

Changed in nut (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers