[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.
mes
Beiträge: 4
Registriert: Sa 21. Sep 2019, 11:14

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

Beitrag von mes »

Mijzelf hat geschrieben:
mes hat geschrieben: @Mijzelf: Any idea?
Not directly. It should have worked. In the webinterface you should be able to find the log of the initial install. Can you post that?
Well, as soon as you do it the correct way - it works! :-)

My fault was that I was always trying the comands with "su" (as stated in the HowTo), alternatively with user "admin" in the ssh. The way to success was finally to login with user "root"

Thank You for this How To - may be you can update it with the "root" user info - just in case another Linux newbie like me comes around :-)

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

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

Beitrag von Mijzelf »

mes hat geschrieben: My fault was that I was always trying the comands with "su" (as stated in the HowTo), alternatively with user "admin" in the ssh. The way to success was finally to login with user "root"
Really? That's new to me. Can you login as admin and post the output of

Code: Alles auswählen

echo $PATH
su
echo $PATH
and repeat that when logging in a root?

mes
Beiträge: 4
Registriert: Sa 21. Sep 2019, 11:14

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

Beitrag von mes »

Mijzelf hat geschrieben:
mes hat geschrieben: My fault was that I was always trying the comands with "su" (as stated in the HowTo), alternatively with user "admin" in the ssh. The way to success was finally to login with user "root"
Really? That's new to me. Can you login as admin and post the output of

Code: Alles auswählen

echo $PATH
su
echo $PATH
and repeat that when logging in a root?
Ok, just tried the echo $PATH command as ADMIN and as ROOT user - the output is the same

Code: Alles auswählen

/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/zyxel/sbin:/usr/local/zy-pkgs/bin:/zyxel/htp
Afterwards I've tried the opkg command with both users - ADMIN and ROOT. And it works with both users. It seems that there was something wrong in my config before I did the factory reset on the NSA. Or it also might be that the problem was sitting infront of the PC :-)

Anyway - thank You very much for your support, your fix works very well. I can access my NSA325 v2 with my upadated WIN10 (SMB1 deactivated by last update). Good work, thanks.

freeztyler
Beiträge: 1
Registriert: Mo 30. Dez 2019, 12:36

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

Beitrag von freeztyler »

Hallo Ihr lieben, ich habe die Installation wie beschrieben durchgeführt.
Wie kann ich nun testen bzw sehen ob es auch wirklich funktioniert hat?
Denn wenn ich windows10 das smb1 deaktiviere, sehe ich den Server (NSA 325 V2) nicht mehr.
Oder muss ich nach der Installation alle Freigaben neu erstellen?

Gruß

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 »

Hello! Please excuse me for the English, hope I will be able to get an answer here.
I have followed the installation instructions, the samba replacement successfully installed and worked for 20 days until first hard reboot (was replacing the power supply and unplugged the NSA)

After the reboot samba replacement does not start at all.

Starting the samba

Code: Alles auswählen

/opt/etc/init.d/S09ZyXELSambaReplacement start
does not return any result and smbd doesn't start

However stopping returns the following

Code: Alles auswählen

/opt/etc/init.d/S09ZyXELSambaReplacement stop
sh: can't kill pid 4144: No such process
sh: can't kill pid 4155: No such process
Starting Samba daemons: nmbd smbd.
And old samba starts successfully.

I tried to uninstall/reinstall the package with all possible --force attributes but no luck.

Could you please advise what am I doing wrong?
Thank you in advance!

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 »

Hello!

First of all, thank you Mijzself for a great tool.
I have installed it as per the instructions above and it worked fine until first hard reset (pulled the plug off on my NSA325v2 during surge protector replacement)

After the reboot new samba is not starting.

Code: Alles auswählen

/opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.
no smbd/nmbd daemons running after that

Code: Alles auswählen

/opt/etc/init.d/S09ZyXELSambaReplacement stop
sh: can't kill pid 4144: No such process
sh: can't kill pid 4155: No such process
Starting Samba daemons: nmbd smbd.
And then old smbd/nmbd daemons starting and work fine.

Tried to delete and reinstall packages with all possible forced flags (reinstall, overwrite) with no luck:
"zyxel-samba-replacement" and
"samba36-server - 3.6.25-9"

Can you please advise what can be wrong with starting new samba?

Thank you!

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

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

Beitrag von Mijzelf »

I suppose something is damaged due to that power failure. Maybe 'debugging' that script tells what:

Code: Alles auswählen

sh -x /opt/etc/init.d/S09ZyXELSambaReplacement start

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 »

I've noticed that smbd and nmbd in /opt/sbin/ have the size of 15 bytes and are probably symlinks

Here is the debug of three commands:

Code: Alles auswählen

sh -x /opt/etc/init.d/S09ZyXELSambaReplacement start
+ prgmname1=/opt/sbin/nmbd
+ prgmname2=/opt/sbin/smbd
+ configfile=/opt/etc/samba/ZyXELSambaReplacement.conf
+ nmbdpid=/opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid
+ smbdpid=/opt/var/run/smbd-ZyXELSambaReplacement.conf.pid
+ basename /opt/etc/init.d/S09ZyXELSambaReplacement
+ [ S09ZyXELSambaReplacement = samba.sh ]
+ startreplacement
+ [ -f /etc/init.d/samba.replaced.sh ]
+ sh /etc/init.d/samba.sh stop
Stopping Samba daemons: nmbd smbd.
+ mv /etc/init.d/samba.sh /etc/init.d/samba.replaced.sh
+ basename /opt/etc/init.d/S09ZyXELSambaReplacement
+ ln -s /opt/etc/init.d/S09ZyXELSambaReplacement /etc/init.d/samba.sh
+ [ -f /var/run/smbd.pid ]
+ ln -s /opt/var/run/smbd-ZyXELSambaReplacement.conf.pid /var/run/smbd.pid
+ [ -f /var/run/nmbd.pid ]
+ ln -s /opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid /var/run/nmbd.pid
+ [ ! -h /opt/var/lock ]
+ sh /etc/init.d/samba.sh start
+ exit

Code: Alles auswählen

sh -x /etc/init.d/samba.sh start
+ prgmname1=/opt/sbin/nmbd
+ prgmname2=/opt/sbin/smbd
+ configfile=/opt/etc/samba/ZyXELSambaReplacement.conf
+ nmbdpid=/opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid
+ smbdpid=/opt/var/run/smbd-ZyXELSambaReplacement.conf.pid
+ basename /etc/init.d/samba.sh
+ [ samba.sh = samba.sh ]
+ start
+ /opt/sbin/nmbd -D -s /opt/etc/samba/ZyXELSambaReplacement.conf
+ logger -t nmbd started /opt/sbin/nmbd, conf: /opt/etc/samba/ZyXELSambaReplacement.conf
+ /opt/sbin/smbd -D -s /opt/etc/samba/ZyXELSambaReplacement.conf
+ logger -t smbd started /opt/sbin/smbd, conf: /opt/etc/samba/ZyXELSambaReplacement.conf
+ return 0
+ exit

Code: Alles auswählen

sh -x /opt/etc/init.d/S09ZyXELSambaReplacement stop
+ prgmname1=/opt/sbin/nmbd
+ prgmname2=/opt/sbin/smbd
+ configfile=/opt/etc/samba/ZyXELSambaReplacement.conf
+ nmbdpid=/opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid
+ smbdpid=/opt/var/run/smbd-ZyXELSambaReplacement.conf.pid
+ basename /opt/etc/init.d/S09ZyXELSambaReplacement
+ [ S09ZyXELSambaReplacement = samba.sh ]
+ stopreplacement
+ [ -f /etc/init.d/samba.replaced.sh ]
+ sh /etc/init.d/samba.sh stop
sh: can't kill pid 4144: No such process
sh: can't kill pid 4155: No such process
+ rm /etc/init.d/samba.sh
+ mv /etc/init.d/samba.replaced.sh /etc/init.d/samba.sh
+ [ -h /var/run/smbd.pid ]
+ rm /var/run/smbd.pid
+ [ -h /var/run/nmbd.pid ]
+ rm /var/run/nmbd.pid
+ sh /etc/init.d/samba.sh start
Starting Samba daemons: nmbd smbd.
+ exit

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

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

Beitrag von Mijzelf »

I've noticed that smbd and nmbd in /opt/sbin/ have the size of 15 bytes and are probably symlinks
Yes, that's true. Both are a symlink to samba_multicall.

Looking at the listings it seems everything is running as it should. Conclusion, nmdb and smdb start as they should, but after daemonizing they fail. As you reinstalled both samba-server and samba-replacement, that can't be the problem. So it should be something in Entware-ng itself.

The installscript creates the directories (/opt/) usr bin etc/init.d lib/opkg sbin share tmp var/lock and var/run. Do they all exist?

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: The installscript creates the directories (/opt/) usr bin etc/init.d lib/opkg sbin share tmp var/lock and var/run. Do they all exist?
Yes, everything is in its place:

Code: Alles auswählen

admin@NSA325-v2:~$ ls /opt/
bin    etc    lib    sbin   share  tmp    usr    var

admin@NSA325-v2:~$ ls /opt/etc/init.d/
S08samba                  S99ProfileHook            rc.unslung             S09ZyXELSambaReplacement  rc.func

admin@NSA325-v2:~$ ls /opt/var/
lock        log         nmbd        opkg-lists  run

Antworten