From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1I91Ps-0003cD-8a for garchives@archives.gentoo.org; Thu, 12 Jul 2007 16:21:20 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l6CGK6K9006830; Thu, 12 Jul 2007 16:20:06 GMT Received: from smtp1.iway.na (smtp1.iway.na [196.44.136.15]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l6CGFo2P002046 for ; Thu, 12 Jul 2007 16:15:54 GMT Received: from vscan.iway.na (vscan.iway.na [196.44.136.13]) by smtp1.iway.na (Postfix) with ESMTP id 29674659C for ; Thu, 12 Jul 2007 17:15:39 +0100 (WAT) Received: from mx1.iway.na (localhost [127.0.0.1]) by vscan.iway.na (Postfix) with ESMTP id 16CB51C1C22 for ; Thu, 12 Jul 2007 17:15:41 +0100 (WAT) Received: from [192.168.1.10] (unknown [41.205.134.197]) by mx1.iway.na (Postfix) with ESMTP id 20AF4C30 for ; Thu, 12 Jul 2007 17:15:40 +0100 (WAT) From: Uwe Thiem Organization: SysEx (Pty) Ltd. To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] debugging init scripts Date: Thu, 12 Jul 2007 17:15:40 +0100 User-Agent: KMail/1.9.7 References: <13b70780707120832h3c8200eelc88b644fe9b4f9af@mail.gmail.com> In-Reply-To: <13b70780707120832h3c8200eelc88b644fe9b4f9af@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707121715.40746.uwix@iway.na> X-Archives-Salt: a48eb9f5-2e6c-42c4-950b-bacc2326cab4 X-Archives-Hash: e8fbcb60c0b4633e87420ae0abb6a520 On 12 July 2007, Frank Wilson wrote: > I'm trying to debug an init script / daemon I'm trying to run. I can't > seem to print the debug output to print to a file. For example I > enter: > > /etc/init.d/apache2 restart --debug >> /root/apache2.debug > > or > > /etc/init.d/apache2 restart --debug > /root/apache2.debug > > but I get none of the debug output. Also less insists that > /root/apache2.debug is a binary file... not sure why. First of all, you should do something like "/etc/init.d/apache2 restart --debug > /root/apache2.debug 2>&1" to catch both, standard and error output. Still, this won't work in your case. The output you usually see on screen, is *not* generated by the script (or the executing shell) but by the commands used in the script. So keep a backup of the original script, then dive into it with your favourite editor and append ">> /root/apache2.debug 2>&1" to all relevant commands. Uwe -- Jethro Tull: Maybe, I am not done yet! -- gentoo-user@gentoo.org mailing list