A startup refusal under the Windows service reaches the event log and the Service Control Manager #336
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lantea-one/ninlil#336
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every deliberate startup refusal in
Program.cs(thecatch (DatabaseStartupRefusedException ...)handlers: the key-ring certificate checks added by #42 and the database migration refusals) logs through a throwawayLoggerFactory.Create(logging => logging.AddConsole()), then setsEnvironment.ExitCode = 78and returns. Under the Windows service (UseWindowsService) there is no console. Observed on Lofnheim (Windows 10.0.26200) on 2026-11-05 with a wrongNINLIL_DATA_PROTECTION_CERTIFICATE_PASSWORD:Start-Service Ninlilreturns, and the service goes toStopped.sc.exe query NinlilreportsWIN32_EXIT_CODE 0andSERVICE_EXIT_CODE 0, not 78.Ninlil.Web, though the source is registered.The same executable run from a console prints
crit: ... Startup refused: DataProtection:CertificatePath names the file ... check DataProtection:CertificatePasswordand exits with 78, so the refusal logic is right; only its reporting under the service is missing.What changes
WindowsServiceHelpers.IsWindowsService()), each refusal handler also writes the message to the Application event log underNinlil.Web(the source the README's install steps register), as an error. If the source is not registered, fall back without throwing.SERVICE_EXIT_CODE78,WIN32_EXIT_CODE1066) if the refusal happens after the service registered with the SCM, or otherwise make sure the process exit code is 78 and document whatsc.exe queryshows.Get-WinEventcommand to read it.Acceptance
Start-Service Ninlilleaves an error event underNinlil.Webthat names the setting, without the password;sc.exe query Ninlilshows the exit as described in the README.Source
Windows acceptance of #42 on Lofnheim, 2026-11-05.
Refs #42
Ghost referenced this issue2026-11-05 21:26:37 -05:00
Ghost referenced this issue2026-11-06 01:58:42 -05:00