Samba Daemon crash after update {resolved}

Questions about software.
JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update

Postby JSladek » 02 Oct 2017 20:37

I might have it working now. I tried a number of commands to unlock /var/log/samba - most of them didn't work. However, while in /var/log, I invoked "sudo chown -R root samba". At that point, it did not appear that samba was installed - somewhere along the line, the purge of samba worked - it was the purge of samba-common that was the issue. Anyway, I reinstalled samba and at the moment, I have all services functioning.

I also, rem'd out all of the tmpfs in fstab except for /tmp and /var/tmp and at least the log data will be available until I set up bleachbit to clear the log after it's gone to compressed archive.

I am not going to close this posting for a few days yet - I'm going to see first if it's really fixed.

BTW - the gnome errors that I see every once in a while .... I am wondering if it is because I removed firefox-solydxk-adjustments when I removed firefox. The error still occasionally shows on installs even after installing gnome-themes-standard.

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update

Postby ilu » 03 Oct 2017 05:36

How exactly did you manage to delete /var/log/samba? Did you, maybe, change the tmpfs stuff in fstab first?

I'm beginning to suspect that maybe you weren't able to delete that directory because it is explicitly mounted with tmpfs in fstab.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update

Postby JSladek » 03 Oct 2017 11:21

I couldn't delete the directory because it was locked. Because of that any attempts to reinstall samba would fail. I tried a number of online suggestions to unlock the folder, but the one that I found to work was to reset the ownership of the folder with "sudo chown -R root samba" (while in /var/log). After that I reinstalled samba without any error.

I didn't change fstab until after that, so it wasn't the mounting of /var/log/samba in tmpfs that was the problem.

Checks with systemctl status show haveged, nmbd & smbd all good - samba & samba- ad-dc are both masked and inactive, but I suspect that would be normal if those explicit services aren't activated. I don't have samba per se set up because I have no Win files to access. I am anxiously awaiting another set of updates to see if they run without error.

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update

Postby ilu » 07 Oct 2017 22:20

After todays big update my son said he saw an error message in the updater but could not read it that quickly ...
Luckiliy I redirected the log files onto the HDD so here it is:

Code: Select all

Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Job for nmbd.service failed because a timeout was exceeded.
See "systemctl status nmbd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nmbd, action "start" failed.
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Sat 2017-10-07 23:36:35 CEST; 6ms ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 23921
   Status: "nmbd: No local IPv4 non-loopback interfaces available, waiting for interface ..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/nmbd.service

Okt 07 23:35:05  nmbd[23920]:   Unknown parameter encountered: "pass…vel"
Okt 07 23:35:05  nmbd[23920]: [2017/10/07 23:35:05.485182,  0] ../li…ter)
Okt 07 23:35:05  systemd[1]: nmbd.service: Supervising process 23921…its.
Okt 07 23:35:05  nmbd[23921]: [2017/10/07 23:35:05.487292,  0] ../li…tus)
Okt 07 23:35:05  nmbd[23921]:   STATUS=daemon 'nmbd' : No local IPv4…v6).
Okt 07 23:36:35  systemd[1]: nmbd.service: Start operation timed out…ing.
Okt 07 23:36:35  systemd[1]: nmbd.service: Killing process 23921 (nm…ILL.
Okt 07 23:36:35  systemd[1]: Failed to start Samba NMB Daemon.
Okt 07 23:36:35  systemd[1]: nmbd.service: Unit entered failed state.
Okt 07 23:36:35  systemd[1]: nmbd.service: Failed with result 'timeout'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: Fehler beim Bearbeiten des Paketes samba (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
bind9-host (1:9.10.3.dfsg.P4-12.3+deb9u3) wird eingerichtet ...
host (1:9.10.3.dfsg.P4-12.3+deb9u3) wird eingerichtet ...
dnsutils (1:9.10.3.dfsg.P4-12.3+deb9u3) wird eingerichtet ...
Trigger für libc-bin (2.24-11+deb9u1) werden verarbeitet ...
Trigger für initramfs-tools (0.130) werden verarbeitet ...
update-initramfs: Generating /boot/initrd.img-4.12.0-0.bpo.2-amd64
...
Trigger für systemd (232-25+deb9u1) werden verarbeitet ...
Fehler traten auf beim Bearbeiten von:
 samba
Log ended: 2017-10-07  23:36:45

Don't I love it ...

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update - now on another machine too

Postby JSladek » 08 Oct 2017 01:22

And it looks like mine has stabilized. Haveged, smbd and nmbd services are all running, samba.service is shut down, but probably because I don't have a need for it to be active. I was looking at dpkg.log after the 125 files installed and everything that I looked at had a line for "half-configured" and then followed by a line for "installed". Most of the files appeared to be simply a reinstall - which, I believe, is one way to get rid of the "half-configured" and "half-installed". I have a notion that debian did this update to get rid of those problems that were probably being reported.

All of the checks that I have done looking for bad indicators of installs failed to show any. I am not certain, but it may have been a dpkg problem all the way along giving those indications. I also picked up some more checks along the way.

Code: Select all


sudo egrep '^Status: |^Package: ' /var/lib/dpkg/status | egrep -B 1 'half-installed|half-configured|unpacked|triggers-awaited|triggers-pending'

This one checks the status file that lists the status of all installed files examining and listing all packages that are NOT listed as installed.

sudo deborphan --guess-all

This one will list POSSIBLE orphaned packages.  I think it always generates a fairly long list because many packages may appear to be orphaned, but aren't.  I thought it was an interesting command to run.  The deborphan package does have a lot of flexibility to it.

sudo dpkg-query -f '${status} ${package} \n' -W| awk '$3 == "half-configured" {print $4}'

I was playing with this one again and the "half-configured" can be changed to "half-installed" or "installed" - whatever you choose to look for.



I just checked the /var/log/samba/cores and it still shown two items in the subdirectory (smbd & nmdb) as it should. I just went back and did: sudo chmod 755 /var/lib/samba/private/msg.sock As I was writing this, the sub-directory could not be opened (chmod was 700) and now it has some 80 items listed in msg.sock.

In your situation, you might try simply a purge and reinstall of samba and samba-common. As I recall, when I did that more recently, I ran it out of Synaptic and all of the associated packages were picked up and reinstalled.

I'm still holding this posting open to see if I will get a "clean" installation with no "half-anything" reported. I can't tell for certain with a report involving 125 packages. <G>

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update - now on another machine too

Postby ilu » 08 Oct 2017 02:20

I'm more interested why samba fails this way. There is something wrong with the conf. Both our systems were more or less fresh, samba wasn't used at all. So the wrong conf must have originated from the ISO and thats not good. I'm too tired to check today.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update - now on another machine too

Postby JSladek » 08 Oct 2017 11:23

I'm more interested why samba fails this way. There is something wrong with the conf.


I agree,but where. I also wonder why msg.sock changes it's permissions and if that is what is effecting the samba installations. I found very few references to the problem online and nearly all were were nearly ten years ago. I did find the "half-....." files in dpkg.log after the installation, but it had already incorporated a significant number of updates. So I don't know if the problem originated at the update point or was there from the beginning. It's also quite strange that yours just appeared out of nowhere. I just checked my system and smbd & nmbd failed to start again this morning.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update - now on another machine too

Postby JSladek » 08 Oct 2017 13:18

Now this one I really don't understand.

Code: Select all

sudo chmod 755 /var/lib/samba/private/msg.sock


Kurotsugi suggested a while back that 755 should be the correct permissions which makes sense to me. BUT when I set it to 755, the daemon.log after bootup says that the permissions should be 700 and nmdb.service, etcetera fail. At 700, even root level does not allow access to msg.sock which it should, but the SERVICES ARE ACTIVE after bootup.

Try that on yours and see if that makes a difference. I'll test it after I get back from the gym this morning on a system I have installed on a separate partition and see if it makes a difference on installing packages.

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update - now on another machine too

Postby ilu » 08 Oct 2017 15:46

Since about a week I'm seeing users I sure didn't create. Could you please check on your machine for users with ids bigger than 1000? Annonymize where necessary.

Code: Select all

cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
... and a lot of other system users which are of no interest here ...
xxx:xxx:1000:1000:xxx,,,:/home/xxx:/bin/bash
xxx:xxx:1001:1001:xxx,,,,:/home/xxx:/bin/bash
smbguest:x:1002:1002:Samba guest account:/dev/null:/dev/null


How did this samba guest account get there? I sure never configured anything for samba use. Is there any way I can check when exactly this user got created?

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update - now on another machine too

Postby JSladek » 08 Oct 2017 17:19

I don't have any above 1000.

Code: Select all

sudo cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
----- bunch of entries ----
xxx:x:1000:1000:xxx,,,:/home/xxx:/bin/bash


As far as finding a creation date, I couln't find any log of any sort, though I suspect there may be.

In kusers, click on your user of interest and a popup comes up with user info - click on password management and you will get the date/time of the last pasword change. That might work - the date may then be the user creation date.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update - now on another machine too

Postby JSladek » 08 Oct 2017 18:16

Maybe a search for the 1001 or 1002 user in /var/log/messages?

BTW - I ran the three update packages today and while they each had a line of "half-installed" and/or "half-configured", the last line for each package was "installed". Maybe that part is fixed?

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update - now on another machine too

Postby ilu » 09 Oct 2017 00:34

Something completely destroyed the smb.conf during the update run yesterday (so immediately before debian9.2) which prodused the first samba errors.

Code: Select all

$ ls -al /etc/samba/
drwxr-xr-x   3 root root  4096 Okt  8 14:37 .
drwxr-xr-x 158 root root 12288 Okt  8 15:45 ..
-rw-r--r--   1 root root     8 Nov 12  2011 gdbcommands
-rw-r--r--   1 root root  3661 Okt  8 14:37 smb.conf
-rw-r--r--   1 root root 12354 Sep 30 19:11 smb.conf.old.gadmin-samba-0.2.9
-rw-r--r--   1 root root  9231 Okt  7 23:34 smb.conf.ucf-dist
-rw-r--r--   1 root root    91 Sep 30 19:11 smbusers
drwxr-xr-x   2 root root  4096 Nov 11  2013 tls

From this it seems that somewhere before Sep 30 gadmin-samba was run, probably by mistake. I'm really sure the user didn't do anything there but maybe just opening gadmin-samba configures default server services? In that case a warning would be appropriate. Anyway, samba server was configured on Sep 30 and a samba guest user introduced.

Code: Select all

cat /var/log/samba/samba.log
...
[2017/10/08 21:28:44.485577,  0] ../lib/param/loadparm.c:772(lpcfg_map_parameter)
  Unknown parameter encountered: "password level"
[2017/10/08 21:28:44.485614,  0] ../lib/param/loadparm.c:1717(lpcfg_do_global_parameter)
  Ignoring unknown parameter "password level"
[2017/10/08 21:28:44.485752,  0] ../lib/param/loadparm.c:772(lpcfg_map_parameter)
  Unknown parameter encountered: "update encrypted"
[2017/10/08 21:28:44.485764,  0] ../lib/param/loadparm.c:1717(lpcfg_do_global_parameter)
  Ignoring unknown parameter "update encrypted"
[2017/10/08 21:28:44.487477,  0] ../lib/util/become_daemon.c:135(daemon_status)
  STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).

I fixed the "No local IPv4 non-loopback interfaces available" message by entering the right network mask in gadmin-samba. The defaults are way off.
Both unknown parameters were set in smb.conf by gadmin-samba (since nobody else touched this). From https://askubuntu.com/questions/630290/ignoring-unknown-parameter : "The reason for the error is the gadmin-samba. If you installed the gadmin-samba. It is advisable to purge gadmin-samba and manually remove the files related to gadmin." I can't find any other mention of gadmin-samba bugs but I can see that the parameter "password level" was already deprecated in 2012, so gadmin-samba really shouldn't include it.

After this I did a "dpkg --configure -a" which ... :o worked.

So, in this case, starting up gadmin-samba even once to just look at its options caused the system to fail because this triggers a samba server ! configuration with invalid parameters. :evil: I won't bother with getting rid of the server conf because this system will be reinstalled anyway.
But gadmin can't have been the reason for your problem since you are using KDE. So we still don't know.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update

Postby JSladek » 09 Oct 2017 11:31

Glad to see that you found the problem in your system. Apparently, you have other users on your system and anything can happen - most often quite innocently.

Still don't know the source of my problems. I will always wonder if it came in one of the early updates done as a part of the installation process - especially with the update that came out a few days ago reinstalling a large number of the packages. I am still puzzled about the permissions on msg.sock, but even messages during the reinstallation of the files "insisted" that the permissions be set at 700. So far, it seems to be working.

When I boot up in the morning now, the first thing I do is check Systemd Manager and verify that all services are running. I will probably do that also before I run any package updates. Maybe a little paranoid, but I have to gain some confidence in the possibility that the system may be fixed.

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update

Postby JSladek » 10 Oct 2017 13:37

At this point, I am going to have to call this issue resolved. So far, the services have been running as they should and no errors have been occuring with recent updates (I do have a gtk message that according to debian is a gtk2 issue that is of little consequence). To this day I have no idea what caused all of the problems, though, as I mentioned before, I suspect that last week's reinstall of many files was to correct those problems. Permissions on msg.sock is still somewhat of a mystery, though 700 seems to be the working permission for that file.

Thanks to ILU for staying in there with me on this problem. Learned a lot from you while chasing this thing around.

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Samba Daemon crash after update {resolved}

Postby ilu » 10 Oct 2017 23:17

I've learned a lot as well. Whatever triggered the problem we'll probably never know, but trying to purge samba made things worse. I've reread your old posts and the terminal output and this should have warned me about it:

Code: Select all

dpkg: warning: while removing samba-common, unable to remove directory '/var/log/samba': Device or resource busy - directory may be a mount point?

We can't purge samba from our systems because it is indeed a mount point (for tmpfs).
Come to think of it: Didn't your troubles start with "deleted/reinstalled the pdf printer"? Also /var/log/cups is a mount point ...

Well, since we both fixed the /var/log problem, now we can purge away. :D

JSladek
Posts: 132
Joined: 19 Jun 2014 23:15
Location: Suffolk VA

Re: Samba Daemon crash after update {resolved}

Postby JSladek » 11 Oct 2017 21:35

We can't purge samba from our systems because it is indeed a mount point (for tmpfs).

I'm not so sure that was the case. I believe part of the error message was referring to it as a locked directory and I used:

Code: Select all

sudo chown -R root /var/log/samba

After that, the install of samba went fine.
Come to think of it: Didn't your troubles start with "deleted/reinstalled the pdf printer"? Also /var/log/cups is a mount point ...

Yes, they seemed to have started there, but as I found when I was digging around, the "half-configured" & "half-installed" issue had already been lurking in the logs. Well, the mount point should no longer be any issue for all but the tmp files. I have also reinstated my weekly cleaning of "rotated-logs" with bleachbit where the compressed older files are deleted from the system. So far, I'm comfortable enough to do that.


Return to “Software”

Who is online

Users browsing this forum: Google [Bot] and 2 guests