Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2001 10:38:54 -0800
From:      Drew Tomlinson <drewt@writeme.com>
To:        'Mike Meyer' <mwm@mired.org>
Cc:        "FreeBSD Questions (E-mail)" <freebsd-questions@FreeBSD.org>
Subject:   RE: Startup Script
Message-ID:  <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF887@ldcmsx01.lc.ca.gov>
In-Reply-To: <BA5D0CE1CBB2D411B6AA00A0CC3F0239D8461A@ldcmsx01.lc.ca.gov>

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


> -----Original Message-----
> From: Mike Meyer [mailto:mwm@mired.org]
> Sent: Tuesday, February 27, 2001 11:51 PM
> To: Drew Tomlinson
> Subject: Re: Startup Script
>
>
> Drew Tomlinson <drewt@writeme.com> types:
> > I have created a script (with a lot of help from this list)
> to start my
> > dynamic DNS client (dynipclient).  The service I use is
> www.dynip.com.  Here
> > is my script:
> >
> > 103 Blacksheep# cat dynip.sh
> > #!/bin/sh
> >
> > case "$1" in
> > start)
> >         /usr/local/bin/dynipclient
> >         echo -n ' dynipclient'
> >         ;;
> > stop)
> >         /usr/local/bin/dynipclient -k
> >         ;;
> > *)
> >         echo "Usage: `basename $0` {start|stop}" >&2
> >         ;;
> > esac
> >
> > exit 0
> >
> > The file is set as executable and the script runs fine when
> I initialize it
> > from /usr/local/etc/rc.d as ./dynip.sh and pass either the
> "start" or "stop"
> > argument.  However, after a reboot, the dynip client is not
> successfully
> > started.
> >
> > As I watch the system boot, I see the following messages:
> >
> > Local package initialization: apachedynipclient[194]: Using client
> > configuration
> >  file '/etc/dynip.cfg'
> > Feb 27 15:16:47 blacksheep dynipclient[194]: Using client
> configuration file
> > '/etc/dynip.cfg'
> >  dynipclientFeb 27 15:16:47 blacksheep dynipclient[195]: active
> >
> > Doesn't this mean that the dynipclient program was started
> as process ID
> > 195?  But when I logon the system, the process is not
> there.  What is
> > causing this behavior and how can I fix it?
>
> I don't know anything about dynipclient, but the script looks fine to
> me - assuming that dynipclient is somehow detaching itself so the
> command the shell started is exiting. Are you checking for
> "dynipclient", or for pid 195? If the former, dynipclient may have a
> different name than you expect, so check for the latter.

Both.  Neither the process ID is there, nor is a process with the name
"dynipclient".  When the dynipclient command is issued from the command
line, the process just starts and can be found in the process list:

103 Blacksheep# dynipclient
dynipclient[1599]: Using client configuration file '/etc/dynip.cfg'
Feb 28 10:29:43 blacksheep dynipclient[1599]: Using client configuration
file '/
etc/dynip.cfg'
104 Blacksheep# Feb 28 10:29:43 blacksheep dynipclient[1599]: Using client
confi
guration file '/etc/dynip.cfg'
Feb 28 10:29:43 blacksheep dynipclient[1600]: active
Feb 28 10:29:43 blacksheep dynipclient[1600]: active

104 Blacksheep# ps -acux
USER           PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED      TIME COMMAND
root          1600  0.0  1.4   888  628  p0  S    10:29AM   0:00.05
dynipclient

This script also works fine when invoked from the command line:

109 Blacksheep# /usr/local/etc/rc.d/dynip.sh start
dynipclient[1611]: Using client configuration file '/etc/dynip.cfg'
Feb 28 10:32:32 blacksheep dynipclient[1611]: Using client configuration
file '/
etc/dynip.cfg'
Feb 28 10:32:32 blacksheep dynipclient[1611]: Using client configuration
file '/
etc/dynip.cfg'
 dynipclient110 Blacksheep#     Feb 28 10:32:32 blacksheep
dynipclient[1612]: ac
tive
Feb 28 10:32:32 blacksheep dynipclient[1612]: active

111 Blacksheep# ps -acux
USER           PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED      TIME COMMAND
root          1612  0.0  1.4   888  628  p0  I    10:32AM   0:00.05
dynipclient

>
> > I am a newbie and know basically nothing about scripts.
> But I suspect what
> > might be happening is that the dynipclient starts in the
> first line but then
> > is stopped because of the command in the second.  Am I
> correct?  Any ideas?
>
> No, that's not correct.
>
> If something is causing the server part of the package to exit, see
> what you can do to get a log - preferably detailed - from the
> server. If www.dynip.com provides a sample startup script, you might
> check that and see if they are doing anything odd when it starts the
> program.

OK, I would like to get a log but I don't know how to go about that.  Do you
have any suggestions?  I assume I need to pipe the output to a file?  I
don't even know how to do that exactly.  Sorry for the "dumb" questions and
thanks for your help.

Drew

>
> 	<mike
> --
> Mike Meyer <mwm@mired.org>
http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more
information.


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