[HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Projektleiter: Mijzelf

Eine Art FFP 2.0 mit neuen Möglichkeiten und besserem Paket-Managment.

Detaillierte Beschreibung im ersten Thread.
Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Mijzelf »

Then everything should work. Are the shares available when you use stock samba? and/or is /etc/samba/smb.conf valid?

Code: Alles auswählen

less /etc/samba/smb.conf
Does it define your shares?

Are smbd and nmbd indeed not running when the replacement is started?

Code: Alles auswählen

ps | grep mdb

loverman310
Beiträge: 7
Registriert: Mi 22. Jan 2020, 02:44

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von loverman310 »

Mijzelf hat geschrieben:Are the shares available when you use stock samba?
Yes, it runs fine (samba 1, of course, as it is accessible only with smb1 client enabled)
All shares are accessible
Mijzelf hat geschrieben:Are smbd and nmbd indeed not running when the replacement is started?
Yep, the command output is empty (Though you've mistyped the process name in the code, I've fixed that. And command shows processes for the stock samba).

Any ideas on how to reinstall everything from scratch?

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Mijzelf »

Any ideas on how to reinstall everything from scratch?
Assuming you have installed the Entware-ng zypkg, you should just uninstall the package, reboot, and reinstall. But to be sure nothing remains I would

Code: Alles auswählen

su
cd /opt/
pwd # make sure you are inside the /opt/ directory
rm -rf *
and then uninstall the package.

loverman310
Beiträge: 7
Registriert: Mi 22. Jan 2020, 02:44

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von loverman310 »

Thank you!

Unfortunately now opkg is not installing:

Code: Alles auswählen

Opened logfile at Fri Jan 31 20:05:53 CST 2020
Flushing memory buffer
    Starting up
Flushing done
[20:05:53] Create symlink /opt -> /usr/local/zy-pkgs/opt
[20:05:53] /opt/etc/init.d/rc.unslung is not available, start installer
[20:05:53]     Info: Opkg package manager deployment...
[20:05:53]     --20:05:53--  http://pkg.entware.net/binaries/armv5/installer/opkg
[20:05:53]     => `/opt/bin/opkg'
[20:05:53]     Resolving pkg.entware.net... 104.27.176.50, 104.27.177.50
[20:05:53]     Connecting to pkg.entware.net[104.27.176.50]:80... connected.
[20:05:54]     HTTP request sent, awaiting response... 200 OK
[20:05:54]     Length: 127,636 [application/octet-stream]
[20:05:54]     
[20:05:54]     0K .......... .......... .......... .......... .......... 40%  187.56 KB/s
[20:05:54]     50K .......... .......... .......... .......... .......... 80%  712.35 KB/s
[20:05:54]     100K .......... .......... ....                            100%  661.46 KB/s
[20:05:54]     
[20:05:54]     20:05:54 (333.25 KB/s) - `/opt/bin/opkg' saved [127636/127636]
[20:05:54]     
[20:05:54]     --20:05:54--  http://pkg.entware.net/binaries/armv5/installer/opkg.conf
[20:05:54]     => `/opt/etc/opkg.conf'
[20:05:54]     Resolving pkg.entware.net... 104.27.177.50, 104.27.176.50
[20:05:54]     Connecting to pkg.entware.net[104.27.177.50]:80... connected.
[20:05:54]     HTTP request sent, awaiting response... 200 OK
[20:05:54]     Length: 142 [application/octet-stream]
[20:05:54]     
[20:05:54]     0K                                                       100%    5.53 KB/s
[20:05:54]     
[20:05:54]     20:05:54 (5.53 KB/s) - `/opt/etc/opkg.conf' saved [142/142]
[20:05:54]     
[20:05:54]     --20:05:54--  http://pkg.entware.net/binaries/armv5/installer/libgcc_s.so.1
[20:05:54]     => `/opt/lib/libgcc_s.so.1'
[20:05:54]     Resolving pkg.entware.net... 104.27.176.50, 104.27.177.50
[20:05:54]     Connecting to pkg.entware.net[104.27.176.50]:80... connected.
[20:05:55]     HTTP request sent, awaiting response... 200 OK
[20:05:55]     Length: 55,220 [application/octet-stream]
[20:05:55]     
[20:05:55]     0K .......... .......... .......... .......... .......... 92%  161.61 KB/s
[20:05:55]     50K ...                                                   100%   38.34 MB/s
[20:05:55]     
[20:05:55]     20:05:55 (174.30 KB/s) - `/opt/lib/libgcc_s.so.1' saved [55220/55220]
[20:05:55]     
[20:05:55]     --20:05:55--  http://downloads.zyxel.nas-central.org/Users/Entware-ng/binaries/armv5/installer/ld-2.22.so-2.6.24
[20:05:55]     => `/opt/lib/ld-2.22.so'
[20:05:55]     Resolving downloads.zyxel.nas-central.org... 23.141.224.195
[20:05:58]     Connecting to downloads.zyxel.nas-central.org[23.141.224.195]:80... failed: No route to host.
[20:05:58]     Retrying.
[20:05:58]     
[20:05:58]     --20:05:58--  http://downloads.zyxel.nas-central.org/Users/Entware-ng/binaries/armv5/installer/ld-2.22.so-2.6.24
[20:05:58]     (try: 2) => `/opt/lib/ld-2.22.so'
[20:06:01]     Connecting to downloads.zyxel.nas-central.org[23.141.224.195]:80... failed: No route to host.
[20:06:01]     Retrying.
....
[20:08:00]     --20:08:00--  http://downloads.zyxel.nas-central.org/Users/Entware-ng/binaries/armv5/installer/libc-2.22.so-2.6.24
[20:08:00]     (try:20) => `/opt/lib/libc-2.22.so'
[20:08:03]     Connecting to downloads.zyxel.nas-central.org[23.141.224.195]:80... failed: No route to host.
[20:08:03]     Giving up.
[20:08:03]     
[20:08:03]     Info: Basic packages installation...
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/bin/opkg: Input/output error
[20:08:03]     /opt/usr/lib/locale/locale-archive: No such file or directory
[20:08:03]     Info: Congratulations!
[20:08:03]     Info: If there are no errors above then Entware-ng was successfully initialized.
[20:08:03]     Info: Found a Bug? Please report at https://github.com/Entware-ng/Entware-ng/issues
[20:08:03] Execute /opt/etc/init.d/rc.unslung start
[20:08:03]     /usr/local/zy-pkgs/etc/init.d/Entware-ng: line 596: /opt/etc/init.d/rc.unslung: not found
[20:08:03] Done /opt/etc/init.d/rc.unslung start
Closed logfile at Fri Jan 31 20:08:03 CST 2020
Feels like repo has old links to nas-central.org.
Last time it was the same but after 100 retries, cleaning up everything it finally installed.

Could you please advise shortcut as I don't really know what worked last time? :-)

Thank you!

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Mijzelf »

Hm. That's a design bug in MetaRepository, I'm afraid.

When nas-central.org went down, and @shv offered this new repository space, I adapted MetaRepository to be 'mirror-aware'. That means that when a package is downloaded, MetaRepository writes it's url in a known place (/tmp/) so that the postinstall script in the package can use that info to exchange some hardcoded url's in the package.
There are a few packages which need to know where they came from, so that they can download extra resources, if needed. Entware-ng is one of them.

Problem is that it only works when MR is involved. In your case you are re-installing, and the internal package manager just reuses the cached zypkg file. But now the url isn't there anymore.

The remedy is simple. Uninstall Entware-ng once again, then delete the zypkg file in \\<NAS>\admin\zy-pkgs\, and reinstall, forcing the internal package manager to download again.

loverman310
Beiträge: 7
Registriert: Mi 22. Jan 2020, 02:44

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von loverman310 »

So it worked!

I've reinstalled everything from scratch, installed samba, tried to reproduce the issue - and... It happened again!

But this time I was able to troubleshoot and find the reason.
The hint was in the /opt/var/log/log.nmbd and /opt/var/log/log.smbd files:

Code: Alles auswählen

[2020/02/01 13:36:21,  0] (pidfile_create)
  ERROR: can't open /opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid: Error was File exists

Code: Alles auswählen

[2020/02/01 13:36:21.050787,  0] (pidfile_create)
  ERROR: can't open /opt/var/run/smbd-ZyXELSambaReplacement.conf.pid: Error was File exists
I've deleted both smbd- and nmbd-ZyXELSambaReplacement.conf.pid from /opt/var/run/, restarted the service and viola - it works again!

So the root cause was - hard reset of the box leaves two ...conf.pid files in the /opt/var/run/ which prevents daemons to start next time.
So the fix is just to manually delete those two files and restart the service.

Thank you for all your help!

Happy|Harry
Beiträge: 3
Registriert: Sa 21. Mär 2020, 22:29

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Happy|Harry »

Hi There, i followed the instructions to upgrade samba on my NSA320 and after doing so i can no longer login to smb shares or the http front end, i tried removing the smb upgrade and this didn't help, i also then used the /sbin/account.sh to reset the password and i then get in, but when i then change the admin or local admin enabled user account i then get locked out again, it is af if something in the samba password/account storage is broken, any idea how to fix this without a full reset?

thanks in advance

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Mijzelf »

The webinterface and samba both use the samba password database, which is stored in /etc/samba/smbpasswd, or something like that. As far as I know the samba server which is exechanged by this script only reads that file, and the webinterface (weblogin.cgi, to be exact) doesn't use any code from the Entware-ng samba implementation.

So I don't see how this can happen.

Long shot, did you also enable my patch for CVE-2020-9054? In that case some special characters are filtered out, which can block your web login. But not the samba login.

Happy|Harry
Beiträge: 3
Registriert: Sa 21. Mär 2020, 22:29

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von Happy|Harry »

God i feel such a fool!, i completely forgot i had enabled the 0day patch before i upgraded samba and that was indeed the issue :oops: thanks for taking the time to point out my error, and of course the work you have done and still do for this community!

while i have your attention, i am looking to upgrade from my NSA320 to a newer 4bay model, do you have any recommendations for something that is still compatible with entware etc?

Benutzeravatar
shv
Beiträge: 69
Registriert: Sa 10. Nov 2018, 17:36

Re: [HOWTO] Install samba 3.6.25 on a ZyXEL fw4 nas

Beitrag von shv »

Happy|Harry hat geschrieben:
So 22. Mär 2020, 20:17
while i have your attention, i am looking to upgrade from my NSA320 to a newer 4bay model, do you have any recommendations for something that is still compatible with entware etc?
I think all fw5 devices will fit to your requirements (e.g. NAS540/NAS542).

Antworten