Restart from GUI not working

Marvell Kirkwood based
Post Reply
bBb
Posts: 9
Joined: Wed Mar 01, 2017 1:48 am

Restart from GUI not working

Post by bBb » Wed Mar 01, 2017 2:01 am

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.

Mijzelf
Posts: 6206
Joined: Mon Jun 16, 2008 10:45 am

Re: Restart from GUI not working

Post by Mijzelf » Wed Mar 01, 2017 4:28 pm

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.
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.

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

Re: Restart from GUI not working

Post by bBb » Mon Mar 06, 2017 9:54 pm

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

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

Re: Restart from GUI not working

Post by bBb » Mon Mar 06, 2017 11:44 pm

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

Mijzelf
Posts: 6206
Joined: Mon Jun 16, 2008 10:45 am

Re: Restart from GUI not working

Post by Mijzelf » Tue Mar 07, 2017 8:52 am

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.

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

Re: Restart from GUI not working

Post by bBb » Sat Apr 22, 2017 6:09 am

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

Mijzelf
Posts: 6206
Joined: Mon Jun 16, 2008 10:45 am

Re: Restart from GUI not working

Post by Mijzelf » Sat Apr 22, 2017 11:29 am

In /usr/local/zy-pkgs/gui/Tweaks/pkgcgi.cgi, on line 118 you'll find

Code: Select all

		sed -i "s/${1} =.*/${1} = ${2}/" $tmp
Change that in

Code: Select all

		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)

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

Re: Restart from GUI not working

Post by bBb » Mon Apr 24, 2017 10:03 pm

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

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

Re: Restart from GUI not working

Post by bBb » Mon Apr 24, 2017 11:55 pm

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

Mijzelf
Posts: 6206
Joined: Mon Jun 16, 2008 10:45 am

Re: Restart from GUI not working

Post by Mijzelf » Tue Apr 25, 2017 12:44 pm

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?

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

Re: Restart from GUI not working

Post by bBb » Tue Apr 25, 2017 7:11 pm

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

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

Re: Restart from GUI not working

Post by bBb » Tue Apr 25, 2017 10:16 pm

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/

Mijzelf
Posts: 6206
Joined: Mon Jun 16, 2008 10:45 am

Re: Restart from GUI not working

Post by Mijzelf » Wed Apr 26, 2017 9:08 am

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.
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.
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.

Post Reply