[SRU] package gammu-smsd 1.41.0-1 failed to install/upgrade: installed gammu-smsd package post-installation script subprocess returned error exit status 1

Bug #1877968 reported by MimziM
72
This bug affects 10 people
Affects Status Importance Assigned to Milestone
gammu (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
In Progress
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

gammu-smsd is completely unusable. The systemd service will fail to start after installation.

invoke-rc.d: initscript gammu-smsd, action "start" failed.
● gammu-smsd.service - SMS daemon for Gammu
     Loaded: bad-setting (Reason: Unit gammu-smsd.service has a bad unit file setting.)
     Active: inactive (dead)
       Docs: man:gammu-smsd(1)

Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
dpkg: error processing package gammu-smsd (--configure):
 installed gammu-smsd package post-installation script subprocess returned error exit status 1

An attempt to start it manually also fails.

$ sudo systemctl start gammu-smsd
Failed to start gammu-smsd.service: Unit gammu-smsd.service has a bad unit file setting.
See system logs and 'systemctl status gammu-smsd.service' for details.

$ sudo systemctl status gammu-smsd
● gammu-smsd.service - SMS daemon for Gammu
     Loaded: bad-setting (Reason: Unit gammu-smsd.service has a bad unit file setting.)
     Active: inactive (dead)
       Docs: man:gammu-smsd(1)

Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
Aug 08 23:59:10 focal systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
Aug 08 23:59:10 focal systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.

To make matters worse any user who has installed gammu-smsd will be unable to uninstall or upgrade as the prerm script will fail. More details about it in the "Other Info" section.

[ Test Plan ]

1.
install gammu-smsd

Use "systemctl status gammu-smsd" to check the systemd service started.

Note: It will still fail if the device is not connected but atleast the service should start and then fail with an error code if the device is not present.

2. Test upgrade
Use a Jammy system
Add Focal to apt sources (not a proper way, but worked as a quick upgrade test in this case)

"sudo apt install gammu-smsd -t focal", confirm we have a broken systemd service
upgrade to this SRU version, confirm systemd service is not broken anymore.
"sudo apt install gammu-smsd" which will install gammu-smsd from Jammy.

[ Where problems could occur ]

There is no change in code. The change in the d/rules has been taken from Jammy which forces cmake to install the service file. There should not be any regression due to this change. But a prerm file had to be added which might cause some problem. But even then the user will not see any new regression as gammu-smsd.service does not even start at the moment.

[ Other Info ]

1)
When the user attempts to upgrade the packge, the prerm of the old package will be executed which will attempt to stop the gammu-smsd.service but since the service file is invalid so that fails and eventually the upgrade fails. So, an extra prerm had to added in this SRU which will 'sed' to fix the invalid service file and then the normal upgrade process will take over.

Without the extra prerm, the package upgrade fails with:

Preparing to unpack .../gammu-smsd_1.41.0-1ubuntu0.1_amd64.deb ...
Failed to stop gammu-smsd.service: Unit gammu-smsd.service not loaded.
invoke-rc.d: initscript gammu-smsd, action "stop" failed.
dpkg: warning: old gammu-smsd package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
Failed to stop gammu-smsd.service: Unit gammu-smsd.service not loaded.
invoke-rc.d: initscript gammu-smsd, action "stop" failed.
dpkg: error processing archive /home/sudip/gammu-smsd_1.41.0-1ubuntu0.1_amd64.deb (--unpack):
 new gammu-smsd package pre-removal script subprocess returned error exit status 1

With the prerm added, the upgrade works:

Preparing to unpack .../gammu-smsd_1.41.0-1ubuntu0.1_amd64.deb ...
Failed to stop gammu-smsd.service: Unit gammu-smsd.service not loaded.
invoke-rc.d: initscript gammu-smsd, action "stop" failed.
dpkg: warning: old gammu-smsd package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK
Unpacking gammu-smsd (1.41.0-1ubuntu0.1) over (1.41.0-1) ...

2) The service file is installed in "/lib/systemd/system" instead of "/usr/lib/systemd/system" as done in Jammy. This was done as placing the file in "/usr/lib/systemd/system" is introducing a new lintian error.

E: gammu-smsd: systemd-service-file-outside-lib usr/lib/systemd/system/gammu-smsd.service
N:
N: The package ships a systemd service file outside /lib/systemd/system/
N:
N: Systemd in Debian searches for unit files in /lib/systemd/system/ and
N: /etc/systemd/system. Notably, it does <not> look in
N: /usr/lib/systemd/system/ for service files.

[ Original Bug Description ]

See system logs and 'systemctl status gammu-smsd.service' for details.
invoke-rc.d: initscript gammu-smsd, action "start" failed.
● gammu-smsd.service - SMS daemon for Gammu
     Loaded: bad-setting (Reason: Unit gammu-smsd.service has a bad unit file setting.)
     Active: inactive (dead)
       Docs: man:gammu-smsd(1)

May 11 10:43:54 BadAss systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
May 11 10:43:54 BadAss systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
May 11 10:43:54 BadAss systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
May 11 10:43:54 BadAss systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
May 11 10:43:55 BadAss systemd[1]: /lib/systemd/system/gammu-smsd.service:9: Neither a valid executable name nor an absolute path: ${CMAKE_INSTALL_FULL_BINDIR}/gammu-smsd
May 11 10:43:55 BadAss systemd[1]: gammu-smsd.service: Unit configuration has fatal error, unit will not be started.
dpkg: error processing package gammu-smsd (--configure):
 installed gammu-smsd package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (245.4-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Errors were encountered while processing:
 gammu-smsd
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: gammu-smsd 1.41.0-1
ProcVersionSignature: Ubuntu 5.4.0-28.32-generic 5.4.30
Uname: Linux 5.4.0-28-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon May 11 10:43:55 2020
ErrorMessage: installed gammu-smsd package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2020-04-30 (11 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.2
SourcePackage: gammu
Title: package gammu-smsd 1.41.0-1 failed to install/upgrade: installed gammu-smsd package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
MimziM (craigdj-hotmail) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gammu (Ubuntu):
status: New → Confirmed
Revision history for this message
Norbert (nrbrtx) wrote :
Download full text (5.0 KiB)

Just got this bug on fully updated Ubuntu 20.04 LTS, installation failed with:

```
$ sudo apt install gammu-smsd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libdbi1 libgammu-i18n libgammu8 libgsmsd8 libodbc1 libpq5
Suggested packages:
  gammu gammu-doc libmyodbc odbc-postgresql tdsodbc unixodbc-bin
The following NEW packages will be installed:
  gammu-smsd libdbi1 libgammu-i18n libgammu8 libgsmsd8 libodbc1 libpq5
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 1 073 kB of archives.
After this operation, 4 343 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 libgammu8 amd64 1.41.0-1 [424 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 libdbi1 amd64 0.9.0-5 [27,3 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 libodbc1 amd64 2.3.6-0.1build1 [189 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpq5 amd64 12.8-0ubuntu0.20.04.1 [116 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 libgsmsd8 amd64 1.41.0-1 [45,2 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 gammu-smsd amd64 1.41.0-1 [66,8 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 libgammu-i18n all 1.41.0-1 [204 kB]
Fetched 1 073 kB in 2s (608 kB/s)
Selecting previously unselected package libgammu8.
(Reading database ... 252667 files and directories currently installed.)
Preparing to unpack .../0-libgammu8_1.41.0-1_amd64.deb ...
Unpacking libgammu8 (1.41.0-1) ...
Selecting previously unselected package libdbi1:amd64.
Preparing to unpack .../1-libdbi1_0.9.0-5_amd64.deb ...
Unpacking libdbi1:amd64 (0.9.0-5) ...
Selecting previously unselected package libodbc1:amd64.
Preparing to unpack .../2-libodbc1_2.3.6-0.1build1_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.6-0.1build1) ...
Selecting previously unselected package libpq5:amd64.
Preparing to unpack .../3-libpq5_12.8-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libpq5:amd64 (12.8-0ubuntu0.20.04.1) ...
Selecting previously unselected package libgsmsd8.
Preparing to unpack .../4-libgsmsd8_1.41.0-1_amd64.deb ...
Unpacking libgsmsd8 (1.41.0-1) ...
Selecting previously unselected package gammu-smsd.
Preparing to unpack .../5-gammu-smsd_1.41.0-1_amd64.deb ...
Unpacking gammu-smsd (1.41.0-1) ...
Selecting previously unselected package libgammu-i18n.
Preparing to unpack .../6-libgammu-i18n_1.41.0-1_all.deb ...
Unpacking libgammu-i18n (1.41.0-1) ...
Setting up libdbi1:amd64 (0.9.0-5) ...
Setting up libpq5:amd64 (12.8-0ubuntu0.20.04.1) ...
Setting up libgammu8 (1.41.0-1) ...
Setting up libgammu-i18n (1.41.0-1) ...
Setting up libodbc1:amd64 (2.3.6-0.1build1) ...
Setting up libgsmsd8 (1.41.0-1) ...
Setting up gammu-smsd (1.41.0-1) ...
Failed to start gammu-smsd.service: Unit gammu-smsd.service has a bad unit file setting.
See system logs and 'systemctl status gammu-smsd.service' for details.
invoke-rc.d: initscript gammu-smsd, action "start" failed.
● gammu-smsd.service - SMS daemon for Gammu
     Loaded: bad-setting (Reason: Unit gammu-smsd.service h...

Read more...

Revision history for this message
Norbert (nrbrtx) wrote :

Also seen on AskUbuntu. I posted a solution at https://askubuntu.com/a/1372667/66509 , will cite it here:

```
sudo sed -i "s|\${CMAKE_INSTALL_FULL_BINDIR}|/usr/bin|" /lib/systemd/system/gammu-smsd.service
sudo apt-get install gammu-smsd
```

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can reproduce the issue on Focal, also tested and confirmed that its fixed in Jammy.

Changed in gammu (Ubuntu Focal):
status: New → In Progress
Changed in gammu (Ubuntu):
status: Confirmed → Fix Released
Changed in gammu (Ubuntu Jammy):
status: New → Fix Released
Changed in gammu (Ubuntu Noble):
status: New → Fix Released
Changed in gammu (Ubuntu Focal):
assignee: nobody → Sudip Mukherjee (sudipmuk)
summary: - package gammu-smsd 1.41.0-1 failed to install/upgrade: installed gammu-
- smsd package post-installation script subprocess returned error exit
- status 1
+ [SRU] package gammu-smsd 1.41.0-1 failed to install/upgrade: installed
+ gammu-smsd package post-installation script subprocess returned error
+ exit status 1
description: updated
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Its now in the SRU queue to be reviewed.

Changed in gammu (Ubuntu Focal):
assignee: Sudip Mukherjee (sudipmuk) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.