[GH-ISSUE #27] startup: syslogd starts after 0800_Network, so boot-time dhcpcd messages are lost #24

Closed
opened 2026-11-03 22:02:28 -07:00 by gitea-mirror · 0 comments
Owner

Originally created by @raynorpat on GitHub (Sep 25, 2026).
Original GitHub issue: https://github.com/RhapsodiOS/RhapsodiOS/issues/27

Symptom

Nothing that the startup scripts before 0900_SystemLog send through syslog(3) reaches /var/log/system.log or the console. This showed up while boot-testing dhcpcd on the i386 guest. 0800_Network runs dhcpcd -w -t 30 en0, and none of that run's messages were logged: the lease, a DHCP_NAK, "timed out waiting for a valid DHCP server response". The same messages appear normally when dhcpcd is run by hand after boot.

Kernel messages are not affected, because syslogd reads the kernel message buffer when it starts. Only userland syslog() calls made before syslogd exists are lost.

Cause

In src/files-5/private/etc/startup/, 0900_SystemLog starts syslogd after 0800_Network; Apple's DR2 layout has the same order (0400_Network, then 0700_SystemLog). Until then /dev/log does not exist. syslog(3) drops the message unless the caller opened the log with LOG_CONS. dhcpcd opens it as openlog("dhcpcd", LOG_PID, LOG_LOCAL0) (src/dhcpcd-1/dhcpcd.tproj/dhcpcd.c:184).

Other daemons and tools started in 0100–0800 are probably affected the same way. I only checked dhcpcd.

Constraint on moving syslogd earlier

syslogd reads the hostname once, in main() (src/Commands/network_cmds/syslogd.tproj/syslogd.c:271), and SIGHUP does not refresh it. 0800_Network is what sets the hostname, so a syslogd started earlier would stamp every line with the pre-network name (localhost) for the whole run. It would also resolve any @host forwarding entries before the network is up.

Options

  • Start syslogd before 0800_Network (after 0100_LocalMounts/0400_CleanUp), and have it pick up the hostname later. For example, restart it after 0800_Network, or make init() re-read the hostname on SIGHUP and HUP it from 0800_Network.
  • Keep the order, and have early daemons open the log with LOG_CONS so their messages at least reach the console. For dhcpcd that is a one-flag change, but it doesn't help anything else.

Found during the dhcpcd-1 guest checklist (docs/superpowers/plans/2026-09-22-dhcpcd-1-client-daemon.md, Task 8). It is why that checklist can't show boot-time DHCP message traces.

Originally created by @raynorpat on GitHub (Sep 25, 2026). Original GitHub issue: https://github.com/RhapsodiOS/RhapsodiOS/issues/27 ## Symptom Nothing that the startup scripts before `0900_SystemLog` send through syslog(3) reaches `/var/log/system.log` or the console. This showed up while boot-testing dhcpcd on the i386 guest. `0800_Network` runs `dhcpcd -w -t 30 en0`, and none of that run's messages were logged: the lease, a DHCP_NAK, "timed out waiting for a valid DHCP server response". The same messages appear normally when dhcpcd is run by hand after boot. Kernel messages are not affected, because syslogd reads the kernel message buffer when it starts. Only userland `syslog()` calls made before syslogd exists are lost. ## Cause In `src/files-5/private/etc/startup/`, `0900_SystemLog` starts `syslogd` after `0800_Network`; Apple's DR2 layout has the same order (`0400_Network`, then `0700_SystemLog`). Until then `/dev/log` does not exist. `syslog(3)` drops the message unless the caller opened the log with `LOG_CONS`. dhcpcd opens it as `openlog("dhcpcd", LOG_PID, LOG_LOCAL0)` (`src/dhcpcd-1/dhcpcd.tproj/dhcpcd.c:184`). Other daemons and tools started in 0100–0800 are probably affected the same way. I only checked dhcpcd. ## Constraint on moving syslogd earlier `syslogd` reads the hostname once, in `main()` (`src/Commands/network_cmds/syslogd.tproj/syslogd.c:271`), and SIGHUP does not refresh it. `0800_Network` is what sets the hostname, so a syslogd started earlier would stamp every line with the pre-network name (`localhost`) for the whole run. It would also resolve any `@host` forwarding entries before the network is up. ## Options - Start syslogd before `0800_Network` (after `0100_LocalMounts`/`0400_CleanUp`), and have it pick up the hostname later. For example, restart it after `0800_Network`, or make `init()` re-read the hostname on SIGHUP and HUP it from `0800_Network`. - Keep the order, and have early daemons open the log with `LOG_CONS` so their messages at least reach the console. For dhcpcd that is a one-flag change, but it doesn't help anything else. Found during the dhcpcd-1 guest checklist (`docs/superpowers/plans/2026-09-22-dhcpcd-1-client-daemon.md`, Task 8). It is why that checklist can't show boot-time DHCP message traces.
gitea-mirror 2026-11-03 22:02:28 -07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github-starred/RhapsodiOS#24
No description provided.