General NAS-Central Forums

Welcome to the NAS community
It is currently Thu Dec 14, 2017 5:10 pm

All times are UTC




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Sep 30, 2014 4:27 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Can you try this one?
Code:
#!/bin/sh

RELDIR=$( dirname $0 )
cd $RELDIR
CURDIR=$( pwd )

mountpoint=""

while read line
do
        current=$( echo $line | cut -d ' ' -f 2 )
       
        if echo $CURDIR | grep ^${current} >/dev/null
        then
                echo $current fits
                if [ ${#mountpoint} -lt ${#current} ] ; then
                        mountpoint=$current
                fi
        else
                echo $current doesn\'t fit
        fi
done </proc/mounts

echo $mountpoint is best fitting


Top
 Profile  
 
PostPosted: Thu Oct 09, 2014 3:56 pm 
Offline

Joined: Thu Oct 09, 2014 2:42 pm
Posts: 7
Mijzelf wrote:
Can you try this one?
Code:
#!/bin/sh

RELDIR=$( dirname $0 )
cd $RELDIR
CURDIR=$( pwd )

mountpoint=""

while read line
do
        current=$( echo $line | cut -d ' ' -f 2 )
       
        if echo $CURDIR | grep ^${current} >/dev/null
        then
                echo $current fits
                if [ ${#mountpoint} -lt ${#current} ] ; then
                        mountpoint=$current
                fi
        else
                echo $current doesn\'t fit
        fi
done </proc/mounts

echo $mountpoint is best fitting


Dear Mijzelf,the output is as follows:

/ fits
/initrd doesn't fit
/ fits
/boot doesn't fit
/mnt/apps doesn't fit
/mnt/etc doesn't fit
/etc doesn't fit
/oem doesn't fit
/proc doesn't fit
/proc/bus/usb doesn't fit
/proc/fs/nfsd doesn't fit
/sys doesn't fit
/dev doesn't fit
/dev/pts doesn't fit
/mnt/system doesn't fit
/mnt/pools/A/A0 doesn't fit
/nfs/Documents doesn't fit
/nfs/Movies doesn't fit
/nfs/Music doesn't fit
/nfs/SharedMedia doesn't fit
/nfs/Pictures doesn't fit
/nfs/Torrent doesn't fit
/ is best fitting


Top
 Profile  
 
PostPosted: Thu Oct 09, 2014 4:41 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Hm. Best fit against what? I surely didn't think deep enough.
Code:
#!/bin/sh

RELDIR=$( dirname $0 )
cd $RELDIR
CURDIR=$( pwd )

mountpoint=""

while read line
do
        current=$( echo $line | cut -d ' ' -f 2 )
       
        if echo $CURDIR | grep ^${current} >/dev/null
        then
                echo $current fits
                if [ ${#mountpoint} -lt ${#current} ] ; then
                        mountpoint=$current
                fi
        else
                echo $current doesn\'t fit
        fi
done </proc/mounts

echo $mountpoint is best fit against $CURDIR
The desired output is something like '/mnt/pools/A/A0 is best fit against /mnt/pools/A/A0/Documents', or something like that. I *hope* the script was testing against /ffp, which is not a mountpoint.

/Edit: Can you see in your older logfiles (/ffp/log/ffp.log.n) that ffp is shutdown cleanly?


Top
 Profile  
 
PostPosted: Thu Oct 09, 2014 7:39 pm 
Offline

Joined: Thu Oct 09, 2014 2:42 pm
Posts: 7
Mijzelf wrote:
Hm. Best fit against what? I surely didn't think deep enough.
Code:
#!/bin/sh

RELDIR=$( dirname $0 )
cd $RELDIR
CURDIR=$( pwd )

mountpoint=""

while read line
do
        current=$( echo $line | cut -d ' ' -f 2 )
       
        if echo $CURDIR | grep ^${current} >/dev/null
        then
                echo $current fits
                if [ ${#mountpoint} -lt ${#current} ] ; then
                        mountpoint=$current
                fi
        else
                echo $current doesn\'t fit
        fi
done </proc/mounts

echo $mountpoint is best fit against $CURDIR
The desired output is something like '/mnt/pools/A/A0 is best fit against /mnt/pools/A/A0/Documents', or something like that. I *hope* the script was testing against /ffp, which is not a mountpoint.

/Edit: Can you see in your older logfiles (/ffp/log/ffp.log.n) that ffp is shutdown cleanly?


Hi Mijzelf,

Sorry for my little knowledge on the subject. Again the script output:

/ fits
/initrd doesn't fit
/ fits
/boot doesn't fit
/mnt/apps doesn't fit
/mnt/etc doesn't fit
/etc doesn't fit
/oem doesn't fit
/proc doesn't fit
/proc/bus/usb doesn't fit
/proc/fs/nfsd doesn't fit
/sys doesn't fit
/dev doesn't fit
/dev/pts doesn't fit
/mnt/system doesn't fit
/mnt/pools/A/A0 doesn't fit
/nfs/Documents doesn't fit
/nfs/Movies doesn't fit
/nfs/Music doesn't fit
/nfs/SharedMedia doesn't fit
/nfs/Pictures doesn't fit
/nfs/Torrent doesn't fit
/nfs/prueba doesn't fit
/ is best fit against /ffp

Log:

Thu Oct 9 12:40:41 VET 2014: Executing ffp-starter.sh version 20140922 with command start.
Rotate logfiles
mv /mnt/pools/A/A0/prueba/var/log/ffp.log /mnt/pools/A/A0/prueba/var/log/ffp.1.log
Create /ffp symlink...done
The actual start:
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh ...
Starting /ffp/sbin/telnetd -l /ffp/bin/sh
* /ffp/start/sshd.sh inactive
* /ffp/start/rsyncd.sh inactive
* /ffp/start/plexmediaserver.sh inactive
* /ffp/start/kickwebs.sh inactive
* /ffp/start/lighttpd.sh inactive
* /ffp/start/inetd.sh inactive
* /ffp/start/fp_master.sh inactive
Change shell for root&admin...done
Add ffp shell to /etc/shells...done
Thu Oct 9 12:40:43 VET 2014: Done


Top
 Profile  
 
PostPosted: Fri Oct 10, 2014 8:41 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Can you repeat that test when you explicitly execute the script from /mnt/pools/A/A0/<ffp-share>/ instead of /ffp/?

And it seems ffp is not stopped on shutdown. Then there would have been a line 'Stopping /ffp/sbin/telnetd'. So either I made a mistake in my stopscript, or the NAS doesn't follow the Debian way of shutting down.


Top
 Profile  
 
PostPosted: Fri Oct 10, 2014 2:14 pm 
Offline

Joined: Thu Oct 09, 2014 2:42 pm
Posts: 7
Mijzelf wrote:
Can you repeat that test when you explicitly execute the script from /mnt/pools/A/A0/<ffp-share>/ instead of /ffp/?

And it seems ffp is not stopped on shutdown. Then there would have been a line 'Stopping /ffp/sbin/telnetd'. So either I made a mistake in my stopscript, or the NAS doesn't follow the Debian way of shutting down.


Mijzelf,

root@IomegaEZ:/mnt/pools/A/A0/Probando# sh prueba.sh
/ fits
/initrd doesn't fit
/ fits
/boot doesn't fit
/mnt/apps doesn't fit
/mnt/etc doesn't fit
/etc doesn't fit
/oem doesn't fit
/proc doesn't fit
/proc/bus/usb doesn't fit
/proc/fs/nfsd doesn't fit
/sys doesn't fit
/dev doesn't fit
/dev/pts doesn't fit
/mnt/system doesn't fit
/mnt/pools/A/A0 fits
/nfs/Documents doesn't fit
/nfs/Movies doesn't fit
/nfs/Music doesn't fit
/nfs/SharedMedia doesn't fit
/nfs/Pictures doesn't fit
/nfs/Torrent doesn't fit
/nfs/Probando doesn't fit
/mnt/pools/A/A0 is best fit against /mnt/pools/A/A0/Probando


Top
 Profile  
 
PostPosted: Fri Oct 10, 2014 8:09 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Good. I built a new version ffp-starter-20141010.zip. If you exchange the script, the new one should create a symlink /mnt/HD_a2, which points to the data partition where ffp is installed.


Top
 Profile  
 
PostPosted: Fri Oct 10, 2014 8:46 pm 
Offline

Joined: Thu Oct 09, 2014 2:42 pm
Posts: 7
Mijzelf wrote:
Good. I built a new version ffp-starter-20141010.zip. If you exchange the script, the new one should create a symlink /mnt/HD_a2, which points to the data partition where ffp is installed.



Thank Mijzelf,

I just have to change the script? Need some tests for me to verify that ffp is not stopped correctly?

/Edit: the problem may be related to the file permissions?

-rwxr--r-- 1 root root 85 Oct 9 10:20 K01ffp
lrwxrwxrwx 1 root root 20 Jul 9 11:56 K20iscsi-scst -> ../init.d/iscsi-scst
lrwxrwxrwx 1 root root 20 Jul 9 11:56 K20nfs-common -> ../init.d/nfs-common


Top
 Profile  
 
PostPosted: Sat Oct 11, 2014 10:08 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Changing the script is enough to get the new functionality. Although the symlink will only be created after a reboot.

About the shutdown, I don't know. Your log proves that the script was not executed on shutdown.

Can you rename it to S00ffp, and copy it to /etc/rc0.d, and retry?
Code:
cd /etc/rc6.d
mv K01ffp S00ffp
cp -a S00ffp ../rc0.d/


Top
 Profile  
 
PostPosted: Wed Oct 15, 2014 10:47 pm 
Offline

Joined: Thu Oct 09, 2014 2:42 pm
Posts: 7
Mijzelf wrote:
Changing the script is enough to get the new functionality. Although the symlink will only be created after a reboot.

About the shutdown, I don't know. Your log proves that the script was not executed on shutdown.

Can you rename it to S00ffp, and copy it to /etc/rc0.d, and retry?
Code:
cd /etc/rc6.d
mv K01ffp S00ffp
cp -a S00ffp ../rc0.d/


Mijzelf

Still not working. Try a little research myself on the operation of the Init Scripts and the result was the device can not start:

From what I understand my only option for now is Rebuild the firmware using that USB stick?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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