From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2158 Path: news.gmane.org!not-for-mail From: Mike Pomraning Newsgroups: gmane.comp.sysutils.supervision.general Subject: [PATCH] chpst in/out/err enhancement Date: Thu, 27 Sep 2012 15:58:11 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=14dae93409b3ab0ea104cab533b0 X-Trace: ger.gmane.org 1348779518 19299 80.91.229.3 (27 Sep 2012 20:58:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2012 20:58:38 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2392-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Sep 27 22:58:43 2012 Return-path: Envelope-to: gcsg-supervision@plane.gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1THLAQ-00068g-Kd for gcsg-supervision@plane.gmane.org; Thu, 27 Sep 2012 22:58:42 +0200 Original-Received: (qmail 21998 invoked by uid 76); 27 Sep 2012 20:00:01 -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 21990 invoked from network); 27 Sep 2012 20:00:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pilcrow.madison.wi.us; s=default; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version; bh=VZ8ujHU2p03wAf5OQjyGsIgZnxjtUYprAoGXMLpJ2UQ=; b=YuA/5XAiwy+wnhk8gU8mgKlJSQO8qAfSitcrYNBgynuCqTL/p0PZ+vw4ehTfzipaf8t07DRRNLmom4l5v+FZxkfpNudJTKLck58ZgPsyr3yMf5TiBtm/zoXdc/FAwyb/; X-Identified-User: {2442:box462.bluehost.com:pomranin:pilcrow.madison.wi.us} {sentby:smtp auth 209.85.223.172 authed with mjp@pilcrow.madison.wi.us} Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2158 Archived-At: --14dae93409b3ab0ea104cab533b0 Content-Type: text/plain; charset=ISO-8859-1 The attached patch: 1. Preserves complaints to standard error even under '-2' 2. Adds a '-N' ("null device") flag which modifies '-[012]' to redirect /dev/null with appropriate access modes, rather than merely closing fds 3. Documents #2 Rationale: #1 above helps me debug otherwise quiet ``chpst -2 /oops/enoent'' typographical errors. #2 guards against some programs' naive assumptions about the availability and nature of fds 0, 1 and 2. Implementation notes: The '-N' flag redirects before chroot, and respects the improved semantics of '-2' (that is, chpst can still complain of exec failures). Unmodified '-[012]' are now implemented with close-on-exec rather than close(). Other than the possibility of new complaints to stderr under '-2', the patch is behaviorally backward compatible. Let me know if you think this is wrong-headed. -Mike --14dae93409b3ab0ea104cab533b0--