From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2063 Path: news.gmane.org!not-for-mail From: Ryan Oertel Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: check script - bad file descriptor? Date: Sun, 7 Nov 2010 15:33:10 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001485e7c7ba19b80f04947d4175 X-Trace: dough.gmane.org 1289165600 29025 80.91.229.12 (7 Nov 2010 21:33:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 7 Nov 2010 21:33:20 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2297-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Nov 07 22:33:15 2010 Return-path: Envelope-to: gcsg-supervision@lo.gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1PFCrT-0008Np-6R for gcsg-supervision@lo.gmane.org; Sun, 07 Nov 2010 22:33:15 +0100 Original-Received: (qmail 4622 invoked by uid 76); 7 Nov 2010 21:35:21 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 4612 invoked from network); 7 Nov 2010 21:35:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=fKOhGRoKVWu3kWy8uQqWmrE6MGai6xg5Z9bmkkna+3A=; b=c95h8JW72SICNr1AXNyDVYF5JQezCAWcpyk1I2fQCDIcbXIW7+2uCzdD5Uu5aOFK1W ecqT8p48cEe0iTKspIhxei9bhLusipXGF5jlDBBYsBXCXspp6HVg5/evxi45oFB1U0TV A9A0hfCLU6s7bOBfGHHzw15PEXHIyV0xUOQsw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ETV9O37HLrHm0s7BVl3gATXS0ZdpdPRB8h/H4Sh0YIO/LXQPZr/AHVjEPyp1JAggO8 E78RuDxqC2s4IDjKC5wPNewU25kyxD8jJWhKRWUDET1DW3MwaeIFSLYpAY5+4c/6/CVK Nd6ZxlKj5xJJku+D0mC8aHCyLhVrpiyBMxyo0= In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2063 Archived-At: --001485e7c7ba19b80f04947d4175 Content-Type: text/plain; charset=ISO-8859-1 I'm trying to write a check script for a service I've got installed. The Check script, when run by root returns an exit code of 0 on success and 1 on failure and does not output anything. When running "sv check mythbackend", it give me some errors, even though successful: /bin/grep: write error: Bad file descriptor ok: run: mythbackend: (pid 19728) 2287s When there is a problem, it will print the bad file descriptor error a few times per second for 7 seconds. The script is below. It seems that the check script is run in a more restrictive environment, but I can't find any documentation about this. Can anybody tell me why it works as root, but not when called through sv? check script (-rwx------ 1 root root 82 2010-11-07 14:34 check) #!/bin/bash /usr/bin/curl -s http://localhost:6544 | /bin/grep -q "MythTV Status" --001485e7c7ba19b80f04947d4175--