From owner-freebsd-bugs@freebsd.org Tue Feb 16 14:22:19 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E2FCAA96CE for ; Tue, 16 Feb 2016 14:22:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90D61C7B for ; Tue, 16 Feb 2016 14:22:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1GEMI5h032553 for ; Tue, 16 Feb 2016 14:22:18 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file Date: Tue, 16 Feb 2016 14:22:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: me@cschwarz.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2016 14:22:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207248 Bug ID: 207248 Summary: [patch] daemon(8): Add option to redirect stdout and stderr to a file Product: Base System Version: 10.2-RELEASE Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: me@cschwarz.com Keywords: patch Created attachment 167080 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D167080&action= =3Dedit Patch for daemon(8) and its man page enabling IO redirection. Some applications that are daemonized using daemon(8) do not provide means = to write log files. stdout / stderr is their only way to provide output. While this behavior is debatable, we already built a tool that deals with applications that do not daemonize themselves, daemon(8). Currently, daemon(8) only has a flag `-f` to redirect both stdout and stder= r to /dev/null. Setting the flag causes the daemon(3) call to be called with daemon(*, 0). However, daemon(3) does not provide means to specify alternative redirection destinations. The patch attached to this bug report adds flags `-e`, `-o` and `-a` to daemon(8) that can be used instead of `-f` to redirect stderr and stdout to specified file paths. `-a` is used to toggle appending instead of overwriting the specified path. The man page has been updated to reflect the changes made to the source cod= e. The flags have been chosen semantically and syntactically identical to `http://software.clapper.org/daemonize/` which is a tool available both in = many Linux distributions and in the ports tree. However, I would like to see the features implemented in this patch in the = base system. (Naturally, ) I think the code provided by this patch is much more straight forward and cleaner than the aforementioned third party tool. --=20 You are receiving this mail because: You are the assignee for the bug.=