Upgrading to 04x

3rd Party Package Requesting

Re: Upgrading to 04x

Postby justdave » Tue Jul 26, 2011 8:24 pm

I also get this when I try and do a restart:

Code: Select all
[rototiller@router] rc_nfsd restart
Stopping nfsd...                             pidof: illegal option -- H
BusyBox v0.60.7-Freesco-043 (10/29/2010) multi-call binary

Usage: pidof process-name [process-name ...]

pidof: illegal option -- H
BusyBox v0.60.7-Freesco-043 (10/29/2010) multi-call binary

Usage: pidof process-name [process-name ...]

Done


Other than that, it does work as it should.

dave
justdave
Junior Advanced Member
 
Posts: 124
Joined: Sat Dec 22, 2001 2:00 am
Location: san jose Ca USA

Re: Upgrading to 04x

Postby Lightning » Tue Jul 26, 2011 8:34 pm

In the /pkg/rc/rc_nfsd script there are two lines in the 'stp)' section that have 'killall -HUP xxxx' which I took directly from another script. The '-HUP' command is not supported in FREESCO with the 'killall' scriptin that format. It should be changed to 'killall xxxxx -HUP'

I have re-packaging and uploaded it so you can either re-install it or make the changes yourself.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Upgrading to 04x

Postby justdave » Tue Jul 26, 2011 9:10 pm

I have reinstalled it. The installation goes fine. When I try to use the rc_nfsd restart it says that it is stopping the services and then does not say that it is starting. I think that the HUP just sends a signal to the programs to restart. Usually this is fine, but it isn't really what you are telling the rc script to do. I think that you want to make the script actually kill the processes and restart them. For the restart option you could use the -HUP so that the programs just re-read the config files.

Thanks for your help

dave
justdave
Junior Advanced Member
 
Posts: 124
Joined: Sat Dec 22, 2001 2:00 am
Location: san jose Ca USA

Re: Upgrading to 04x

Postby Lightning » Tue Jul 26, 2011 11:29 pm

I had initially considered the same thing, but trusted the existing scripting on that point. So I really don't know the answer because there are three files that are stopped and started and only the single one that is completely killed is the one checked to see if it is running before starting the services.

So on this specific topic I will accept what ever you figure out. You can remove the '-HUP' and killall will by default send a '-2' using the kill command. Or you could use '-15' or even '-9' to ensure it is really stopped. It is something to play with and let mew know how it really should be.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Upgrading to 04x

Postby justdave » Wed Jul 27, 2011 11:03 am

Lewis-

I believe you would want something like this:

Code: Select all
#!/bin/sh
# Pack version 7.14 made by Lightning 4/24/2011
#
# Template for nfsd version 2.20

. /etc/colors
. /etc/commonfn
. /etc/.language
. /etc/$DLANG.cch

[ -d /pkg/lang/nfsd-2.20/$DLANG ] && LANG=$DLANG || LANG=english
. /pkg/lang/nfsd-2.20/$LANG/rc_nfsd

fn2(){  ps | sed -n /\  rpc\.portmap/P 2>/dev/null
}

rst(){
        runchk rpc.portmap
        [ $? = 1 ] && return
        echo -n "$RC_RESTART nfsd...$HT"
        killall rpc.nfsd -HUP
        killall rpc.mountd -HUP
        =
}

stp(){
        runchk rpc.portmap
        [ $? = 1 ] && return
        echo -n "$RC_STOP nfsd...$HT"
        killall rpc.nfsd
        killall rpc.mountd
        killall rpc.portmap -9
        =
}

str(){
        runchk rpc.portmap
        [ $? = 0 ] && return
        echo -n "$RC_START nfsd...$HT"
        rpc.portmap
        rpc.mountd
        rpc.nfsd
        = $?
}

case $1 in
        $fire)  ipfwadm -I -a $Pd -P tcp -W $INET -D 0/0 2049 $LOG
                ipfwadm -I -a $Pd -P udp -W $INET -D 0/0 2049 $LOG
                ipfwadm -I -a $Pd -P tcp -W $INET -D 0/0 111 $LOG
                ipfwadm -I -a $Pd -P udp -W $INET -D 0/0 111 $LOG
                ;;
        $setu)  set -- `ls -l /pkg/etc/exports`
                MOD=$5$8
                edthlp
                getc
                edit /pkg/etc/exports
                edit /pkg/etc/hosts.allow
                edit /pkg/etc/hosts.deny
                set -- `ls -l /pkg/etc/exports`
                [ $MOD = $5$8 ] || rc_nfsd $rest
                ;;
        $star)  str;;
        $stop)  stp;;
        $rest)  rst;;
        $stat)
                runchk nfsd
                if [ $? = 0 ]
                then echo "$RUNNING nfsd"; fn2
                else echo "$NOT_RUNNING nfsd"
                fi;;
esac


I used the $RC_RESTART variable, but I know it doesn't exist. Is there something similar that could be used here?

dave
justdave
Junior Advanced Member
 
Posts: 124
Joined: Sat Dec 22, 2001 2:00 am
Location: san jose Ca USA

Re: Upgrading to 04x

Postby Lightning » Wed Jul 27, 2011 8:37 pm

The easy thing to do is to just add that word into the language file for the rc_nfsd script. Any word or wording you want can be defined on an individual package basis. Also for a single word, online translators do a pretty good job.

The one problem that I see in your modification is the rcp.portmap is checked to see if it is running and if it is not then nothing is done, it also does not address if any of the other binaries have died. So you probably should use something like this instead.
Code: Select all
rst(){
        echo -n "$RC_RESTART nfsd...$HT"
        runchk rpc.portmap
        [ $? = 0 ] && killall rpc.portmap -HUP || rpc.portmap
        runchk rpc.mountd
        [ $? = 0 ] && killall rpc.mountd -HUP || rpc.mountd
        killall rpc.nfsd
        sleep 1
        rpc.nfsd
        = $?
}
Also looking at the package and the multiple binaries the start and stop sections should also probably be modified to chack the other binaries as well. But that is probably why it is a 'test' package and you would be the tester (guinea pig). :roll:
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Upgrading to 04x

Postby Lightning » Wed Jul 27, 2011 9:42 pm

I repackaged the package with the changes, so if you want to install it again it should do what you are asking. I changed the stop and start sections as well. The initial script is completely designed to use just one binary, so with multiple binaries it does not work well and needed changed.
http://lewys-spot.dyndns.org/test/

I am however curious if the package actually runs or not?
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Upgrading to 04x

Postby justdave » Thu Jul 28, 2011 5:33 pm

Lewis-

The package runs and works as it should. The only thing that I see is that the rpc.portmap is not stopped with the killall command. You have to use the -9 signal on that one.

thanks a million.

dave
justdave
Junior Advanced Member
 
Posts: 124
Joined: Sat Dec 22, 2001 2:00 am
Location: san jose Ca USA

Re: Upgrading to 04x

Postby Lightning » Thu Jul 28, 2011 8:18 pm

I did install and test the package a small amount and you are correct the rpc.portmap is a very stubborn binary to get stopped even using -9 it does not always completely stop. So I added two killall lines, one with -15 and the second with -9 just to be sure.

I just re-posted the package with all of the various refinements. It also now goes into setup at the end of the install automatically and adds the firewall rules as well.

http://lewys-spot.dyndns.org/test/

If this version is ok then I will publish it for others to use.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Previous

Return to 3rd Party Package Requesting

Who is online

Users browsing this forum: No registered users and 3 guests

cron