[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] Fix acpid daemon logging
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2015-02-23 14:27:38
Message-ID: CAK1hOcOO9FrKk9PX0RqPhN2kpRJiY7-EUconOAzaz_gbc=+gqg () mail ! gmail ! com
[Download RAW message or body]
Applied, thanks!
On Wed, Feb 18, 2015 at 4:31 PM, Serj Kalichev <serj.kalichev@gmail.com> wrote:
> Without this patch acpid can't log the events at all. Moreover it tries
> to truncate log file every time.
>
> Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com>
> ---
> util-linux/acpid.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/util-linux/acpid.c b/util-linux/acpid.c
> index 38421c2..fc8151f 100644
> --- a/util-linux/acpid.c
> +++ b/util-linux/acpid.c
> @@ -121,10 +121,8 @@ static void process_event(const char *event)
> char *handler = xasprintf("./%s", event);
> const char *args[] = { "run-parts", handler, NULL };
>
> - // debug info
> - if (option_mask32 & OPT_d) {
> - bb_error_msg("%s", event);
> - }
> + // log the event
> + bb_error_msg("%s", event);
>
> // spawn handler
> // N.B. run-parts would require scripts to have #!/bin/sh
> @@ -256,7 +254,7 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
> /* No -d "Debug", we log to log file.
> * This includes any output from children.
> */
> - xmove_fd(xopen(opt_logfile, O_WRONLY | O_CREAT | O_TRUNC), STDOUT_FILENO);
> + xmove_fd(xopen(opt_logfile, O_WRONLY | O_CREAT | O_APPEND), STDOUT_FILENO);
> xdup2(STDOUT_FILENO, STDERR_FILENO);
> /* Also, acpid's messages (but not children) will go to syslog too */
> openlog(applet_name, LOG_PID, LOG_DAEMON);
> --
> 1.9.1
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic