From ba50b1d91365308abf5d10185fe9ffeb59058d94 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Tue, 5 Dec 2023 08:49:26 -0500 Subject: [PATCH] add comment on SMF exit codes --- wicketd/src/bin/wicketd.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wicketd/src/bin/wicketd.rs b/wicketd/src/bin/wicketd.rs index 4cffd80f78..24fa802c79 100644 --- a/wicketd/src/bin/wicketd.rs +++ b/wicketd/src/bin/wicketd.rs @@ -163,6 +163,10 @@ async fn do_run() -> Result<(), CmdError> { .context("failed to initialize logger") .map_err(CmdError::Failure)?; + // When run via `svcadm refresh ...`, we need to respect the special + // [SMF exit codes](https://illumos.org/man/7/smf_method). Returning + // an error from main exits with code 1 (from libc::EXIT_FAILURE), + // which does not collide with any special SMF codes. Server::refresh_config(log, address) .await .map_err(CmdError::Failure)