-o option for start-stop-daemon
Peter Korsgaard
peter at korsgaard.com
Sat Nov 4 09:51:35 UTC 2023
>>>>> "Louai" == Louai Al-Khanji <louai at astranis.com> writes:
> On Wed, Nov 1, 2023 at 11:53 PM Louai Al-Khanji <louai at astranis.com> wrote:
>>
>> Hi,
>>
>> I am interested in implementing the -o|--output option that the
NIT: It is -O, not -o.
> +#if ENABLE_FEATURE_START_STOP_DAEMON_FANCY
> + if (opt & OPT_OUTPUT) {
> + int output_fd = xopen(output, O_CREAT | O_WRONLY);
> + original_stdout = xdup(STDOUT_FILENO);
> + original_stderr = xdup(STDERR_FILENO);
> + xdup2(output_fd, STDOUT_FILENO);
> + xdup2(output_fd, STDERR_FILENO);
> + }
-O is documented to only work with the -b, so wouldn't it make more
sense to add this logic around bb_daemon_helper() instead, then you also
don't have to clean it up again?
--
Bye, Peter Korsgaard
More information about the busybox
mailing list