Subject: [bug#77943] [PATCH 1/2] services: shepherd: Provide the right #:kernel-log-file on the Hurd.

From: [email-masked]
Date: Tue, 26 Aug 2025 18:16:50 +0200 (CEST)

Aug 25, 2025, 19:53 by [email-masked]:

> Hello,
>
> [email-masked] writes:
>
>> No i have not sent this:
>> Something like this fixes the D_WOULD_BLOCK errno.
>> --8<---------------cut here---------------start------------->8---
>> diff --git a/trans/streamio.c b/trans/streamio.c
>> index e42ff908..93057146 100644
>> --- a/trans/streamio.c
>> +++ b/trans/streamio.c
>> @@ -1049,6 +1049,8 @@ device_read_reply_inband (mach_port_t reply, kern_return_t errorcode,
>>  
>>    input_pending = 0;
>>    err = errorcode;
>> +  if (err == D_WOULD_BLOCK)
>> +    err = EWOULDBLOCK;
>>    if (!err)
>>      {
>>        if (datalen == 0)
>> --8<---------------cut here---------------end--------------->8---
>>
>
> Neat!  You should send this and the C reproducer to bug-hurd.  :-)
>
>> It is fine in the sense that fibers suspends the system-log successfully at the "end" of /dev/klog.
>> However It is not fine because it will never wake up it up again. 
>> According to the c example it now returns EWOULDBLOCK as expected.From testing around a bit I think it might be (@ (ice-9 rdelim) read-line) waiting for a terminating newline.
>> And again when I retried this just now there was the noticable delay with anything shepherd when the shepherd-syslog is running (default (system-log-configuration) configuration)
>>
>
> Great.  So… mission accomplished?
>

Not really. The system-log still stops working when it reaches the EWOULDBLOCK at the end of of the kernel log.
I think it has to do with the incomplete last message that is causing the system-log fiber to be suspended at the wrong time but I don't really know.
I have sent the diff to bug-hurd and also asked about the missing \n there.

> Thank you!
> Ludo’.