Shutting down - rc.d/*.sh problems

Shutting down - rc.d/*.sh problems

Post by Joseph Maxwel » Sun, 23 Sep 2001 14:52:13



Hello,
I've just installed v. 4.2. Attempts at shutting down via 'shutdown'
command

produces the following message -

'Shutting down daemon processes: You still seem to have old-style rc.d
scripts: /usr/local/etc/rc.d/nwserv.sh /usr/local/etc/rc.d/opennmap.sh
/usr/local/etc/rc.d/pipsecd.sh /usr/local/etc/rc.d/sendfiled.sh
/usr/local/etc/rc.d/yaunc.sh Please change them to recognize the "Stop"
option'

Now, I am in a quandary, not knowing what code these files are supposed
to contain. Any suggestion etc. .... welcomed or better yet a copy of
those files.
Thanks

--  Joe  --

 
 
 

Shutting down - rc.d/*.sh problems

Post by Patric » Sun, 23 Sep 2001 18:19:04



> Hello,
> I've just installed v. 4.2. Attempts at shutting down via 'shutdown'
> command

> produces the following message -

> 'Shutting down daemon processes: You still seem to have old-style rc.d
> scripts: /usr/local/etc/rc.d/nwserv.sh /usr/local/etc/rc.d/opennmap.sh
> /usr/local/etc/rc.d/pipsecd.sh /usr/local/etc/rc.d/sendfiled.sh
> /usr/local/etc/rc.d/yaunc.sh Please change them to recognize the "Stop"
> option'

> Now, I am in a quandary, not knowing what code these files are supposed
> to contain. Any suggestion etc. .... welcomed or better yet a copy of
> those files.
> Thanks

> --  Joe  --

u just need a script that can start and stop
ie:
script start   => start the daemon
script stop    => stop the daemon

here is a sample for /usr/local/etc/rc.d/squid.sh

gw# cat squid.sh
#!/bin/sh

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi

case "$1" in
start)
        if [ -x ${PREFIX}/sbin/squid -a -f
${PREFIX}/etc/squid/squid.conf ]; then
                (cd /${PREFIX}/squid/logs; ${PREFIX}/sbin/squid

Quote:>/dev/null 2>&1 &) ; echo -n ' squid'

        fi
        ;;
stop)
                ${PREFIX}/sbin/squid -k shutdown 2>&1
                # Uncomment this if you'd like the system to (attempt to
                # wait for) squid to shut down cleanly
                #echo "Sleeping for 45 seconds to allow squid to
shutdown.."
                #sleep 45
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

 
 
 

Shutting down - rc.d/*.sh problems

Post by Kenneth Yan » Sun, 23 Sep 2001 23:43:08




Quote:

> u just need a script that can start and stop
> ie:
> script start   => start the daemon
> script stop    => stop the daemon

> here is a sample for /usr/local/etc/rc.d/squid.sh

Is this kind of script can only be run successfully during system starts?
'coz when i try to run it I got the "Cannot determine the PREFIX" error.

Thx.

 
 
 

Shutting down - rc.d/*.sh problems

Post by Patric » Mon, 24 Sep 2001 00:28:54





> > u just need a script that can start and stop
> > ie:
> > script start   => start the daemon
> > script stop    => stop the daemon

> > here is a sample for /usr/local/etc/rc.d/squid.sh

> Is this kind of script can only be run successfully during system starts?
> 'coz when i try to run it I got the "Cannot determine the PREFIX" error.

> Thx.

prefix is extracted from the name of the running script
input full name when launching it
(/usr/local/etc/rc.d/urscript.sh start)
 
 
 

Shutting down - rc.d/*.sh problems

Post by Kenneth Yan » Mon, 24 Sep 2001 12:38:59




Quote:

> prefix is extracted from the name of the running script
> input full name when launching it
> (/usr/local/etc/rc.d/urscript.sh start)

OIC! so when I
myhost# ./anyscript.sh start ==> "Cannot fine PREFIX err"
myhost# /usr/local/etc.rc.d/anyscript.sh start ==> OK

Thank you =)

 
 
 

1. Shutting process down through rc#.d?

Hi,

I'm wondering...

I have configured and installed Apache. No prob. :)

Now I'm messing around with rc#.d commands.

If i create a S99apache containing this : /usr/local/apache/bin/apache
start. Then it starts just fine under boot.

Then I have created a similar one. Just with K03apache. Containing the
following command :  /usr/local/apache/bin/apache stop

But it doesn't stop apache, when I do a init 6. Why?!

If I do a : reboot -- -r command, then it do a correct shutdown of apache. I
think this is quite wierd. Any ideas :)

Thanks

Best regards,

Kim Bruun

2. Jumbo-Patch for Solaris 2.5

3. Problem with powering down when shutting down

4. Problem with Masquerade

5. How to shut-off on a shut-down?

6. Soundblaster SCSI, Toshiba CDROM, Slack...

7. Problems with mount and umount when shutting down.

8. Dial-in PPP w/ SunOS 4.1.3

9. Problems with umount when shutting down

10. Problem shutting down via apcupsd/powersc

11. ppp problem when shutting down

12. Newbies: if you're having problems properly shutting down...READ THIS

13. problem of shut down