Gentoo Archives: gentoo-user

From: Uwe Thiem <uwix@××××.na>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] debugging init scripts
Date: Thu, 12 Jul 2007 16:21:20
Message-Id: 200707121715.40746.uwix@iway.na
In Reply to: [gentoo-user] debugging init scripts by Frank Wilson
1 On 12 July 2007, Frank Wilson wrote:
2 > I'm trying to debug an init script / daemon I'm trying to run. I can't
3 > seem to print the debug output to print to a file. For example I
4 > enter:
5 >
6 > /etc/init.d/apache2 restart --debug >> /root/apache2.debug
7 >
8 > or
9 >
10 > /etc/init.d/apache2 restart --debug > /root/apache2.debug
11 >
12 > but I get none of the debug output. Also less insists that
13 > /root/apache2.debug is a binary file... not sure why.
14
15 First of all, you should do something like "/etc/init.d/apache2
16 restart --debug > /root/apache2.debug 2>&1" to catch both, standard and error
17 output.
18
19 Still, this won't work in your case. The output you usually see on screen, is
20 *not* generated by the script (or the executing shell) but by the commands
21 used in the script.
22
23 So keep a backup of the original script, then dive into it with your favourite
24 editor and append ">> /root/apache2.debug 2>&1" to all relevant commands.
25
26 Uwe
27
28 --
29 Jethro Tull: Maybe, I am not done yet!
30 --
31 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] debugging init scripts Thomas Tuttle <gentoo@×××××××.net>