Jump to content

SMB msg.sock permissions keep changing and breaking Samba


Go to solution Solved by JorgeB,

Recommended Posts

For months now my ability to access Unraid shares from Windows seems to break randomly with the dreaded 0x80070035 error. Recently while trying to get it working again, I tried to run smbstatus on the CLI, and received the message:

 

root@unraid:~# smbstatus
invalid permissions on directory '/var/lib/samba/private/msg.sock': has 0755 should be 0700
Unable to initialize messaging context!

 

I did chmod -R 0700 /var/lib/samba/private/msg.sock - immediately smbstatus worked again and my Windows clients were able to access every share without issue. No reboots or fiddling with 'net use' necessary - it immediately worked.

 

The system continued to work fine for a few days, until I rebooted following an OS upgrade to 6.11.1 and the same situation occurred with the permissions needing reset. 

 

I'm happy that I can restore access immediately by changing the permissions back, but I'd like to get to the bottom of why. I guess either something periodic, on boot, or on samba startup that causes this - but I've no idea what. I have seen one other post that hints that tdarr might have some influence, but I've never used or installed that.

 

Has anyone any ideas please? The issue spans multiple Unraid versions from pre-6.9 thro' 6.11.

 

Cheers (diagnostics attached)

unraid-diagnostics-20221007-2239.zip

Link to comment
  • Solution

This is a strange one, please check if the permissions are correct after a reboot, if not stop all dockers/VMs and boot in safe mode, if now they are correct start enabling everything to try and find the culprit, if they are correct at boot again see if you can find if they go wrong after using some docker/VM, etc.

Link to comment

Thanks both for the hints, looks like I've found the culprit in some hacky SW TPM scripts I had been playing with to get Windows 11 VMs running some time ago. It wasn't actually the plugins themselves, but a sneaky line in a User Scripts set to run on array start, which included 'chmod 0755 -R /var/lib'!

 

Steps tried today:

- Disable docker and VMs, reboot and check permissions - OK on initial boot, permissions broken when array is started.
- Additionally delete NerdPack (didn't realise it was deprecated) - same result, permissions broken when array is started. 
- Additionally delete SWTPM hacks in /boot/extras as I'm not playing with Win 11 VM any more - same result, fine until array is started.
- Started wondering exactly what happens when the 'start' button is pressed, then remembered the User Scripts plugin has schedule options including array start.... checked my scripts and realised that the SW TPM script was doing nasty stuff.

 

Thanks for the nudge in the right direction, that'll teach me to keep hacks that are no longer needed (esp since latest release has TPM support built in...) on my 'production' box! 

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...