From owner-freebsd-questions Wed Feb 28 10:40: 4 2001 Delivered-To: freebsd-questions@freebsd.org Received: from lcmail2.lc.ca.gov (lcmail2.lc.ca.gov [165.107.12.11]) by hub.freebsd.org (Postfix) with ESMTP id 1A40937B71B for ; Wed, 28 Feb 2001 10:39:50 -0800 (PST) (envelope-from drewt@writeme.com) Received: from CONVERSION-DAEMON by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) id <0G9H00G01D5PCR@lcmail2.lc.ca.gov> for freebsd-questions@FreeBSD.org; Wed, 28 Feb 2001 10:39:30 -0800 (PST) Received: from tagalong ([165.107.42.167]) by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) with SMTP id <0G9H00EOID4ZCQ@lcmail2.lc.ca.gov> for freebsd-questions@FreeBSD.org; Wed, 28 Feb 2001 10:38:59 -0800 (PST) Date: Wed, 28 Feb 2001 10:38:54 -0800 From: Drew Tomlinson Subject: RE: Startup Script In-reply-to: To: 'Mike Meyer' Cc: "FreeBSD Questions (E-mail)" Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----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 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 Meyer 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