postinst fails if the service is disabled via systemd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debhelper (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
init-system-helpers (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When updating my Xenial with freeradius installed but not active I got the following error:
Setting up freeradius-common (2.2.8+
Setting up libfreeradius2 (2.2.8+
Setting up freeradius-utils (2.2.8+
Setting up freeradius (2.2.8+
Setting up freeradius-ldap (2.2.8+
freeradius.
invoke-rc.d: initscript freeradius, action "force-reload" failed.
dpkg: error processing package freeradius-ldap (--configure):
subprocess installed post-installation script returned error exit status 1
lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04
apt-cache policy freeradius-ldap # before update
freeradius-ldap:
Installed: 2.2.8+dfsg-
Candidate: 2.2.8+dfsg-
Version table:
2.
500 http://
500 http://
*** 2.2.8+dfsg-
500 http://
100 /var/lib/
Changed in freeradius (Ubuntu): | |
status: | Incomplete → Triaged |
summary: |
- Error when update from 2.2.8+dfsg-0.1build2 to 2.2.8+dfsg-0.1ubuntu0.1 + postinst fails if the service is disabled via systemd |
Changed in freeradius (Ubuntu): | |
importance: | Undecided → Low |
tags: |
added: bitesize removed: bite-size |
Do you still have your terminal log from before the bits you showed in the bug report?
Even if you have the service stopped, upgrading the packages would have restarted it, and the freeradius-ldap postinst would encounter the service running. Unless that earlier restart failed.
In freeradius. postinst, notice the "|| true" suffix ($action is either start or restart):
invoke- rc.d freeradius $action || true
Then comes freeradius-ldap:
invoke- rc.d freeradius force-reload
There the action will indeed fail if freeradius isn't runing.
Here are both scenarios. First, the failure: freeradius- 1712817: ~# systemctl stop freeradius.service freeradius- 1712817: ~# apt install --reinstall freeradius-ldap ldap_2. 2.8+dfsg- 0.1ubuntu0. 1_amd64. deb ... dfsg-0. 1ubuntu0. 1) over (2.2.8+ dfsg-0. 1ubuntu0. 1) ... dfsg-0. 1ubuntu0. 1) ...
oot@xenial-
root@xenial-
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.
Need to get 0 B/24.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 28097 files and directories currently installed.)
Preparing to unpack .../freeradius-
Unpacking freeradius-ldap (2.2.8+
Setting up freeradius-ldap (2.2.8+
freeradius.service is not active, cannot reload.
invoke-rc.d: initscript freeradius, action "force-reload" failed.
dpkg: error processing package freeradius-ldap (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
freeradius-ldap
E: Sub-process /usr/bin/dpkg returned an error code (1)
Now a proper upgrade, which includes freeradius itself: freeradius- 1712817: ~# systemctl stop freeradius.service freeradius- 1712817: ~# apt install --reinstall freeradius freeradius-ldap 2.2.8+dfsg- 0.1ubuntu0. 1_amd64. deb ... dfsg-0. 1ubuntu0. 1) over (2.2.8+ dfsg-0. 1ubuntu0. 1) ... ldap_2. 2.8+dfsg- 0.1ubuntu0. 1_amd64. deb ... dfsg-0. 1ubuntu0. 1) over (2.2.8+ dfsg-0. 1ubuntu0. 1) ... dfsg-0. 1ubuntu0. 1) ... dfsg-0. 1ubuntu0. 1) ... freeradius- 1712817: ~#
root@xenial-
root@xenial-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/550 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 28097 files and directories currently installed.)
Preparing to unpack .../freeradius_
Unpacking freeradius (2.2.8+
Preparing to unpack .../freeradius-
Unpacking freeradius-ldap (2.2.8+
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu19) ...
Setting up freeradius (2.2.8+
Setting up freeradius-ldap (2.2.8+
root@xenial-
I suspect the restart done by the freeradius postinst in your case failed and was masked by the "|| true" bit, or that the service started but died right afterwards.
Could you please check that your terminal had nothing else related to a freeradius restart before what you pasted in your bug report?
And also please attach a copy of /var/log/ freeradius/ radius. log as it may have inform...