General NAS-Central Forums

Welcome to the NAS community
It is currently Thu Aug 17, 2017 1:34 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Wed Mar 01, 2017 2:01 am 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,

I have a NSA325-v2 and I installed the Tweaks package to modify the administrator home directory to /i-data/md0/admin

Then I modified the ownership of /i-data/md0/admin and its subdirectory .ssh to admin and modifed the access rights with read-only access go-w to the admin home and also modified access to its subdirectory .ssh to 700

Then I de-installed Tweaks.

The restart or shutdown GUI button stopped working. When trying to click on the "Yes" button, the GUI does not re-act at all, nothing happens.

Also after re-installing Tweaks, Tweaks stopped working too.
I get "Internal Server Error" when starting the Tweak web link.

Any idea what can be the problems?

Thanks in advance.


Top
 Profile  
 
PostPosted: Wed Mar 01, 2017 4:28 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
Quote:
Then I de-installed Tweaks.
Did you reboot after that? Tweaks can patch some firmware scripts, and sometimes it will point to a Tweaks script.

Normally the patch is undone when you stop/disable Tweaks (I don't guarantee that's true for all patches), but I have seen in the past that a package is not (always?) stopped before uninstalling, which means that after deinstalling some firmware scripts may fail because the Tweaks scripts are gone.

A reboot resolves that, because all patched files are volatile.

Having said that, I wouldn't know which Tweak could block the GUI shutdown.

Quote:
I get "Internal Server Error" when starting the Tweak web link.
Again, did you reboot? The Tweaks webinterface is a CGI script. You get an 'Internal Server Error' when the CGI script errors out, which can be the case when parts of the 'old' Tweaks are still running.


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 9:54 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Thanks for your answer.
I re-installed all the package and now it works, I am back to initial state.

But actually, what I am trying to do is to have the NSA325 to be backed up on another NAS (ReadyNAS).
To do that I need to scp without login from the ReadyNAS to the NSA325, but this does not seem to work.
When I try to login from ReadyNAS to NSA325 without password the NSA325 seems to reject the connection.

I modified the sshd_config file to save the log to a file on the NSA325. First it rejected the connection because the admin account is owned by root and has og+w has chmod access, which seems to be forbidden by SSH.
But after fixing this problem, the sshd log did not seem to complain anymore but the from the ReadyNAS, the connection was still rejected.

So I started the SSH daemon as debug mode, and that's where I ran into the problem described above (which was to be expected since the SSH daemon could not fork anymore...).

So now I don't know how to keep on debugging and get more info/logs...

/BR


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 11:44 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
I solved the problem, it was a missconfiguration in authorized_keys file.

Everytime the NSA325 is rebooted or when a new package is installed, it seems that /i-data/md0/admin is reset to ownership and access rights:
drwxrwxrwx 7 root root 4096 Jan 30 15:23 /i-data/md0/admin/
(I am using Tweaks).

Is there a way to make sure that the admin directory is not re-chown:ed or re-chmod:ed?

Thanks
BR


Top
 Profile  
 
PostPosted: Tue Mar 07, 2017 8:52 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
Not that I'm aware of. Of course you can run a script to recover the damage, but the most straight forward way is to use Tweaks to give admin a different homedirectory, one which is outside the share-pool, so the firmware will leave it alone.


Top
 Profile  
 
PostPosted: Sat Apr 22, 2017 6:09 am 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,

I have tried to change the admin home directory with Tweaks to:
/usr/local/zy-pkgs/home/admin
but it did not accept it. I tried even other location such as /i-data/md0/admin2 and it did not work either.
It looks like Tweaks can only change it to /i-data/md0/admin.

Do you know how to solve this?

Thanks
BR


Top
 Profile  
 
PostPosted: Sat Apr 22, 2017 11:29 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
In /usr/local/zy-pkgs/gui/Tweaks/pkgcgi.cgi, on line 118 you'll find
Code:
      sed -i "s/${1} =.*/${1} = ${2}/" $tmp
Change that in
Code:
      sed -i "s|${1} =.*|${1} = ${2}|" $tmp

Background: this line is used to change settings in /usr/local/zy-pkgs/etc/tweaks.conf. ${1} is the name of the setting, ${2} its value. This arguments are expanded to their contents, before the commandline is passed to sed. Because the delimiter in the command is a forward slash, the command line gets invalid when a path containing forward slashes is provided, and sed fails.
With this change the delimiter is a pipe, which means you can't provide a pipe anymore in some editboxes in the Tweaks gui.

Another option is to manually edit /usr/local/zy-pkgs/etc/tweaks.conf (you need to be root for that), and dis- and enable Tweaks. (Or reboot the box)


Top
 Profile  
 
PostPosted: Mon Apr 24, 2017 10:03 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,

thanks a lot for your help. it worked.
But then Pulse stopped working. It might be unrelated to the change of the admin directory.

It fails to upgrade to v0.14.26. It does not return any error. (I have v0.12.4)
When I try to add a new folder in Pulse it returns an error: "Syncthing seems to be experiencing a problem processing your request. Please refresh the page or restart Syncthing if the problem persists."
Same error when trying to add back the remote Device. Note that the remote device did succeed in upgrading to v0.14.26

Thanks again
/BR


Top
 Profile  
 
PostPosted: Mon Apr 24, 2017 11:55 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,
I forgot to mention that the error name is "Connection error".

As I understand 0.14.26 is not compatible with 0.12.4, so that would explain the problem, but why can't I add new folders on the NSA325? I should not need to connect to a device for that.

/BR


Top
 Profile  
 
PostPosted: Tue Apr 25, 2017 12:44 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
I don't think your Pulse problem is directly related to the change of the admin home.

In the Pulse startscript (/usr/local/zy-pkgs/etc/init.d/Pulse) the Pulse workdirectory (PKG_HOME @164) is hardcoded to /i-data/md0/admin/Pulse, and Pulse is running as admin (PKG_USER @166).

Maybe the changes in ownership and access flags you performed to /i-data/md0/admin are keeping Pulse from accessing that directory?


Top
 Profile  
 
PostPosted: Tue Apr 25, 2017 7:11 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,

I have removed the Tweak pkg, re-install Pulse and I still get problem.
I don't understand because Pulse, always worked fine. I removed it and re-installed a few times without any problems.
Also strange: when I run the cmd: "ps" I don't see any syncthing process event though I just click on the link.

How would you start debugging?

Sorry, one more thing: is the syncthing package compiled specifically for NSA325-v2?
Or is there a pre-compiled version that can be used directly from syncthing repo to upgrade the NSA325?


Thanks
BR


Top
 Profile  
 
PostPosted: Tue Apr 25, 2017 10:16 pm 
Offline

Joined: Wed Mar 01, 2017 1:48 am
Posts: 9
Hi,

it seems to be related to the browser because from another computer (with other browser) I could create a Folder.
But it is quite unstable. It does not seem to work every time and I have to wait quite a lot for the Pulse web page to show up.
So, on my usual computer, neither Microsoft Edge or Chrome works, don't know why exactly...
Strangely, it seems that logging stabilizes somewhat the situation: I added -logfile=$PKGHOME/somefilename -audit in the Pulse script and now it works sometimes. How can it be?
And how could it become so unstable. When I first installed Pulse, there was no problem...

I still would like to know if it is possible to upgrade the syncthing version on the NSA325-v2 with the automatic procedure or is it a specifically compiled version. If not which binary should I take?

Thanks
B/


Top
 Profile  
 
PostPosted: Wed Apr 26, 2017 9:08 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
The Pulse version shipped with the zypkg is just the Arm version as provided by Syncthing. That is a statically linked version, and so it runs on all Armv5+ platforms.

Quote:
Strangely, it seems that logging stabilizes somewhat the situation: I added -logfile=$PKGHOME/somefilename -audit in the Pulse script and now it works sometimes. How can it be?
Don't know. Although Syncthing is open-source, I never looked at it, as the provided binary "just works". I got a request for a Pulse package, and I could easily wrap the provided binary in a zypkg. That's it.

Quote:
I still would like to know if it is possible to upgrade the syncthing version on the NSA325-v2 with the automatic procedure
Don't know. Don't even know if Syncthing has that option. If it has, it's possible that it can't update itself because it's running as admin, and the owner of the binary is root. But I guess you can just extract syncthing from the Arm tarball and put it next to pulse, and change the startscript to call syncthing instead.


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

All times are UTC


Who is online

Users browsing this forum: silax and 63 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:  
Powered by phpBB® Forum Software © phpBB Group