From owner-freebsd-questions Thu Feb 22 9:40:14 2001 Delivered-To: freebsd-questions@freebsd.org Received: from siafu.iconnect.co.ke (upagraha.iconnect.co.ke [209.198.248.2]) by hub.freebsd.org (Postfix) with ESMTP id 4435537B65D for ; Thu, 22 Feb 2001 09:39:58 -0800 (PST) (envelope-from wash@iconnect.co.ke) Received: from [212.22.163.2] (helo=poeza.iconnect.co.ke) by siafu.iconnect.co.ke with esmtp (Exim 2.12 #1) id 14Vzgk-000Cfx-00; Thu, 22 Feb 2001 20:37:58 +0300 Received: from wash by poeza.iconnect.co.ke with local (Exim 3.20 #1) id 14Vzjx-000FHc-00; Thu, 22 Feb 2001 20:41:17 +0300 Date: Thu, 22 Feb 2001 20:41:17 +0300 From: Odhiambo Washington To: Drew Tomlinson Cc: FBSD-Q Subject: Re: Newbie Help Diagnosing Startup Script Message-ID: <20010222204117.D57906@poeza.iconnect.co.ke> Mail-Followup-To: Odhiambo Washington , Drew Tomlinson , FBSD-Q References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="rqzD5py0kzyFAOWN" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from "Drew Tomlinson" on Thu, Feb 22, 2001 at 09:20:27AM -0800 X-Operating-System: FreeBSD poeza.iconnect.co.ke 4.2-STABLE FreeBSD 4.2-STABLE X-Mailer: Mutt http://www.mutt.org/ X-Location: Mombasa, KE, East Africa Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --rqzD5py0kzyFAOWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Drew Tomlinson [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