[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2020-11-24 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

Mark Johnston  changed:

   What|Removed |Added

 Resolution|--- |Overcome By Events
 CC||ma...@freebsd.org
 Status|Open|Closed

--- Comment #4 from Mark Johnston  ---
Indeed, daemon(8) can now redirect output to a file.  This is not quite the
same as the proposed functionality but is hopefully sufficient.  Please re-open
if not.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2017-04-22 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

--- Comment #3 from Dave Cottlehuber  ---
specifically `-o /var/log/thing.log -m 3`

 -o output_file
 Append output from the daemonized process to output_file.  If the
 file does not exist, it is created with permissions 0600.

 -m output_mask
 Redirect output from the child process stdout (1), stderr (2), or
 both (3).  This value specifies what is sent to syslog and the
 log file.  The default is 3.

from
https://www.freebsd.org/cgi/man.cgi?query=daemon&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2017-04-22 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

--- Comment #2 from Dave Cottlehuber  ---
worth mentioning https://svnweb.freebsd.org/base?view=revision&revision=307769
now in 12.0-CURRENT which looks like it provides the same functionality. Maybe
this can be closed?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2016-09-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

--- Comment #1 from Dave Cottlehuber  ---
Super idea!

I've come across a couple of daemons just this week that fall into this
category. Both are golang ports "designed" to run in docker/systemd land where
stdio is handled by some parent container, e.g. security/vault being one of
them.

I can't tell if this is already the case, but it would be ideal for the
redirected io to go into a file owned by whatever `-u $USER` was passed into
daemon, instead of root, good for managing disk quotas and smaller systems
where out of control log files have caused systems to stop due to disk full
issues.

I can't test until 110.0 has landed but I'd also want to know if log rotation
plays nicely with this or not.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2016-02-28 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

Kubilay Kocak  changed:

   What|Removed |Added

Version|10.2-RELEASE|11.0-CURRENT
   Keywords||feature, needs-qa
   Severity|Affects Only Me |Affects Many People
 Status|New |Open
  Flags||mfc-stable10?
   Priority|--- |Normal

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 207248] [patch] daemon(8): Add option to redirect stdout and stderr to a file

2016-02-16 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207248

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: m...@cschwarz.com
  Keywords: patch

Created attachment 167080
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=167080&action=edit
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 stderr 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 code.

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"