General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Oct 23, 2017 2:19 am

All times are UTC




Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next
Author Message
PostPosted: Wed Jun 14, 2017 2:09 pm 
Offline

Joined: Tue Jan 20, 2015 9:46 pm
Posts: 22
yes, of course.

Here's my output :

root@Silax-Cloud:~# ls -la /ffp/start/transmission.sh
-rwxr-xr-x 1 root root 5.6K Jun 11 10:42 /ffp/start/transmission.sh .

I checked my ffp.log on the location specified by you and i found only one error " can't load library 'libc.so.6' "

Please have a look on my log file https://pastebin.com/8Y07jxSS

Do you think that my problem caused by missing this library ?


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 3:43 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
silax wrote:
I start transmission daemon and now i receive the stupid error message
"403: Forbidden
Unauthorized IP Address.
Either disable the IP address whitelist or add your address to it.
If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.
If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.
"
I edit the /mnt/HD_a2/ffpdata/transmission/settings.json with the correct item:
"rpc-enabled": false,
"rpc-whitelist": "127.0.0.1",
"rpc-whitelist-enabled": false
Why?
And what you expected with such configuration? You have blocked all control access of transmission daemon service.
It was clearly stated in upgrade/install post, what you should do, but seems you better know, what you need.

Quote:
I checked my ffp.log on the location specified by you and i found only one error " can't load library 'libc.so.6' "
Rerun lddd and paste full outputs of it.

Quote:
modify the rpc-whitelist to a simple "*.*.*.*" (or maybe one * is also good).
Well, doing this will allow access to everyone. As long as 9091 port is not exposed to www, it is safe, but it will not restrict access for intruder, if your network is breached. Imo, better approach is to set rpc username, password and limit rpc-whitelist only to local LAN members.

Quote:
make sure, You have stopped the TM before! Otherwise it will overwrite Your modifications from the RAM
For that purpose reload command is implemented, which can save settings, without stopping daemon:
Code:
sh /ffp/start/transmission.sh reload
But of course, stop before and start after editing is also an option.


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 4:37 pm 
Offline

Joined: Tue Jan 20, 2015 9:46 pm
Posts: 22
Hi barmalej2,

Thank you for your post. Last night, after I post the message with "403: Forbidden" error I figured how to correctly configure the settings.json file . I managed to upgrade the transmission to 2.92 ;) . Now, the only problem is that the transmission.sh doen't autostart when i power on my NAS .

Outpus for lddd:
Code:
root@Silax-Cloud:~# cat /tmp/lddd.owRc/missing-libs.txt
/ffp/lib/perl5/5.14.2/arm-linux-thread-multi-64int/auto/DB_File/DB_File.so:
checking sub-depends for 'not found'
        libdb-5.2.so => not found (0x00000000)
/ffp/lib/python2.7/site-packages/libxsltmod.so:
checking sub-depends for 'not found'
checking sub-depends for 'not found'
        libgcrypt.so.11 => not found (0x00000000)
        libgpg-error.so.0 => not found (0x00000000)
/ffp/lib/php/modules/xsl.so:
checking sub-depends for 'not found'
checking sub-depends for 'not found'
        libgcrypt.so.11 => not found (0x00000000)
        libgpg-error.so.0 => not found (0x00000000)
/ffp/lib/libexslt.so.0.8.15:
checking sub-depends for 'not found'
checking sub-depends for 'not found'
        libgcrypt.so.11 => not found (0x00000000)
        libgpg-error.so.0 => not found (0x00000000)
/ffp/bin/xsltproc:
        libgcrypt.so.11 => not found
        libgpg-error.so.0 => not found
        libgcrypt.so.11 => not found
        libgpg-error.so.0 => not found


Do you know how autostart the transmission.sh .

I granted the right permission: chmod 755 tranmission.sh

What I did wrong ?


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 5:39 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
MrDini advise to check ffp boot logs revealed the following problem:
Quote:
exec /ffp/etc/rc

exec /ffp/etc/rc runs all scripts with execution bit set (minimum 700 is required to run, standardly 755 is used, imo-750 would be the best practice) in the /ffp/start/ directory with start argument. But here is a real problem:
Code:
/usr/local/zy-pkgs/ffproot/ffp/bin/bash: can't load library 'libc.so.6'
None of the scripts in /ffp/start are able to start, because they has shell interpreter /ffp/bin/sh, which is actually just bourne shell compatibility symlink to /ffp/bin/bash. At that moment bash can't load any script, because of missing library. And here goes the most interesting part-libc.so.6 is a part of glibc, which was never and up till now is not used in ffp Zyxel firmware is based on glibc, while ffp uses uClibc.
This error tends me to think, that something unusual is set in global variables or you have some package badly linked to firmware libc.so.6 instead of ffp uClibc. Also problem can ffp zypkg version specific, as I never saw such problem using ffp-usbstick version. To figure out the key reason can take some time, so be patient.
Required outputs for further investigation:
Code:
env

Code:
readelf -d /ffp/bin/bash | grep NEEDED

Code:
ls -la /ffp/start/

Code:
cat /ffp/etc/rc

Code:
funpkg -q bash


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 7:17 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
The history repeats itself.

From my understanding it looks like a bug in the zypkg FFp... :roll:

Lazy fix (but just after sharing barmalej's commands to see what can cause the problem exactly):

Code:
ln -s /ffp/lib/libuClibc-0.9.33.3-git.so /ffp/lib/libc.so.6


It will create a symlink for the uClibc's libc which isn't the glibc, but works (as Doky told me).

PS to barmalej2: I'm sorry, I didn't read Your whole post. The reload function is such a cool thing! :) Will look on the start script, because I am interested in the way how You do that.

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


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 7:42 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
MrDini wrote:
From my understanding it looks like a bug in the zypkg FFp... :roll:

We have no evidence right now to say like that. It is just a guess.

MrDini wrote:
Lazy fix (but just after sharing barmalej's commands to see what can cause the problem exactly):

Code:
ln -s /ffp/lib/libuClibc-0.9.33.3-git.so /ffp/lib/libc.so.6


It will create a symlink for the uClibc's libc which isn't the glibc, but works (as Doky told me).

It is very dirty hack and even if it works at glance, I would strongly recommend do not use it. After applying it, tracing primary problem might be impossible. Besides, building or compiling source on such system can be unpredictable.

P.S. @MrDini. Both users experiencing the same problem are Romanian? It that coincidence?


Top
 Profile  
 
PostPosted: Wed Jun 14, 2017 9:39 pm 
Offline

Joined: Tue Jan 20, 2015 9:46 pm
Posts: 22
Hello guys,
Thank you very much for your analyzing. In this moment, I have the feeling that this update is causing too many problems.
Do you have the same feeling ?
Barmalej2, In the below you will find all the results:
Code:
root@Silax-Cloud:~# exec /ffp/etc/rc
* /ffp/start/transmission.sh ...
Starting transmission...done! [ OK ]
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh inactive
* /ffp/start/sshd.sh ...
Starting sshd...[ Fail!!! ] ERROR WARNING: sshd can not start!!!
* /ffp/start/serviio.sh inactive
* /ffp/start/rsyncd.sh inactive
* /ffp/start/phpfpm.sh inactive
* /ffp/start/phpcgi.sh inactive
* /ffp/start/mysqld.sh inactive
* /ffp/start/kickangel.sh inactive
* /ffp/start/kickwebs.sh inactive
* /ffp/start/lighttpd.sh inactive
* /ffp/start/inetd.sh inactive
* /ffp/start/darkstat.sh inactive


Code:
root@Silax-Cloud:~# env
TERM=xterm
SHELL=/ffp/bin/sh
SSH_CLIENT=192.168.1.97 50969 22
SSH_TTY=/dev/pts/0
USER=root
MAIL=/var/mail/root
PATH=/ffp/opt/java/jre/bin:/ffp/opt/java/jre/bin:/ffp/opt/java/jre/bin:/ffp/sbin:/usr/sbin:/sbin:/ffp/bin:/usr/bin:/bin
INPUTRC=/ffp/etc/inputrc
PWD=/root
LANG=en_US
PS1=\u@\h:\w\$
PS2=>
SHLVL=1
HOME=/root
LESS=-M
LOGNAME=root
SSH_CONNECTION=192.168.1.97 50969 192.168.1.102 22
_=/ffp/bin/env

Code:
root@Silax-Cloud:~# readelf -d /ffp/bin/bash | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libncursesw.so.5]
 0x00000001 (NEEDED)                     Shared library: [libiconv.so.2]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]

Code:
root@Silax-Cloud:~# ls -la /ffp/start/
total 140K
drwxr-xr-x  2 root root 4.0K Jun 13 20:38 .
drwxr-xr-x 17 root root 4.0K Jun 12 18:34 ..
-rw-r--r--  1 root root   52 Jan 13  2012 LOGIN.sh
-rw-r--r--  1 root root   35 Jan 13  2012 SERVERS.sh
-rw-r--r--  1 root root 1.3K Mar  5  2013 darkstat.sh
-rw-r--r--  1 root root   87 Apr 18  2014 darkstat.sh.new
-rw-r--r--  1 root root  203 Jan 21  2012 inetd.sh
-rw-r--r--  1 root root  906 Dec 12  2012 kickangel.sh
-rw-r--r--  1 root root  229 Dec 29  2011 kickwebs.sh
-rw-r--r--  1 root root  286 Dec 12  2012 kickwebs.sh.new
-rw-r--r--  1 root root  223 Dec 29  2011 lighttpd.sh
-rw-r--r--  1 root root 1.9K Dec 12  2012 lighttpd.sh.new
-rw-r--r--  1 root root  956 Oct 29  2012 mysqld.sh
-rw-r--r--  1 root root 1.6K Dec 28  2011 nfsd.sh
-rw-r--r--  1 root root  608 Dec 31  2013 phpcgi.sh
-rw-r--r--  1 root root  609 Oct 23  2014 phpfpm.sh
-rw-r--r--  1 root root  160 Dec 30  2011 portmap.sh
-rw-r--r--  1 root root 4.1K Nov 19  2016 rsyncd.sh
-rw-r--r--  1 root root 1.2K Dec 18  2011 rsyncd.sh.old20170612_183503
-rw-r--r--  1 root root 6.3K Jan 20  2016 serviio.sh
-rwxr-xr-x  1 root root 6.3K Jan 20  2016 serviio.sh_off
-rwxr-xr-x  1 root root 4.7K Sep  7  2015 sshd.sh
-rw-r--r--  1 root root 1.1K Nov 24  2013 sshd.sh.old20170612_183426
-rw-r--r--  1 root root  169 Jan 21  2012 telnetd.sh
-rwxr-xr-x  1 root root 5.6K Jun 11 10:42 transmission.sh
-rw-r--r--  1 root root  811 Mar 10  2016 transmission.sh.old20170612_183515
-rw-r--r--  1 root root 5.6K Jun 13 18:45 transmission.sh.old20170613_190435
-rw-r--r--  1 root root 5.6K Jun 13 18:45 transmission.sh.old20170613_203806

Code:
root@Silax-Cloud:~# cat /ffp/etc/rc
#!/ffp/bin/sh

export PATH=/ffp/sbin:/ffp/bin:/usr/sbin:/sbin:/usr/bin:/bin

# We don't need LD_LIBRARY_PATH for funplug packages, and we
# don't like surprises here (CH3SNAS firmware 1.03, see
# http://forum.dsmg600.info/p13433-Yesterday-18%3A53%3A36.html#p13433 ).
unset LD_LIBRARY_PATH


# reverse order of elements in a list
reverse_list()
{
        _list=
        while [ $# -gt 0 ]; do
                _list="$1 $_list"
                shift
        done
        echo $_list
}


files=$(rcorder /ffp/start/*.sh)
case "$1" in

    stop)
        for f in $(reverse_list $files); do
            if [ -x "$f" ]; then
                $f stop
            fi
        done
        ;;

    *)
        for f in $files; do
            if [ -x "$f" ]; then
                echo "* $f ..."
                $f start
            else
                echo "* $f inactive"
            fi
        done
        ;;

esac

Code:
root@Silax-Cloud:~# funpkg -q bash
bash-4.3.42-arm-1

Sorry for the long post.
Any suggestion/improvements are welcome :)


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 5:37 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Outputs are typical and I see nothing suspicious in them.
Quote:
Starting sshd...[ Fail!!! ] ERROR WARNING: sshd can not start!!!

I already told you to disable ffp sshd autostart, because you are using zyxel sshd:
Code:
chmod 644 /ffp/start/sshd.sh

The problem is pretty much clear. In case of ffp-zypkg, /ffp/bin/bash uClibc runtime loader/linker /ffp/lib/ld-uClibc.so.0 loads some sub-dependent library of bash not from /ffp/lib/ directory, but from zyxel firmware /usr/lib. All libs in /usr/lib are glibc based. The interesting part is that it fails to load /lib/libc.so.6.
Problem occurs only on boot time and can't be reproduced from command line after boot.
As I am not expert of ffp-zypkg (actually I never used it), so my only guess now is that some of ffp-zypkg boot environment variables makes ffp runtime loader/linker - /ffp/lib/ld-uClibc.so.0 to search for libs, where it shouldn't look for. There is several ways to resolve this problem. Imo, most suitable one is to rebuilt uClibc with hardcoded rpath-/ffp/lib. I will prepare the new build on weekend. Meanwhile you can try the following command:
Code:
ldconfig
Reboot and check logs again. Worth to check, even if there is a little chance.


Top
 Profile  
 
PostPosted: Sun Jun 18, 2017 4:32 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Lets try new uClibc build with hardcoded libraries runtime search path:
Code:
cd /ffp/funpkg/cache/br2
wget -nv http://downloads.zyxel.nas-central.org/Users/barmalej2/ffp/0.7/arm/packages/testing/uClibc-0.9.33.3_git-arm-9.txz
wget -nv http://downloads.zyxel.nas-central.org/Users/barmalej2/ffp/0.7/arm/packages/testing/uClibc-solibs-0.9.33.3_git-arm-9.txz
funpkg -u uClibc-0.9.33.3_git-arm-9.txz uClibc-solibs-0.9.33.3_git-arm-9.txz
reboot


Check logs for bash errors.
Does transmission starts now after reboot?


Top
 Profile  
 
PostPosted: Wed Aug 09, 2017 8:04 pm 
Offline

Joined: Tue Jan 20, 2015 9:46 pm
Posts: 22
Hello guys!

Last weekend I factory reset my NAS and I installed again ffp using Mijzelf method . After that, I installed Transmission 2.92 using the guide wrote from barmalej2, page 12 on this topic. After the last installation I have a issue with ffp 0.7 . Seams that library ld-linux.so.3 can't loading. The ffp trace have the next error:
Code:
Rotating logfiles...
rm /i-data/md0/admin/zy-pkgs/ffp/ffp.log.9.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.8.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.9.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.7.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.8.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.6.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.7.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.5.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.6.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.4.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.5.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.3.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.4.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.2.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.3.gz
mv /i-data/md0/admin/zy-pkgs/ffp/ffp.log.1.gz /i-data/md0/admin/zy-pkgs/ffp/ffp.log.2.gz
cat /i-data/md0/admin/zy-pkgs/ffp/ffp.log | gzip -c >/i-data/md0/admin/zy-pkgs/ffp/ffp.log.1.gz
Try to determine NAS type...
according to /zyxel/mnt/info/modelid: AE03->NSA325v2
type NSA325v2, fw V4.81(AALS.0)
Starting /usr/local/zy-pkgs/ffproot/after_booting.sh version 20131124 at Mon Aug 7 05:15:21 UTC 2017...
Try to create a /ffp symlink...done
To chroot or not to chroot...FFP 0.7/arm, no
Change root shell
Change admin shell
Generate helper file 1 /tmp/.ffpstick/helper.inc...done
Generate helper file 2 /tmp/.ffpstick/helper.inc...done
Generate convenience symlink /mnt/HD_a2
exec /ffp/etc/rc
/usr/local/zy-pkgs/ffproot/ffp/bin/bash: can't load library 'ld-linux.so.3'

I run lddd app to know what librarians I missing
http://s.go.ro/jvywuow2
http://s.go.ro/ruaadql2

Do you know who to fix this issue?


Top
 Profile  
 
PostPosted: Thu Aug 10, 2017 7:19 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Try to upgrade uClibc and uClibc-solibs packages. Instructions are in the post right above yours.


Top
 Profile  
 
PostPosted: Wed Aug 16, 2017 8:47 pm 
Offline

Joined: Tue Jan 20, 2015 9:46 pm
Posts: 22
I have the same problem after I upgraded uClibc and uClibc-solibs packages .


Top
 Profile  
 
PostPosted: Wed Aug 23, 2017 9:45 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
After vacations, I found some free time to take a closer look at this problem. It turns out to be generic ffp bug no matter of ffp type used: ffp-zypkg (ZyXel package installed on harddisk) or ffp-stick (USB). I injected some code into ffp after_booting.sh script right before line
Code:
exec /ffp/etc/rc
to check several environment variables. Here is output:
Quote:
LD_LIBRARY_PATH is : /usr/local/zy-pkgs/lib
PATH is : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/zyxel/sbin:/usr/local/zy-pkgs/bin:/zyxel/htp
exec /ffp/etc/rc

LD_LIBRARY_PATH is real evil here and actual culprit of this problem. It should be unset before initialization of ffp environment and running any ffp program including /ffp/etc/rc script. /ffp/etc/rc basically unsets LD_LIBRARY_PATH variable on first step, but the script itself is initialized by /ffp/bin/bash interpreter, which in turn depends on these libraries:
Code:
readelf -d /ffp/bin/bash | grep NEEDED
Quote:
0x00000001 (NEEDED) Shared library: [libncursesw.so.5]
0x00000001 (NEEDED) Shared library: [libiconv.so.2]
0x00000001 (NEEDED) Shared library: [libdl.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.0]

LD_LIBRARY_PATH is set to /usr/local/zy-pkgs/lib, thus it forces to search and load bash dependent libs libncursesw.so.5 libiconv.so.2 libdl.so.0 and libc.so.0 in ZyXel firmware libraries directory-/usr/local/zy-pkgs/lib first instead of standard ffp libraries place-/ffp/lib. It's very bad, because none of ffp programs or libs should never use, depend and load ZyXel firmware libraries, based on glibc.
I wasn't able to reproduce this problem, because I never used and haven't installed ZyXel packages. Mine /usr/local/zy-pkgs/lib directory is almost empty, while your's /usr/local/zy-pkgs/lib has libraries used by installed your ZyXel packages. In your case, there is collision is between glibc (ZyXel firmware) and uClibc (ffp) libraries, because some of the bash dependent libs are tried to load from /usr/local/zy-pkgs/lib and the other part from /ffp/lib.
From my point of view cleanest solution would be to unset LD_LIBRARY_PATH in ffp environment initialize script-after_booting.sh. Since it doesn't depend on us, I solved that in other way. It is not perfect one solution, but should also solve your problem. I uploaded new bash ffp package into br2 repository with hardcoded libraries search path-/ffp/lib into bash binary, so you can update it:
Code:
slapt-get -u
slapt-get -i bash

Then reboot box and check ffp logs again.

Some ZyXel specific observation.
Mystic remains, why ZyXel firmware busybox shell-/bin/sh used by after_booting.sh script sources /etc/profile file, while it shouldn't do that, when running as non-login shell. It violates standard shell, posix compliant? rules.


Top
 Profile  
 
PostPosted: Wed Aug 23, 2017 1:18 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6049
Wow Sherlock, good stuff!

Quote:
Mystic remains, why ZyXel firmware busybox shell-/bin/sh used by after_booting.sh script sources /etc/profile file, while it shouldn't do that, when running as non-login shell.
It doesn't.

When booting the kernel executes /init, which executes /linuxrc, which is a symlink to busybox. The linuxrc applet does 'init', and reads /etc/inittab, which states it should execute /etc/init.d/rcS.

/etc/init.d/rcS mounts or generates&mount /zyxel/mnt/sysdisk/sysdisk.img, which contains a script <mountpoint>/etc/init.d/rcS2. In it's last line /etc/init.d/rcS executes <mountpoint>/etc/init.d/rcS2.

<mountpoint>/etc/init.d/rcS2 (/ram_bin/etc/rcS2) starts with
Code:
#!/bin/sh

# NOTE:
# This script initializes almost all system services on HDD.

. /etc/profile
This script also starts all firmware daemons, and starts the FFP stick, and so they all inherit this environment.


Top
 Profile  
 
PostPosted: Wed Aug 23, 2017 4:01 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Thanks Watson for valuable notes about Zyxel booting process :) I was too lazy to track down from where the /etc/profile comes from.
Do we really need LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib in after_booting.sh? I am asking about this, because hardcoding libs search path for ffp bash might be not enough. I think, that RPATH has precedence over LD_LIBRARY_PATH only for direct dependencies. For indirect ones (dependencies of direct dependent libs) LD_LIBRARY_PATH has higher value thus it is still searched first.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 49 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