[NTLUG:Discuss] Script help
Rick Renshaw
bofh69 at yahoo.com
Tue Sep 14 17:12:49 CDT 2010
> ----- Original Message ----
> From: Hank Ivy <hankivy at hot.rr.com>
> To: discuss at ntlug.org
> Cc: Fred <fredstevens at yahoo.com>
> Sent: Tue, September 14, 2010 12:27:58 PM
> Subject: Re: [NTLUG:Discuss] Script help
>
> While cron is a good idea, another goal is to learn about the system. To
>learn, I would add
>
> lines like:
>
> (echo -n "pingtest started " ; date) >> $LOG
>
> (echo -n "pingtest step run " ; date) >> $LOG
>
> (echo -n "pingtest finished " ; date) >> $LOG
>
> Add them to your script in the appropriate places, and see if there is a
>pattern.
>
> You may also want to add a trap, or traps that will tell you if a signal has
>occurred.
>
> On Tuesday, September 14, 2010 11:15 am Fred wrote:
> > I am somewhat embarassed because I can't remember how to do this:
> >
> > I wrote a little script that works just fine when I invoke it manually
> > but when I put it into the /etc/init.d startup scrip "local" (where I have
> > other misc scripts) it refuses to start... or continue to run after the
> > rc5.d quits, or whatever. Bottom line is that when I do a ps -ef |grep
> > <scriptname>
> > it is not running.
> >
>
> --
> Hank Ivy
>
> GPG Fingerprint:
> 1A0F E1CB 0160 0069 7C19 4B00 911C 92E8 F8B0 4C7C
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
It's always a good idea to use the full path to commands used in scripts,
especially ones that will be run by the init scripts and things like that.
For one thing, it avoids path problems like this one, and it also avoids issues
with command hijacking (a possibly malicious version of grep for instance,
earlier in your path) especially if . is in your path.
More information about the Discuss
mailing list