General NAS-Central Forums

Welcome to the NAS community
It is currently Thu Dec 14, 2017 4:33 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 07, 2017 4:17 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Install
Install Entware-ng the normal way, as zypkg or as self-containing USB stick, doesn't matter.

Then open a root shell, and execute
Code:
opkg update
opkg install zyxel-samba-replacement
chmod a-x /opt/etc/init.d/S08samba
/opt/etc/init.d/S09ZyXELSambaReplacement start


That's it.

How it works
The package zyxel-samba-replacement is dependent on samba36-server, which is automatically installed either (if it wasn't installed yet).

The startscript
  • Stops the firmware samba by executing '/etc/init.d/samba.sh stop'
  • Replaces the firmware script /etc/init.d/samba.sh by a script which starts Entware-ng samba, with /opt/etc/samba/ZyXELSambaReplacement.conf as configuration file.
  • Starts the Entware-ng samba daemon by executing '/etc/init.d/samba.sh start'
  • Creates a symlink /var/run/smbs.pid and -/nmbd.pid, which points to the pid files of the new samba daemon, so the the firmware knows where to sent it's HUP signal when the configuration changes.

The configuration file /opt/etc/samba/ZyXELSambaReplacement.conf only contains
Code:
[Global]
max protocol = SMB2

include = /etc/samba/smb.conf
'max protocol = SMB2' enables the SMB2 protocol (the very reason you want this, I guess), and it includes the firmware config file, which is dynamically generated.
Of course you can add your own configuration lines, if you want.

Reverting
Basically
Code:
/opt/etc/init.d/S09ZyXELSambaReplacement stop
chmod a-x /opt/etc/init.d/S09ZyXELSambaReplacement
will stop the daemon, start firmware samba, and disable the startscript, so it won't startup on reboot.

But of course uninstalling Entware-ng will do the job either.

Firmware 5+
Although the script runs fine on firmware 5+, I didn't add it to the armv7 repository. Firmware 5+ already runs samba 4.1.7, so installing 3.6.25 would be a downgrade.


Top
 Profile  
 
PostPosted: Tue Nov 07, 2017 4:35 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2314
You are reading my minds. I am planning to do the same for ffp after finishing toolchain update.
This topic is worth to be sticky.


Top
 Profile  
 
PostPosted: Wed Nov 08, 2017 7:03 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
barmalej2 wrote:
You are reading my minds.
I'm sorry. You are thinking so loud, I couldn't help it.
Quote:
I am planning to do the same for ffp
Good plan. For FFP a new samba is available, I guess?


Top
 Profile  
 
PostPosted: Sun Dec 10, 2017 12:51 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 605
Hi,

First of all, thanks for all your hard work Mijzelf. Much appreciated. :)

However, there are a little typo in the tutorial. The SambaReplacement start command should be the following:

Code:
/opt/etc/init.d/S09ZyXELSambaReplacement start


Otherwise it throws a not found error logically, because there is no ZyXELSambaReplacement file.

And one more thing. On start it gives me this:

Code:
Stopping Samba daemons: nmbd smbd.
mv: cannot stat '/opt/var/lock/*': No such file or directory


And there is a small mistype in the start script itself. Because it says starting on stop and stopping on start.

Code:
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement stop
Starting Samba daemons: nmbd smbd.
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.


Anyways, it works well. Many thanks. :)

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Sun Dec 10, 2017 1:39 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
MrDini wrote:
However, there are a little typo in the tutorial. The SambaReplacement start command should be the following:

Code:
/opt/etc/init.d/S09ZyXELSambaReplacement start
Thanks. Changed it.
Quote:
And there is a small mistype in the start script itself. Because it says starting on stop and stopping on start.

Code:
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement stop
Starting Samba daemons: nmbd smbd.
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.
If you disable SambaReplacement, the script starts the firmware samba, and vice versa. That's what you see here.
Quote:
And one more thing. On start it gives me this:

Code:
mv: cannot stat '/opt/var/lock/*': No such file or directory
That's a one-timer. On start it removes /opt/var/lock/, and creates a symlink to /var/lock instead (which is in initrd, a ramdrive). That is permanent. But before it does so, it first move the content of /opt/var/lock/ to /var/lock. In your case /opt/var/lock/ happened to be empty. That's all.
(BTW, I am aware that it's not safe to move the contents of /opt/var/lock/ to another filesystem. If could break a lock. But it's only one time, and I couldn't find an easy safe way.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 76 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group