NSA325 Samba share not working anymore
Hello,
i have a problem that my samba shares are not working anymore. I am using the zyxel samba replacement packages.
http:///var/log/samba # smbstatus -V
Version 3.6.25
http:///var/log/samba # smbstatus -s /opt/etc/samba/ZyXELSambaReplacement.conf
ERROR: invalid DOS charset: 'dos charset' must not be UTF8, using (default value) ASCII instead.
Can't open sessionid.tdb
It says dos charset must not be UTF8 but in my
/var/log/samba # cat /etc/samba/smb.conf
There is below global UTF8 configured
[global]
workgroup = WORKGROUP
server string = NSA325
netbios name = NSA325
dos charset = UTF8
display charset = UTF8
unix charset = UTF8
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
guest account = pc-guest
map to guest = Bad User
write ok = yes
force create mode = 777
force directory mode = 777
force security mode = 777
force directory security mode = 777
auth methods = guest sam_ignoredomain
max log size = 50
host msdfs = yes
lanman auth = yes
kernel oplocks = no
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=131072 SO_RCVBUF=131072
use mmap = yes
max xmit = 131072
min receivefile size = 128k
unix extensions = no
wide links = Yes
oplocks = yes
level2 oplocks = no
max smbd processes = 128
printing = cups
printcap = /etc/printcap
load printers = yes
use sendfile = yes
passdb backend = smbpasswd
veto files = /.grive*/
So I am wondering what is the problem with my samba shares. I am not sure. We had an power failure last week maybe this lead to a corruption?
Does anyone have an idea how I can fix my shares?
All Replies
-
That is amazing. I wrote that package something like 10 years ago, and as far as I can remember this issue never popped up before. except for 2 weeks ago:
For him reinstalling the SambaReplacement package worked, but actually I have no idea where this suddenly comes from. A power outage can corrupt files, but the SambaReplacement package contains of only 2 files. The start script and /opt/etc/samba/ZyXELSambaReplacement.conf. The latter looks good, and if the first one was corrupted, you'd get a syntax error.
0 -
I just posted the global section.
I just removed the existing file and rebooted. The file was recreated by the system.
The whole file looks like this:
~ # cat /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
server string = NSA325
netbios name = NSA325
dos charset = UTF8
display charset = UTF8
unix charset = UTF8
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
guest account = pc-guest
map to guest = Bad User
write ok = yes
force create mode = 777
force directory mode = 777
force security mode = 777
force directory security mode = 777
auth methods = guest sam_ignoredomain
max log size = 50
host msdfs = yes
lanman auth = yes
kernel oplocks = no
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=131072 SO_RCVBUF=131072
use mmap = yes
max xmit = 131072
min receivefile size = 128k
unix extensions = no
wide links = Yes
oplocks = yes
level2 oplocks = no
max smbd processes = 128
printing = cups
printcap = /etc/printcap
load printers = yes
use sendfile = yes
passdb backend = smbpasswd
veto files = /.grive*/[printers]
path = /i-data/md0/.media/samba
public = yes
guest ok = yes
browseable = yes
writable = no
printable = yes
use client driver = yes[admin]
path = /i-data/md0/admin
valid users = "admin"
follow symlinks = yes
strict allocate = yes
vfs objects = full_audit
full_audit:prefix = %S
full_audit:success = unlink rmdir mkdir rename close
full_audit:failure = none
full_audit:priority = notice[Daten Jasmin]
path = /i-data/93698f22/Daten Jasmin
valid users = nobody "eric"
follow symlinks = yes
strict allocate = yes
; NO Action-log or Recycle-Bin[Brunnebutzer]
path = /i-data/93698f22/BB
valid users = nobody "eric"
follow symlinks = yes
strict allocate = yes
; NO Action-log or Recycle-Bin[Brunnebutzer sync]
path = /i-data/93698f22/BB sync
valid users = nobody "eric"
follow symlinks = yes
strict allocate = yes
; NO Action-log or Recycle-Bin[test]
path = /i-data/93698f22/test
valid users = "eric"
follow symlinks = yes
strict allocate = yes
; NO Action-log or Recycle-Bin[Jasmin]
path = /etc/zyxel/storage/sysvol/.system/autoshare_sata/Jasmin
valid users = "admin"
follow symlinks = yes
strict allocate = yes
; NO Action-log or Recycle-BinWhat looks strange to me is:
valid users = nobody "eric"
The test share I created yesterday to test if a new share is working. There it is only
valid users = "eric"
I then removed the zyxel replacement package and reinstalled it
su
opkg remove zyxel-samba-replacement
opkg update
opkg install zyxel-samba-replacementWhen executing
/opt/etc/init.d/S08samba stop
I get
sh: /opt/etc/init.d/S08samba: Permission deniedso I added the +x and then it worked
~ # /opt/etc/init.d/S08samba stop
~ # chmod a-x /opt/etc/init.d/S08samba
~ # chmod a+x /opt/etc/init.d/S09ZyXELSambaReplacement
~ # /opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.But the share is still not working and
smbstatus -s /opt/etc/samba/ZyXELSambaReplacement.conf
is still giving me the
ERROR: invalid DOS charset: 'dos charset' must not be UTF8, using (default value) ASCII instead.
Can't open sessionid.tdb0 -
But the share is still not working
Is samba running?
ps | grep smb
or maybe
ps -A | grep smb
depending on the invoked ps.
As said I have no idea what causes this, but I'm certainly not a samba specialist. Maybe @django_alexander has an idea?
0 -
It looks like samba is not running
~ # ps | grep smb
~ # ps -A | grep smb
ps: invalid option -- 'A'
BusyBox v1.17.2 (2017-06-21 16:20:33 CST) multi-call binary.
Usage: ps
The log files look like this:
/var/log/samba # cat log.nmbd
[2024/05/15 16:56:35, 0] nmbd/nmbd.c:857(main)
nmbd version 3.5.6 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010
[2024/05/15 16:56:59.567166, 0] nmbd/nmbd_become_lmb.c:395(become_local_master_stage2)
*****
Samba name server NSA325 is now a local master browser for workgroup WORKGROUP on subnet 192.168.3.6
*****
[2024/05/15 17:01:13.871028, 0] nmbd/nmbd.c:71(terminate)
Got SIGTERM: going down...
/var/log/samba #
/var/log/samba #
/var/log/samba # cat log.smbd
[2024/05/15 16:56:34, 0] smbd/server.c:1123(main)
smbd version 3.5.6 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010
0 -
i had to reinstall entware-ng as a whole with many reboots to get back smb1 working and then putting the replacement back in, that's how i fixed it, but this issue seems to pop up more more after some time of running, no idea why
0 -
maybe it could be something related to entware-ng?
0 -
Nothing has changed serverside. ZyXEL hasn't updated the firmware for years, nor is Entware-ng, or my SambaReplacement package. So I suppose (one of) you client has got an update which kills samba.
I suppose it is possible to enable a more extensive logging in smb.conf and/or ZyXELSambaReplacement.conf. Read the samba manual for that. Maybe samba will log why it quits. But when it just crashes, it won't log that, of course.
When samba crashes, it will refuse to start again, because the pid file in /var/lock or something like that is still there, telling samba it's still running. Unfortunately this happens silently.
0 -
could this get fixed by just remaking that file on restart? cuz even with restart it doesn't fix the issue, only when i completely remove entware-ng and reinstall it from ground up
1 -
could this get fixed by just remaking that file on restart?
The file doesn't have to be remaked, it has to be deleted. In Linux it is common practice for a daemon to write a pid file, containing the process id of the daemon. This is used to be able to communicate with the running daemon. '/etc/init.d/samba —reload' reads the pid file to be able send a signal to the daemon, and 'samba —stop' could read it to send a kill signal.
And the starting daemon can see the existing pid file and decide not to continue.
Just by removing the pid file you could start a daemon twice. Or restart it when it crashed without cleaning up the pid file.
I don't know it's name. But I'd expect something like smb<something>.pid in /var/* or /opt/var/*. As a reboot doen't work, it won't be /var/, which is a ramdisk.
0 -
I removed MetaRepository and Entware-ng but now I am not sure how to reinstall it. opkg is not working anymore in my ssh session. And I cannot find any working guide how I can reinstall it.
In my packages list I can only see my already installed packages but no entware-ng0
Categories
- All Categories
- 415 Beta Program
- 2.4K Nebula
- 147 Nebula Ideas
- 96 Nebula Status and Incidents
- 5.7K Security
- 262 USG FLEX H Series
- 271 Security Ideas
- 1.4K Switch
- 74 Switch Ideas
- 1.1K Wireless
- 40 Wireless Ideas
- 6.4K Consumer Product
- 249 Service & License
- 387 News and Release
- 84 Security Advisories
- 29 Education Center
- 10 [Campaign] Zyxel Network Detective
- 3.5K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 85 About Community
- 73 Security Highlight