Wording Changes
This commit is contained in:
@@ -49,11 +49,11 @@ pub struct EnrollArgs {
|
|||||||
/// One-time or short-lived enroll token provided by the control plane.
|
/// One-time or short-lived enroll token provided by the control plane.
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub enroll_token: String,
|
pub enroll_token: String,
|
||||||
/// Path to the agent config file to write.
|
/// Path to the agent config file to write (overwritten on successful enroll).
|
||||||
#[arg(long, default_value = config::DEFAULT_CONFIG_PATH)]
|
#[arg(long, default_value = config::DEFAULT_CONFIG_PATH)]
|
||||||
pub config: PathBuf,
|
pub config: PathBuf,
|
||||||
|
|
||||||
/// Reload a running daemon after writing config.
|
/// Reload a running daemon after writing config so the new config takes effect immediately.
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub reload_running: bool,
|
pub reload_running: bool,
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ async fn main() -> Result<()> {
|
|||||||
let config = enroll::enroll(&args.server_url, &args.enroll_token, &args.config).await?;
|
let config = enroll::enroll(&args.server_url, &args.enroll_token, &args.config).await?;
|
||||||
println!("agent_id={}", config.agent_id);
|
println!("agent_id={}", config.agent_id);
|
||||||
println!("config={}", args.config.display());
|
println!("config={}", args.config.display());
|
||||||
|
println!("config_write=updated");
|
||||||
if args.reload_running {
|
if args.reload_running {
|
||||||
match serve::reload_daemon(&args.pid_file) {
|
match serve::reload_daemon(&args.pid_file) {
|
||||||
Ok(()) => println!("reload=signaled pid_file={}", args.pid_file.display()),
|
Ok(()) => println!("reload=signaled pid_file={}", args.pid_file.display()),
|
||||||
@@ -33,6 +34,13 @@ async fn main() -> Result<()> {
|
|||||||
::tracing::warn!(error = %err, pid_file = %args.pid_file.display(), "enroll completed but daemon reload failed")
|
::tracing::warn!(error = %err, pid_file = %args.pid_file.display(), "enroll completed but daemon reload failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
println!("reload=not_requested");
|
||||||
|
println!("runtime_config=unchanged_until_reload_or_restart");
|
||||||
|
println!(
|
||||||
|
"next=wakey-agent reload --pid-file {} # or restart wakey-agent",
|
||||||
|
args.pid_file.display()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Command::InitConfig(args) => init_config(args)?,
|
Command::InitConfig(args) => init_config(args)?,
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ use crate::{config, session};
|
|||||||
pub async fn serve(args: ServeArgs) -> Result<()> {
|
pub async fn serve(args: ServeArgs) -> Result<()> {
|
||||||
if !args.config.exists() {
|
if !args.config.exists() {
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"agent config {} not found. Run `wakey-agent enroll --server-url <url> --enroll-token <token>` or `wakey-agent init-config --config {}` first",
|
"agent config {} not found. Run `wakey-agent enroll --server-url <url> --enroll-token <token> --config {}` or `wakey-agent init-config --config {}` first",
|
||||||
|
args.config.display(),
|
||||||
args.config.display(),
|
args.config.display(),
|
||||||
args.config.display()
|
args.config.display()
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user