[SRU] package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: broken permissions/configuration cause daemons not to start correctly

Bug #791944 reported by dallaswv on 2011-06-02
188
This bug affects 21 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Medium
James Page
Lucid
High
James Page
Natty
Undecided
Unassigned
Oneiric
Undecided
Unassigned
Precise
High
James Page
Quantal
Medium
James Page

Bug Description

[Impact]
Currently we receive large numbers of bug reports for samba during upgrades due to broken permissions or misconfiguration of samba.

This is due to how testparm is used in the pre-start script for nmbd - the intent is to determine whether the daemon should be started by querying a specific samba configuration element - however testparm returns a non-zero error code for WARNINGS resulting in a pre-start failure in the init script for trivial configuration issues and broken permissions.

[Test Case]
sudo apt-get install samba
sudo chmod 0777 /var/lib/samba
sudo testparm -s
  - (displays a WARNING about permissions)
  - exit code is non-zero
sudo stop nmbd
sudo start nmbd
  - start: Job failed to start
grep nmbd /var/log/syslog
  - [...] nmbd pre-start process (XXXX) terminated with status 1

[Regression Potential]
Minimal - the fix is limited to a single line in the pre-start block of the nmbd upstart configuration. Any regressions would manifest themselves in this area. Likely problems may include nmbd itself (rather than the upstart pre-start script) not starting correctly due to broken configuration - although this is not technically a regression of course.

[Original Bug Report]
Binary package hint: samba

Happens any time I install or uninstall a program. But does not seem to effect the operation of the programs.

ProblemType: Package
DistroRelease: Ubuntu 11.04
Package: samba 2:3.5.8~dfsg-1ubuntu2.2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic i686
NonfreeKernelModules: nvidia
AptOrdering:
 gdm: Install
 samba: Configure
 gadmin-samba: Configure
 system-config-samba: Configure
 gdm: Configure
Architecture: i386
BothFailedConnect: Yes
Date: Thu Jun 2 11:53:20 2011
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
NmbdLog:

SambaServerRegression: Yes
SmbConfIncluded: Yes
SmbLog:

SourcePackage: samba
Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to natty on 2011-05-01 (31 days ago)

dallaswv (dallas-vinson) wrote :
dallaswv (dallas-vinson) wrote :

This issue is more of an annoyance since it does not seem to effect the programs that I'm installing.

Clint Byrum (clint-fewbar) wrote :

dallaswv, The relevant error is here:

Setting up samba (2:3.5.8~dfsg-1ubuntu2.2) ...
start: Job failed to start
invoke-rc.d: initscript nmbd, action "start" failed.
dpkg: error processing samba (--configure):
 subprocess installed post-installation script returned error exit status 1

This means nmbd is failing to start.

Can you try

sudo start nmbd

and provide the output? Also the output of

sudo grep nmbd /var/log/syslog

Would be helpful. And finally, if you can include /var/log/samba/nmbd.log , we can take a look at it to see why nmbd is failing to start.

Marking Incomplete pending response.

Changed in samba (Ubuntu):
status: New → Incomplete

On 06/03/2011 06:15 PM, Clint Byrum wrote:
> dallaswv, The relevant error is here:
>
> Setting up samba (2:3.5.8~dfsg-1ubuntu2.2) ...
> start: Job failed to start
> invoke-rc.d: initscript nmbd, action "start" failed.
> dpkg: error processing samba (--configure):
> subprocess installed post-installation script returned error exit status 1
>
> This means nmbd is failing to start.
>
> Can you try
>
> sudo start nmbd
>
> and provide the output? Also the output of
lupine@lupys-ubuntu:~$ sudo start nmbd
sudo: /var/lib/sudo writable by non-owner (040775), should be mode 0700
[sudo] password for lupine:
start: Job failed to start
lupine@lupys-ubuntu:~$

>
> sudo grep nmbd /var/log/syslog
lupine@lupys-ubuntu:~$ sudo grep nmbd /var/log/syslog
sudo: /var/lib/sudo writable by non-owner (040775), should be mode 0700
[sudo] password for lupine:
Jun 4 10:40:37 lupys-ubuntu init: nmbd pre-start process (18125)
terminated with status 1
lupine@lupys-ubuntu:~$

>
> Would be helpful. And finally, if you can include
> /var/log/samba/nmbd.log , we can take a look at it to see why nmbd is
> failing to start.
>
lupine@lupys-ubuntu:~$ sudo grep nmbd /var/log/samba/nmbd.log
sudo: /var/lib/sudo writable by non-owner (040775), should be mode 0700
[sudo] password for lupine:
grep: /var/log/samba/nmbd.log: No such file or directory
lupine@lupys-ubuntu:~$

> Marking Incomplete pending response.
>
> ** Changed in: samba (Ubuntu)
> Status: New => Incomplete
>

Clint Byrum (clint-fewbar) wrote :

Hi dallaswv and datanalytics.com. Sorry I got the path to the log wrong the first time. The file to look at is

/var/log/samba/log.nmbd

Please upload the contents of that or at least look through it for clues as to why there was a failure to start nmbd.

That is an empty file.

On Tue, Jun 14, 2011 at 8:29 PM, Clint Byrum <email address hidden> wrote:
> Hi dallaswv and datanalytics.com. Sorry I got the path to the log wrong
> the first time. The file to look at is
>
> /var/log/samba/log.nmbd
>
> Please upload the contents of that or at least look through it for clues
> as to why there was a failure to start nmbd.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/791944
>
> Title:
>  package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
>  subprocess installed post-installation script returned error exit
>  status 1
>
> Status in “samba” package in Ubuntu:
>  Incomplete
>
> Bug description:
>  Binary package hint: samba
>
>  Happens any time I install or uninstall a program. But does not seem
>  to effect the operation of the programs.
>
>  ProblemType: Package
>  DistroRelease: Ubuntu 11.04
>  Package: samba 2:3.5.8~dfsg-1ubuntu2.2
>  ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
>  Uname: Linux 2.6.38-8-generic i686
>  NonfreeKernelModules: nvidia
>  AptOrdering:
>   gdm: Install
>   samba: Configure
>   gadmin-samba: Configure
>   system-config-samba: Configure
>   gdm: Configure
>  Architecture: i386
>  BothFailedConnect: Yes
>  Date: Thu Jun  2 11:53:20 2011
>  ErrorMessage: subprocess installed post-installation script returned error exit status 1
>  InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
>  NmbdLog:
>
>  SambaServerRegression: Yes
>  SmbConfIncluded: Yes
>  SmbLog:
>
>  SourcePackage: samba
>  Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
>  UpgradeStatus: Upgraded to natty on 2011-05-01 (31 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/samba/+bug/791944/+subscriptions
>

--
-Dallas Vinson
-<email address hidden>

I tried to manually start nmbd and I got the following:

carlos@kropotkin:samba$ sudo /etc/init.d/nmbd start
[sudo] password for carlos:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service nmbd start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start nmbd
start: Job failed to start
carlos@kropotkin:samba$ service nmbd start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.53" (uid=1000 pid=5836 comm="start nmbd ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
carlos@kropotkin:samba$ start nmbd
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.54" (uid=1000 pid=5849 comm="start nmbd ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))

Does it help?

Clint Byrum (clint-fewbar) wrote :

Sorry datanalytics.com, it does not. We need to see the contents of /var/log/samba/log.nmbd.

Also the 'start' command and 'service' command need sudo just like the old init.d scripts.

My huge mistake, sorry for making you loose your time. I use to do administrative tasks as root...

Here it goes:

root@kropotkin:~# /etc/init.d/nmbd start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service nmbd start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start nmbd
start: Job failed to start
root@kropotkin:~# service nmbd start
start: Job failed to start
root@kropotkin:~# cat /var/log/samba/log.nmbd
cat: /var/log/samba/log.nmbd: No such file or directory

Excerpts from datanalytics.com's message of Thu Jun 16 21:14:58 UTC 2011:
> My huge mistake, sorry for making you loose your time. I use to do
> administrative tasks as root...
>
> Here it goes:
>
> root@kropotkin:~# /etc/init.d/nmbd start
> Rather than invoking init scripts through /etc/init.d, use the service(8)
> utility, e.g. service nmbd start
>
> Since the script you are attempting to invoke has been converted to an
> Upstart job, you may also use the start(8) utility, e.g. start nmbd
> start: Job failed to start
> root@kropotkin:~# service nmbd start
> start: Job failed to start
> root@kropotkin:~# cat /var/log/samba/log.nmbd
> cat: /var/log/samba/log.nmbd: No such file or directory

Interesting!

Can you show us

dpkg -l samba

and

ls -l /usr/sbin/nmbd

As well?

Also

grep nmbd /var/log/syslog

Thanks!

Here it goes:

root@kropotkin:~# dpkg -l samba
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=======================================-=======================================-==============================================================================================
iF samba 2:3.5.8~dfsg-1ubuntu2.2 SMB/CIFS file, print, and login server for Unix
root@kropotkin:~# ls -l /usr/sbin/nmbd
-rwxr-xr-x 1 root root 3632680 2011-05-09 22:25 /usr/sbin/nmbd
root@kropotkin:~# grep nmbd /var/log/syslog
Jun 16 09:32:28 kropotkin init: nmbd pre-start process (12590) terminated with status 1
Jun 16 23:02:53 kropotkin init: nmbd pre-start process (1309) terminated with status 1
Jun 16 23:02:53 kropotkin init: nmbd pre-start process (1319) terminated with status 1
Jun 16 23:11:38 kropotkin init: nmbd pre-start process (3280) terminated with status 1
Jun 16 23:11:44 kropotkin init: nmbd pre-start process (3288) terminated with status 1

Great, thanks datanalytics.com.

Can you now try running

sudo /usr/sbin/nmbd -d 3

And give us that output?

Thanks! (this is really helping btw, hopefully we can find a bug or help you solve your problem)

Excerpts from datanalytics.com's message of Thu Jun 16 23:58:35 UTC 2011:
> Here it goes:
>
>
> root@kropotkin:~# dpkg -l samba
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name Version Description
> +++-=======================================-=======================================-==============================================================================================
> iF samba 2:3.5.8~dfsg-1ubuntu2.2 SMB/CIFS file, print, and login server for Unix
> root@kropotkin:~# ls -l /usr/sbin/nmbd
> -rwxr-xr-x 1 root root 3632680 2011-05-09 22:25 /usr/sbin/nmbd
> root@kropotkin:~# grep nmbd /var/log/syslog
> Jun 16 09:32:28 kropotkin init: nmbd pre-start process (12590) terminated with status 1
> Jun 16 23:02:53 kropotkin init: nmbd pre-start process (1309) terminated with status 1
> Jun 16 23:02:53 kropotkin init: nmbd pre-start process (1319) terminated with status 1
> Jun 16 23:11:38 kropotkin init: nmbd pre-start process (3280) terminated with status 1
> Jun 16 23:11:44 kropotkin init: nmbd pre-start process (3288) terminated with status 1
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/791944
>
> Title:
> package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
> subprocess installed post-installation script returned error exit
> status 1
>
> Status in “samba” package in Ubuntu:
> Incomplete
>
> Bug description:
> Binary package hint: samba
>
> Happens any time I install or uninstall a program. But does not seem
> to effect the operation of the programs.
>
> ProblemType: Package
> DistroRelease: Ubuntu 11.04
> Package: samba 2:3.5.8~dfsg-1ubuntu2.2
> ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
> Uname: Linux 2.6.38-8-generic i686
> NonfreeKernelModules: nvidia
> AptOrdering:
> gdm: Install
> samba: Configure
> gadmin-samba: Configure
> system-config-samba: Configure
> gdm: Configure
> Architecture: i386
> BothFailedConnect: Yes
> Date: Thu Jun 2 11:53:20 2011
> ErrorMessage: subprocess installed post-installation script returned error exit status 1
> InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
> NmbdLog:
>
> SambaServerRegression: Yes
> SmbConfIncluded: Yes
> SmbLog:
>
> SourcePackage: samba
> Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
> UpgradeStatus: Upgraded to natty on 2011-05-01 (31 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/samba/+bug/791944/+subscriptions

Nothing happens:

carlos@kropotkin:~$ sudo /usr/sbin/nmbd -d 3
carlos@kropotkin:~$ man nmbd

There is no output at all.

No problem helping uncover a possible bug (if it is).

Excerpts from datanalytics.com's message of Fri Jun 17 20:04:32 UTC 2011:
> Nothing happens:
>
> carlos@kropotkin:~$ sudo /usr/sbin/nmbd -d 3
> carlos@kropotkin:~$ man nmbd
>
> There is no output at all.
>
> No problem helping uncover a possible bug (if it is).
>

Heh, ok, one more time

sudo /usr/sbin/nmbd -d 3 -F -S

Thanks again!

I got this:

carlos@kropotkin:datos_econta$ sudo /usr/sbin/nmbd -d 3 -F -S
[sudo] password for carlos:
nmbd version 3.5.8 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
services not loaded
standard input is not a socket, assuming -D option
Becoming a daemon.

Then nothing else (the process does not return control to the console). However,

carlos@kropotkin:datos_econta$ ps -ef | egrep nmbd
root 6609 5986 0 17:48 pts/1 00:00:00 sudo /usr/sbin/nmbd -d 3 -F -S
root 6612 6609 0 17:48 ? 00:00:00 /usr/sbin/nmbd -d 3 -F -S
carlos 6722 6660 0 17:52 pts/3 00:00:00 egrep nmbd

Helpful?

Excerpts from datanalytics.com's message of Sat Jun 18 15:55:02 UTC 2011:
> I got this:
>
>
> carlos@kropotkin:datos_econta$ sudo /usr/sbin/nmbd -d 3 -F -S
> [sudo] password for carlos:
> nmbd version 3.5.8 started.
> Copyright Andrew Tridgell and the Samba Team 1992-2010
> lp_load_ex: refreshing parameters
> Initialising global parameters
> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
> params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
> Processing section "[global]"
> Registered MSG_REQ_POOL_USAGE
> Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
> lp_load_ex: refreshing parameters
> Initialising global parameters
> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
> params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
> Processing section "[global]"
> services not loaded
> standard input is not a socket, assuming -D option
> Becoming a daemon.
>
>
> Then nothing else (the process does not return control to the console). However,
>
>
> carlos@kropotkin:datos_econta$ ps -ef | egrep nmbd
> root 6609 5986 0 17:48 pts/1 00:00:00 sudo /usr/sbin/nmbd -d 3 -F -S
> root 6612 6609 0 17:48 ? 00:00:00 /usr/sbin/nmbd -d 3 -F -S
> carlos 6722 6660 0 17:52 pts/3 00:00:00 egrep nmbd
>
>
> Helpful?

Yes very! This leads me to believe the upstart job is broken:

Can you paste

cat /etc/init/nmbd.conf /etc/init/nmbd.override ?

and

cat /var/lib/dpkg/info/samba.postinst

Thanks once again.

carlos@kropotkin:~$ cat /etc/init/nmbd.conf /etc/init/nmbd.override
description "NetBIOS name server"
author "Steve Langasek <email address hidden>"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

expect fork
respawn

pre-start script
 [ -f /etc/samba/smb.conf ] || { stop; exit 0; }

 install -o root -g root -m 755 -d /var/run/samba
 NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`

 [ "x$NMBD_DISABLED" = xYes ] && { stop; exit 0; }

 exit 0
end script

exec nmbd -D
cat: /etc/init/nmbd.override: No such file or directory

The file samba.postinst is attached to this message (was perhaps too long).

Download full text (3.3 KiB)

Hello,

Did you manage to find out something more about this bug?

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com

2011/6/18 Clint Byrum <email address hidden>:
> Excerpts from datanalytics.com's message of Sat Jun 18 15:55:02 UTC 2011:
>> I got this:
>>
>>
>> carlos@kropotkin:datos_econta$ sudo /usr/sbin/nmbd -d 3 -F -S
>> [sudo] password for carlos:
>> nmbd version 3.5.8 started.
>> Copyright Andrew Tridgell and the Samba Team 1992-2010
>> lp_load_ex: refreshing parameters
>> Initialising global parameters
>> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
>> params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
>> Processing section "[global]"
>> Registered MSG_REQ_POOL_USAGE
>> Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
>> lp_load_ex: refreshing parameters
>> Initialising global parameters
>> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
>> params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
>> Processing section "[global]"
>> services not loaded
>> standard input is not a socket, assuming -D option
>> Becoming a daemon.
>>
>>
>> Then nothing else (the process does not return control to the console). However,
>>
>>
>> carlos@kropotkin:datos_econta$ ps -ef | egrep nmbd
>> root      6609  5986  0 17:48 pts/1    00:00:00 sudo /usr/sbin/nmbd -d 3 -F -S
>> root      6612  6609  0 17:48 ?        00:00:00 /usr/sbin/nmbd -d 3 -F -S
>> carlos    6722  6660  0 17:52 pts/3    00:00:00 egrep nmbd
>>
>>
>> Helpful?
>
> Yes very! This leads me to believe the upstart job is broken:
>
> Can you paste
>
> cat /etc/init/nmbd.conf /etc/init/nmbd.override ?
>
> and
>
> cat /var/lib/dpkg/info/samba.postinst
>
> Thanks once again.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (789548).
> https://bugs.launchpad.net/bugs/791944
>
> Title:
>  package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
>  subprocess installed post-installation script returned error exit
>  status 1
>
> Status in “samba” package in Ubuntu:
>  Incomplete
>
> Bug description:
>  Binary package hint: samba
>
>  Happens any time I install or uninstall a program. But does not seem
>  to effect the operation of the programs.
>
>  ProblemType: Package
>  DistroRelease: Ubuntu 11.04
>  Package: samba 2:3.5.8~dfsg-1ubuntu2.2
>  ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
>  Uname: Linux 2.6.38-8-generic i686
>  NonfreeKernelModules: nvidia
>  AptOrdering:
>   gdm: Install
>   samba: Configure
>   gadmin-samba: Configure
>   system-config-samba: Configure
>   gdm: Configure
>  Architecture: i386
>  BothFailedConnect: Yes
>  Date: Thu Jun  2 11:53:20 2011
>  ErrorMessage: subprocess installed post-installation script returned error exit status 1
>  InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
>  NmbdLog:
>
>  SambaServerRegression: Yes
>  SmbConfIncluded: Yes
>  SmbLog:
>
>  SourcePackage: samba
>  Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
>  UpgradeStatus: Upgraded to n...

Read more...

I have the same problem and this is what I found.
testparm does not exist on my box and that is why it is failing.

I removed the check just to get my own box going. This is NOT the proper fix.

pre-start script
 [ -f /etc/samba/smb.conf ] || { stop; exit 0; }

 install -o root -g root -m 755 -d /var/run/samba

- NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
+ NMBD_DISABLED="NO"

 [ "x$NMBD_DISABLED" = xYes ] && { stop; exit 0; }

 exit 0
end script

exec nmbd -D

James Page (james-page) wrote :

Carlos/Peter

Please could you run the following commands on your systems and attach the output to this bug report:

  update-alternatives --display testparm
  ls -l /usr/bin/testparm

It may be that the links to support this command have not been setup correctly during install/upgrade.

Thanks

Peter Chiu (pc8888) wrote :

Probably testparm is bundled in the common-bin and I've never install it.

root@apex:~# update-alternatives --display testparm
update-alternatives: error: no alternatives for testparm.
root@apex:~# ls -l /usr/bin/testparm
ls: cannot access /usr/bin/testparm: No such file or directory
root@apex:~# find / -name testparm
root@apex:~# testparm
The program 'testparm' can be found in the following packages:
 * samba-common-bin
 * samba4-common-bin
Try: apt-get install <selected package>

James Page (james-page) wrote :

Peter

samba-common-bin is a dependency for samba so should be installed automatically.

It would appear that the alternates have not been installed correctly during the upgrade; please could you run the following commands and attach output to this bug report:

   apt-cache policy samba-common-bin
   ls -l /usr/bin/testparm*

Thanks

James Page (james-page) wrote :

Carlos

I think that your issue might be different to Peters as your are getting a exit status code of 1 (which would indicate that testparm is runing but returning non-zero exit code); please could you try running:

  sudo testparm
  echo $?

Please post the output to this bug report.

Thanks

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
WARNING: state directory /var/lib/samba should have permissions 0755 for
browsing to work
WARNING: cache directory /var/cache/samba should have permissions 0755 for
browsing to work
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
$?
[global]
workgroup = AVAL
 server string = %h server (Samba, Ubuntu)
map to guest = Bad User
obey pam restrictions = Yes
 pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:*
%n\n *password\supdated\ssuccessfully* .
 unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
 max log size = 1000
dns proxy = No
usershare allow guests = Yes
 panic action = /usr/share/samba/panic-action %d

[printers]
comment = All Printers
 path = /var/spool/samba
create mask = 0700
printable = Yes
 browseable = No

[print$]
comment = Printer Drivers
 path = /var/lib/samba/printers

2011/7/6 James Page <email address hidden>

> Carlos
>
> I think that your issue might be different to Peters as your are getting
> a exit status code of 1 (which would indicate that testparm is runing
> but returning non-zero exit code); please could you try running:
>
> sudo testparm
> echo $?
>
> Please post the output to this bug report.
>
> Thanks
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (782203).
> https://bugs.launchpad.net/bugs/791944
>
> Title:
> package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
> subprocess installed post-installation script returned error exit
> status 1
>
> Status in “samba” package in Ubuntu:
> Incomplete
>
> Bug description:
> Binary package hint: samba
>
> Happens any time I install or uninstall a program. But does not seem
> to effect the operation of the programs.
>
> ProblemType: Package
> DistroRelease: Ubuntu 11.04
> Package: samba 2:3.5.8~dfsg-1ubuntu2.2
> ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
> Uname: Linux 2.6.38-8-generic i686
> NonfreeKernelModules: nvidia
> AptOrdering:
> gdm: Install
> samba: Configure
> gadmin-samba: Configure
> system-config-samba: Configure
> gdm: Configure
> Architecture: i386
> BothFailedConnect: Yes
> Date: Thu Jun 2 11:53:20 2011
> ErrorMessage: subprocess installed post-installation script returned error
> exit status 1
> InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
> NmbdLog:
>
> SambaServerRegression: Yes
> SmbConfIncluded: Yes
> SmbLog:
>
> SourcePackage: samba
> Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
> subprocess installed post-installation script returned error exit status 1
> UpgradeStatus: Upgraded to natty on 2011-05-01 (31 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/samba/+bug/791944/+subscriptions
>

--
Atenciosamente, Eduardo Monteiro
twitter.com/ducrz

James Page (james-page) wrote :

On Wed, 2011-07-06 at 11:41 +0000, EduardoMonteiro wrote:
> WARNING: state directory /var/lib/samba should have permissions 0755
> for
> browsing to work
> WARNING: cache directory /var/cache/samba should have permissions 0755
> for
> browsing to work

This might be pointing at the issue - please could you confirm the
permissions on /var/lib/samba and /var/cache/samba by running the
following commands:

  sudo ls -l /var/lib
  sudo ls -l /var/cache

Please post the output on this bug report

Thanks

--
James Page
Ubuntu Server Developer

EduardoMonteiro (ducatolico) wrote :
Download full text (9.1 KiB)

sudo ls -l /var/lib
total 300
drwxrwxrwx 2 root root 4096 2010-04-23 09:51 acpi-support
drwxrwxrwx 2 root root 4096 2010-09-13 07:58 alsa
drwxrwxrwx 6 root root 4096 2011-06-28 15:47 apt
drwxrwxrwx 2 root root 4096 2011-06-28 15:47 aptitude
drwxrwxrwx 2 root root 4096 2011-07-04 08:10
apt-xapian-index
drwxrwxrwx 2 avahi-autoipd avahi-autoipd 4096 2010-04-29 09:26
avahi-autoipd
drwxrwxrwx 2 root root 4096 2011-06-10 12:47 belocs
drwxrwxrwx 2 root root 4096 2011-06-20 15:56 binfmts
drwxrwxrwx 2 root root 4096 2010-04-29 09:27
computer-janitor
drwxrwxrwx 2 root root 4096 2010-09-13 07:14 dbus
drwxrwxrwx 9 root root 4096 2011-04-28 17:27 defoma
drwxr-xr-x 2 root root 4096 2011-04-28 15:20 dhcp
drwxrwxrwx 2 root root 4096 2010-09-13 08:34 dhcp3
drwxrwxrwx 3 root root 4096 2011-04-11 09:54
dictionaries-common
drwxrwxrwx 5 root root 4096 2010-04-29 09:22 doc-base
drwxrwxrwx 7 root root 4096 2011-07-06 11:06 dpkg
drwxrwxrwx 2 root root 4096 2010-12-22 11:49
emacsen-common
drwxrwxrwx 2 root root 4096 2010-08-11 10:21
flashplugin-installer
drwxrwxrwx 5 root root 4096 2010-04-29 09:20 gconf
drwxr-x--- 12 gdm gdm 4096 2011-06-22 18:04 gdm
drwxrwxrwx 4 root root 4096 2010-10-05 14:25 ghostscript
drwxrwxrwx 2 root root 4096 2011-04-28 14:19 hp
drwxrwxrwx 2 root root 4096 2011-06-06 16:13
initramfs-tools
drwxrwxrwx 2 root root 4096 2010-03-30 04:17 initscripts
drwxrwxrwx 2 root root 4096 2010-03-30 04:17 insserv
drwxrwxrwx 2 root root 4096 2011-02-21 15:27 iptotal
drwxrwxrwx 2 root root 4096 2011-04-28 15:52 iptraf
drwxrwxrwx 4 root root 4096 2011-04-11 09:56 libreoffice
drwxrwsr-x 2 libuuid libuuid 4096 2010-04-29 09:18 libuuid
drwxrwxrwx 3 root root 4096 2010-04-29 09:21
libxml-sax-perl
drwxr-xr-x 3 root root 4096 2011-04-28 15:13 lintian
drwxrwxrwx 3 root root 4096 2010-04-29 09:18 locales
drwxrwxrwx 2 root root 4096 2011-07-06 08:05 logrotate
drwxrwxrwx 2 root root 4096 2010-10-05 14:36 misc
drwxrwxrwx 2 root root 4096 2011-07-06 08:06 mlocate
drwxrwxrwx 2 root root 4096 2011-04-28 14:47
msttcorefonts
drwx------ 7 mysql mysql 4096 2011-07-06 08:00 mysql
drwxrwxrwx 2 root root 4096 2011-07-06 14:55
NetworkManager
drwxr-xr-x 4 root root 4096 2011-06-28 15:47 nikto
drwxrwxrwx 2 root root 4096 2010-04-08 21:28 ntpdate
drwxrwxrwx 4 root root 4096 2010-12-22 11:40 ocaml
drwxrwxrwx 2 root root 4096 2011-02-23 12:03 os-prober
drwxrwxrwx 2 root root 4096 2010-10-05 15:02 PackageKit
drw...

Read more...

oracle@apex:~$ apt-cache policy samba-common-bin
samba-common-bin:
  Installed: 2:3.5.4~dfsg-1ubuntu8.2
  Candidate: 2:3.5.4~dfsg-1ubuntu8.4
  Version table:
     2:3.5.4~dfsg-1ubuntu8.4 0
        500 http://ca.archive.ubuntu.com/ubuntu/ maverick-updates/main i386 Packages
     2:3.5.4~dfsg-1ubuntu8.3 0
        500 http://security.ubuntu.com/ubuntu/ maverick-security/main i386 Packages
 *** 2:3.5.4~dfsg-1ubuntu8.2 0
        100 /var/lib/dpkg/status
     2:3.5.4~dfsg-1ubuntu8 0
        500 http://ca.archive.ubuntu.com/ubuntu/ maverick/main i386 Packages
oracle@apex:~$ ls -l /usr/bin/testparm*
-rwxr-xr-x 1 root root 1350156 2011-01-07 04:32 /usr/bin/testparm.samba3
oracle@apex:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"

FYI, I use "apt-get install samba" to install samba in the first place.

root@pc-03:~# apt-cache policy samba-common-bin
samba-common-bin:
  Instalado: 2:3.5.8~dfsg-1ubuntu2.2
  Candidato: 2:3.5.8~dfsg-1ubuntu2.2
  Tabela de versão:
 *** 2:3.5.8~dfsg-1ubuntu2.2 0
        500 http://br.archive.ubuntu.com/ubuntu/ natty-updates/main i386
Packages
        100 /var/lib/dpkg/status
     2:3.5.8~dfsg-1ubuntu2 0
        500 http://br.archive.ubuntu.com/ubuntu/ natty/main i386 Packages
root@pc-03:~# ls -l /usr/bin/testparm*
lrwxrwxrwx 1 root root 26 2011-04-28 14:56 /usr/bin/testparm ->
/etc/alternatives/testparm
-rwxr-xr-x 1 root root 1354284 2011-05-09 17:26 /usr/bin/testparm.samba3
root@pc-03:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

It would appear that if the directories /var/lib/samba or /var/cache/samba have anything other that 0755 permissions nmbd will fail to start as the testparm call in /etc/init/nmbd.conf returns a non-zero error code (1).

It would be good to get confirmation that this is the issue (I have reproduced artificially but looking at the number of duplicates against this bug report that should not be a problem).

Hello,

I changed permissions of dirs /var/lib/samba and /var/cache/samba to 0755 as indicated and the problem went away!

Thanks!

James Page (james-page) wrote :

Looking at this bug report and all of the duplicates all of the reports are coming from systems with -generic kernels; i.e. Desktops not Servers.

Something is opening up the permissions on this directory (and others looking at comment #15) which is creating this issue.

James Page (james-page) wrote :

So the workaround for the moment is to run the following commands in a terminal:

  sudo chmod 0755 /var/lib/samba /var/cache/samba
  sudo apt-get -f install

This should fixup the permissions and complete the installation of samba.

James Page (james-page) on 2011-07-07
Changed in samba (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Medium

Thank you James. Problem solved here!

2011/7/7 James Page <email address hidden>

> So the workaround for the moment is to run the following commands in a
> terminal:
>
> sudo chmod 0755 /var/lib/samba /var/cache/samba
> sudo apt-get -f install
>
> This should fixup the permissions and complete the installation of
> samba.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (782203).
> https://bugs.launchpad.net/bugs/791944
>
> Title:
> package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
> subprocess installed post-installation script returned error exit
> status 1
>
> Status in “samba” package in Ubuntu:
> Incomplete
>
> Bug description:
> Binary package hint: samba
>
> Happens any time I install or uninstall a program. But does not seem
> to effect the operation of the programs.
>
> ProblemType: Package
> DistroRelease: Ubuntu 11.04
> Package: samba 2:3.5.8~dfsg-1ubuntu2.2
> ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
> Uname: Linux 2.6.38-8-generic i686
> NonfreeKernelModules: nvidia
> AptOrdering:
> gdm: Install
> samba: Configure
> gadmin-samba: Configure
> system-config-samba: Configure
> gdm: Configure
> Architecture: i386
> BothFailedConnect: Yes
> Date: Thu Jun 2 11:53:20 2011
> ErrorMessage: subprocess installed post-installation script returned error
> exit status 1
> InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
> NmbdLog:
>
> SambaServerRegression: Yes
> SmbConfIncluded: Yes
> SmbLog:
>
> SourcePackage: samba
> Title: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
> subprocess installed post-installation script returned error exit status 1
> UpgradeStatus: Upgraded to natty on 2011-05-01 (31 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/samba/+bug/791944/+subscriptions
>

--
Atenciosamente, Eduardo Monteiro
twitter.com/ducrz

Hi James and every body,

Thank you for this solution, the problem have been solved.

Have a good day.

Totem

James Page (james-page) on 2012-05-02
summary: - package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1
+ package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: broken
+ permissions cause daemons not to start correctly

I think this bug warrants some attention as I just triage a load more from 12.04.

I would propose changing the upstart configuration of nmbd:

 NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`

The return code of testparm is non-zero even for warnings which causes the upstart job to fail - the configuration is only really interested in the value of 'disable netbios' so we should just ignore the return code and start nmbd anyway.

Thoughts?

Excerpts from James Page's message of 2012-05-24 13:56:30 UTC:
> I think this bug warrants some attention as I just triage a load more
> from 12.04.
>
> I would propose changing the upstart configuration of nmbd:
>
> NMBD_DISABLED=`testparm -s --parameter-name='disable netbios'
> 2>/dev/null || true`
>
> The return code of testparm is non-zero even for warnings which causes
> the upstart job to fail - the configuration is only really interested in
> the value of 'disable netbios' so we should just ignore the return code
> and start nmbd anyway.
>
> Thoughts?

Agreed James. That sounds like a good solution to the issue. Make it so!

James Page (james-page) on 2012-05-30
Changed in samba (Ubuntu Quantal):
assignee: nobody → James Page (james-page)

This bug was fixed in the package samba - 2:3.6.5-3ubuntu2

---------------
samba (2:3.6.5-3ubuntu2) quantal; urgency=low

  * d/samba.nmbd.upstart: Ignore the return code of testparm in pre-start;
    it's used to query the configuration NOT to validate it in this context
    which generates alot of bug reports for unrelated configuration issues
    (LP: #791944).
 -- James Page <email address hidden> Wed, 30 May 2012 21:52:39 +0100

Changed in samba (Ubuntu Quantal):
status: Confirmed → Fix Released
James Page (james-page) on 2012-06-07
Changed in samba (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
assignee: nobody → James Page (james-page)
importance: Undecided → High
James Page (james-page) on 2012-06-08
summary: package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: broken
- permissions cause daemons not to start correctly
+ permissions/configuration cause daemons not to start correctly
Changed in samba (Ubuntu Precise):
status: New → In Progress
description: updated
James Page (james-page) on 2012-06-08
description: updated
James Page (james-page) on 2012-06-08
description: updated

Fix uploaded to precise-proposed for SRU team review.

Changed in samba (Ubuntu Lucid):
status: New → In Progress
assignee: nobody → James Page (james-page)
importance: Undecided → High
summary: - package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade: broken
- permissions/configuration cause daemons not to start correctly
+ [SRU] package samba 2:3.5.8~dfsg-1ubuntu2.2 failed to install/upgrade:
+ broken permissions/configuration cause daemons not to start correctly
James Page (james-page) wrote :

Fix uploaded to lucid-proposed for SRU team review

Hello dallaswv, or anyone else affected,

Accepted samba into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in samba (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Sebastien Bacher (seb128) wrote :

The error is indeed fixed with the proposed version, setting as verification-done.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.6.3-2ubuntu2.3

---------------
samba (2:3.6.3-2ubuntu2.3) precise-proposed; urgency=low

  * d/samba.nmbd.upstart: Ignore the return code of testparm in pre-start;
    it's used to query the configuration NOT to validate it in this context
    which generates alot of bug reports for unrelated configuration issues
    (LP: #791944).
 -- James Page <email address hidden> Fri, 08 Jun 2012 14:31:57 +0100

Changed in samba (Ubuntu Precise):
status: Fix Committed → Fix Released
GROSSMANN (gerard-grossmann) wrote :

merci pour vos efforts afin de nous simplifier la vie dans l utilisation de nos PC
salutations

Chris Halse Rogers (raof) wrote :

Grrr. The lucid-proposed upload has a bunch of unnecessary diff in the .po files. It's all no-impact, though - ordering changes in the headers, and slightly different word-wrap in some strings.

Changed in samba (Ubuntu Lucid):
status: In Progress → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Chris Halse Rogers (raof) wrote :

Hello dallaswv, or anyone else affected,

Accepted samba into lucid-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/samba/2:3.4.7~dfsg-1ubuntu3.11 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

The fix for the this bug has been awaiting testing feedback in the -proposed repository for lucid for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now the package will be removed from the -proposed repository.

Launchpad Janitor (janitor) wrote :

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

Changed in samba (Ubuntu Natty):
status: New → Confirmed
Changed in samba (Ubuntu Oneiric):
status: New → Confirmed
Bequia Ubuntu (jose.b) wrote :

I followed the test cases, nothing failed, so fix verified? how to tag as verefied?

Brian Murray (brian-murray) wrote :

Bequia Ubuntu - you followed the test using Ubuntu 10.04 (Lucid) and package version 2:3.4.7~dfsg-1ubuntu3.11 from the -proposed repository?

Bequia Ubuntu (jose.b) wrote :

Opps! sorry, that was a silly mistake. i'm running quantal

Brian Murray (brian-murray) wrote :

The version of samba in lucid-proposed has been removed as this bug report was not verified in a timely fashion.

Changed in samba (Ubuntu Lucid):
status: Fix Committed → Triaged
James Page (james-page) on 2013-02-25
Changed in samba (Ubuntu Lucid):
status: Triaged → Won't Fix
dino99 (9d9) wrote :
Changed in samba (Ubuntu Oneiric):
status: Confirmed → Invalid
Changed in samba (Ubuntu Natty):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers