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 |