Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2001 20:41:17 +0300
From:      Odhiambo Washington <wash@iconnect.co.ke>
To:        Drew Tomlinson <drewt@writeme.com>
Cc:        FBSD-Q <freebsd-questions@freebsd.org>
Subject:   Re: Newbie Help Diagnosing Startup Script
Message-ID:  <20010222204117.D57906@poeza.iconnect.co.ke>
In-Reply-To: <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF864@ldcmsx01.lc.ca.gov>;  from "Drew Tomlinson" on Thu, Feb 22, 2001 at 09:20:27AM -0800
References:  <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF864@ldcmsx01.lc.ca.gov>

next in thread | previous in thread | raw e-mail | index | archive | help

--rqzD5py0kzyFAOWN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Drew Tomlinson <drewt@writeme.com> [20010222 20:26]: writing on the subje=
ct 'Newbie Help Diagnosing Startup Script'
Drew> I am trying to diagnose why a startup script doesn't seem to run
Drew> automatically during startup but seems to run fine when invoked from =
the
Drew> command line.  My script lives in /usr/local/etc/rc.d.  I have checke=
d the
Drew> man pages and verified that /etc/defaults/rc.conf contains this direc=
tory in
Drew> the local_startup line and there are no overrides in /etc/rc.conf.  My
Drew> script is called dynip.sh and it has the following "permissions" (is =
this
Drew> the right term?).
Drew>=20
Drew> -rwxr-x--x  1 root  wheel  111 Sep 13 04:51 apache.sh
Drew> -rwxr-xr-x  1 root  wheel  233 Dec 20 11:36 dynip.sh
Drew>=20
Drew> I included the apache.sh line because this script appears to work as =
apache
Drew> starts up automatically.  This is the contents of my dynip.sh script:
Drew>=20
Drew> 104 Blacksheep# cat dynip.sh
Drew> #!/bin/sh
Drew>=20
Drew> case "$1" in
Drew> start)
Drew>         /usr/local/bin/dynipclient
Drew>         echo -n ' dynipclient'

I think you're missing something small, that should make the thing be
started in the background.=20
Where does it put its runtime pid???

try this one....below..

################
#!/bin/sh

case "$1" in
start)
    if [ -f /usr/local/bin/dynipclient ]; then
        /usr/local/bin/dynipclient && echo -n ' DYNIPCLIENT'
        ps -ax | grep dynip | head -1 | awk ' { print $1 } ' > /var/run/dyn=
ip.pid
    fi
    ;;

stop)
    kill `cat /var/run/dynip.pid`
    ;;

*)
    echo "unknown option: $1 - should be 'start' or 'stop'" >&2
    ;;
esac
	=09
#########

I hope it helps...


-Wash

--
Odhiambo Washington  Inter-Connect Ltd.,
wash@iconnect.co.ke  5th Flr Furaha Plaza
Tel: 254 11 222604   Nkrumah Rd.,
Fax: 254 11 222636   PO Box 83613 MOMBASA, KE.

The child must teach the man. -John Greenleaf Whittier=20

--rqzD5py0kzyFAOWN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD4DBQE6lU89A2k+MNyI/bERArXGAKCY+FgKDg+GJdEsDrf8NDNRWMtMVACWMo1l
Z1jbpdiVeDGvGmDnLqNB7g==
=FjLn
-----END PGP SIGNATURE-----

--rqzD5py0kzyFAOWN--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010222204117.D57906>