samba-common-bin should call systemd-tmpfiles before testparm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Debian) |
Fix Released
|
Unknown
|
|||
samba (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Athos Ribeiro | ||
Groovy |
Fix Released
|
Undecided
|
Athos Ribeiro |
Bug Description
[Impact]
The samba-common-bin postinst script relies on the presence of the /run/samba directory. This directory will not be available unless samba-common-bin is installed right after samba-common, whose postinst script creates /run/samba. Although samba-common-bin Depends on samba-common, reducing the risk of an user hitting the described bug, samba-common only Recommends samba-common-bin, making the following case possible:
The user installs samba-common. Then, the user removes samba-common-bin. Then the user reboots the system (which removes /run/samba created during samba-common installation). Finally, the user installs samba-common-bin, which results in a postinst script failure.
[Test Plan]
To reproduce the issue, run the following steps:
# apt install samba-common
# apt remove samba-common-bin
Reboot the system and verify that the /run/samba directory no longer exists
Run
# apt install samba-common-bin
This command should exit with a non-zero status, as described in the original bug report.
After applying the proposed changes, performing the steps above should result in a successful exit status for the last command.
[Where problems could occur]
There are 2 changes to be considered here. The one to d/rules and the one to d/samba-
The change to d/rules makes the #DEBHELPER# tag, moved in the change to d/samba-
Still, if the systemd-tmpfiles command does not run (e.g., there is no systemd available in the system), the issue this SRU is fixing will still manifest itself under the described conditions (which is true for hirsute, impish, and Debian stable as well).
[Other Info]
This issue was already fixed in Debian unstable and, consequently, in Ubuntu hirsute and impish.
[Original message]
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: samba-common-bin 2:4.11.
ProcVersionSign
Uname: Linux 5.4.0-54-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Tue Nov 24 07:17:34 2020
DistributionCha
# This is the distribution channel descriptor for the OEM CDs
# For more information see http://
canonical-
ErrorMessage: o subprocesso instalado, do pacote samba-common-bin, o script post-installation retornou erro do status de saída 1
InstallationDate: Installed on 2020-11-12 (11 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38
Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18, python-is-python2, 2.7.17-4
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.2ubuntu0.1
SambaClientRegr
SourcePackage: samba
Title: package samba-common-bin 2:4.11.
UpgradeStatus: Upgraded to focal on 2020-11-21 (3 days ago)
Related branches
- Sergio Durigan Junior (community): Approve
- Canonical Server: Pending requested
-
Diff: 86 lines (+36/-2)5 files modifieddebian/changelog (+13/-0)
debian/rules (+3/-0)
debian/samba-common-bin.postinst (+5/-2)
debian/tests/control (+4/-0)
debian/tests/reinstall-samba-common-bin (+11/-0)
- Sergio Durigan Junior (community): Approve
- Canonical Server Core Reviewers: Pending requested
-
Diff: 86 lines (+36/-2)5 files modifieddebian/changelog (+13/-0)
debian/rules (+3/-0)
debian/samba-common-bin.postinst (+5/-2)
debian/tests/control (+4/-0)
debian/tests/reinstall-samba-common-bin (+11/-0)
Changed in samba (Ubuntu Focal): | |
status: | New → Triaged |
Changed in samba (Ubuntu Groovy): | |
status: | New → Triaged |
Changed in samba (Ubuntu Focal): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
description: | updated |
Changed in samba (Ubuntu Groovy): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
description: | updated |
description: | updated |
Changed in samba (Ubuntu Focal): | |
status: | Triaged → In Progress |
Changed in samba (Ubuntu Groovy): | |
status: | Triaged → In Progress |
Changed in samba (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in samba (Ubuntu): | |
assignee: | Brian Murray (brian-murray) → nobody |
status: | Incomplete → Fix Released |
Changed in samba (Debian): | |
status: | Unknown → Fix Released |
Thanks for the bug report.
Based on your logs, this is the error that's happening:
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
ERROR: lock directory /run/samba does not exist
ERROR: pid directory /run/samba does not exist
Server role: ROLE_STANDALONE
[1mdpkg:[0m erro ao processar o pacote samba-common-bin (--configure):
o subprocesso instalado, do pacote samba-common-bin, o script post-installation retornou erro do status de saída 1
This issue is known and has been reported to the Debian samba package as well:
https:/ /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 975422
Although I wasn't able to reproduce it, the rationale described in the link above makes sense to me, and I can confirm that, on Focal, samba-common- bin.postinst is calling systemd-tmpfiles *after* calling testparm, which is what causes this issue.
Debian's fix is here:
https:/ /salsa. debian. org/samba- team/samba/ -/commit/ 0c3b2056764cd1a 566766c3e1764d7 c312eab5d7
I'm adding this bug to our TODO list, and marking it as Triaged.