Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2001 08:50:08 -0800
From:      "Tomlinson, Drew" <Drew.Tomlinson@lc.ca.gov>
To:        "'FreeBSD Questions (E-mail)'" <freebsd-questions@FreeBSD.org>
Subject:   Newbie Help Diagnosing Startup Script
Message-ID:  <BA5D0CE1CBB2D411B6AA00A0CC3F0239C02537@ldcmsx01.lc.ca.gov>

next in thread | raw e-mail | index | archive | help
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--Boundary_(ID_dw+lNOj4HinCEngl/QY+bA)
Content-type: text/plain; charset="iso-8859-1"

Newbie Alert.

I am trying to diagnose why a startup script doesn't seem to run
automatically during startup but seems to run fine when invoked from the
command line.  My script lives in /usr/local/etc/rc.d.  I have checked the
man pages and verified that /etc/defaults/rc.conf contains this directory in
the local_startup line and there are no overrides in /etc/rc.conf.  My
script is called dynip.sh and it has the following "permissions" (is this
the right term?).

-rwxr-x--x  1 root  wheel  111 Sep 13 04:51 apache.sh
-rwxr-xr-x  1 root  wheel  233 Dec 20 11:36 dynip.sh

I included the apache.sh line because this script appears to work as apache
starts up automatically.  This is the contents of my dynip.sh script:

112 Blacksheep# cat dynip.sh
#!/bin/sh

case "$1" in
start)
        [ -x /usr/local/bin/dynipclient ] && ( /usr/local/bin/dynipclient &
) &&
 echo -n ' dynipclient'
        ;;
stop)
        echo -n ' dynipclient'
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

This script was compliments of Don Maddox.  I don't have a clue about
writing *nix scripts but plan to learn soon.  Anyway, the attempt here is to
run a client program that registers my dynamic IP address with a DNS service
I subscribe to.  When I invoke the script manually, it appears to run fine.

125 Blacksheep# ./dynip.sh start
 dynipclientdynipclient[1483]: Using client configuration file
'/etc/dynip.cfg'
126 Blacksheep# Feb 20 08:41:20 blacksheep dynipclient[1483]: Using client
confi
guration file '/etc/dynip.cfg'
Feb 20 08:41:20 blacksheep dynipclient[1483]: Using client configuration
file '/
etc/dynip.cfg'
Feb 20 08:41:20 blacksheep dynipclient[1484]: active
Feb 20 08:41:20 blacksheep dynipclient[1484]: active

Any help diagnosing this problem would be greatly appreciated.  If there is
other information I can include to help figure this out, please let me know.
I don't know if there are log files that would show this executing or not.
If there are, please nudge me in the right direction.  If there's not, how
can I create them?

Thanks for your help!

Drew

P.S.  I apologize if this comes across as HTML.  I'm stuck with an MS$
client at work but if I can send this via an SMTP service, it will come
across as plain text.  If it goes through our Exchange server, it is HTML
even though I have specified plain text.  Gotta love M$!

--Boundary_(ID_dw+lNOj4HinCEngl/QY+bA)
Content-type: text/html; charset="iso-8859-1"
Content-transfer-encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>Newbie Help Diagnosing Startup Script</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Newbie Alert.</FONT>
</P>

<P><FONT SIZE=3D2>I am trying to diagnose why a startup script doesn't =
seem to run automatically during startup but seems to run fine when =
invoked from the command line.&nbsp; My script lives in =
/usr/local/etc/rc.d.&nbsp; I have checked the man pages and verified =
that /etc/defaults/rc.conf contains this directory in the local_startup =
line and there are no overrides in /etc/rc.conf.&nbsp; My script is =
called dynip.sh and it has the following &quot;permissions&quot; (is =
this the right term?).</FONT></P>

<P><FONT SIZE=3D2>-rwxr-x--x&nbsp; 1 root&nbsp; wheel&nbsp; 111 Sep 13 =
04:51 apache.sh</FONT>
<BR><FONT SIZE=3D2>-rwxr-xr-x&nbsp; 1 root&nbsp; wheel&nbsp; 233 Dec 20 =
11:36 dynip.sh</FONT>
</P>

<P><FONT SIZE=3D2>I included the apache.sh line because this script =
appears to work as apache starts up automatically.&nbsp; This is the =
contents of my dynip.sh script:</FONT></P>

<P><FONT SIZE=3D2>112 Blacksheep# cat dynip.sh</FONT>
<BR><FONT SIZE=3D2>#!/bin/sh</FONT>
</P>

<P><FONT SIZE=3D2>case &quot;$1&quot; in</FONT>
<BR><FONT SIZE=3D2>start)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ -x =
/usr/local/bin/dynipclient ] &amp;&amp; ( /usr/local/bin/dynipclient =
&amp; ) &amp;&amp;</FONT>
<BR><FONT SIZE=3D2>&nbsp;echo -n ' dynipclient'</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;</FONT>
<BR><FONT SIZE=3D2>stop)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -n ' =
dynipclient'</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;</FONT>
<BR><FONT SIZE=3D2>*)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo =
&quot;Usage: `basename $0` {start|stop}&quot; &gt;&amp;2</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;</FONT>
<BR><FONT SIZE=3D2>esac</FONT>
</P>

<P><FONT SIZE=3D2>exit 0</FONT>
</P>

<P><FONT SIZE=3D2>This script was compliments of Don Maddox.&nbsp; I =
don't have a clue about writing *nix scripts but plan to learn =
soon.&nbsp; Anyway, the attempt here is to run a client program that =
registers my dynamic IP address with a DNS service I subscribe =
to.&nbsp; When I invoke the script manually, it appears to run =
fine.</FONT></P>

<P><FONT SIZE=3D2>125 Blacksheep# ./dynip.sh start</FONT>
<BR><FONT SIZE=3D2>&nbsp;dynipclientdynipclient[1483]: Using client =
configuration file '/etc/dynip.cfg'</FONT>
<BR><FONT SIZE=3D2>126 Blacksheep# Feb 20 08:41:20 blacksheep =
dynipclient[1483]: Using client confi</FONT>
<BR><FONT SIZE=3D2>guration file '/etc/dynip.cfg'</FONT>
<BR><FONT SIZE=3D2>Feb 20 08:41:20 blacksheep dynipclient[1483]: Using =
client configuration file '/</FONT>
<BR><FONT SIZE=3D2>etc/dynip.cfg'</FONT>
<BR><FONT SIZE=3D2>Feb 20 08:41:20 blacksheep dynipclient[1484]: =
active</FONT>
<BR><FONT SIZE=3D2>Feb 20 08:41:20 blacksheep dynipclient[1484]: =
active</FONT>
</P>

<P><FONT SIZE=3D2>Any help diagnosing this problem would be greatly =
appreciated.&nbsp; If there is other information I can include to help =
figure this out, please let me know.&nbsp; I don't know if there are =
log files that would show this executing or not.&nbsp; If there are, =
please nudge me in the right direction.&nbsp; If there's not, how can I =
create them?</FONT></P>

<P><FONT SIZE=3D2>Thanks for your help!</FONT>
</P>

<P><FONT SIZE=3D2>Drew</FONT>
</P>

<P><FONT SIZE=3D2>P.S.&nbsp; I apologize if this comes across as =
HTML.&nbsp; I'm stuck with an MS$ client at work but if I can send this =
via an SMTP service, it will come across as plain text.&nbsp; If it =
goes through our Exchange server, it is HTML even though I have =
specified plain text.&nbsp; Gotta love M$!</FONT></P>

</BODY>
</HTML>

--Boundary_(ID_dw+lNOj4HinCEngl/QY+bA)--

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?BA5D0CE1CBB2D411B6AA00A0CC3F0239C02537>