Douglas Muth on 15 Jan 2014 16:38:46 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] debugging an init script


On Wed, Jan 15, 2014 at 11:46 AM, Carl Johnson
<cjohnson19791979@gmail.com> wrote:
> Can someone in PLUG can help me out? My google-fu isn't that strong today.
>
> I've a Centos 6.5 box that has a service that won't start. Every time I run
> "service <script name> start" I get a red "[FAILED] message.
>
> Does anyone have any idea how I can log/watch/debug this script to see
> why/where it's failing as it runs? Can I redirect the sub-shell output to a
> logfile somehow? Is there a way to make it send all output to stdout?
>

It's a bit of hack, but append this to every line in that file:

2>&1 | logger -t "init.d script"

I once caught an issue with nginx that way where I had a race
condition at bootup that caused nginx to bomb because the IPv6 network
stack hadn't yet been loaded, but nginx wanted to use IPv6, and bailed
with an error as IPv6 was not available.  That error only went out to
the console, and was missed because I was on a VM.  Logging it picked
it up.

-- Doug

-- 
Douglas T. Muth * Philadelphia, PA, USA
http://www.dmuth.org/
http://twitter.com/dmuth
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug