File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ cargo test -p emergency-room
5656# Memory pressure / oomd observer (read-only, no process killing)
5757./target/debug/emergency-room pulse --once
5858./target/debug/emergency-room pulse --poll-seconds 20
59+ ./target/debug/emergency-room pulse --doctor
5960
6061# Install as user service
6162./emergency-room/systemd/install-pulse.sh
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ struct PulseArgs {
9292 /// Run one iteration and exit
9393 #[ arg( long) ]
9494 once : bool ,
95+ /// Run self-diagnostics and print a health report as JSON
96+ #[ arg( long) ]
97+ doctor : bool ,
9598 #[ arg( short = 'n' , long) ]
9699 dry_run : bool ,
97100}
@@ -210,6 +213,14 @@ fn run_pulse(args: PulseArgs) {
210213 dry_run : args. dry_run ,
211214 } ;
212215
216+ if args. doctor {
217+ if let Err ( e) = pulse:: doctor ( & cfg) {
218+ eprintln ! ( "\x1b [31m[ERROR]\x1b [0m pulse doctor failed: {e}" ) ;
219+ std:: process:: exit ( 1 ) ;
220+ }
221+ return ;
222+ }
223+
213224 if let Err ( e) = pulse:: run ( cfg) {
214225 eprintln ! ( "\x1b [31m[ERROR]\x1b [0m pulse failed: {e}" ) ;
215226 std:: process:: exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments