File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ fn java_ps_name(proc_name_pre: &ProcNamePre) -> Option<String> {
104104 let special = & |arg : & str , next : Option < & str > | {
105105 if arg == "-jar" {
106106 ControlFlow :: Break (
107- next. filter ( |jar| jar. ends_with ( ".jar" ) )
107+ next. filter ( |jar| jar. ends_with ( ".jar" ) || jar . ends_with ( ".war" ) )
108108 . map ( |s| s. to_owned ( ) ) ,
109109 )
110110 } else {
@@ -454,4 +454,25 @@ mod test {
454454 } ) ;
455455 assert_eq ! ( name. as_deref( ) , Some ( "node serve.js" ) ) ;
456456 }
457+
458+ #[ test]
459+ fn airsonic ( ) {
460+ let exe = "/nix/store/foobar-openjdk-8u432-b06-jre/lib/openjdk/jre/bin/java" ;
461+ let cmdline = [
462+ exe,
463+ "-Xmx2500m" ,
464+ "-Dairsonic.home=/var/lib/airsonic" ,
465+ "-Dserver.address=127.0.0.1" ,
466+ // …
467+ "-verbose:gc" ,
468+ "-jar" ,
469+ "/nix/store/bababar-airsonic-10.6.2/webapps/airsonic.war" ,
470+ ] ;
471+ let name = super :: java_ps_name ( & ProcNamePre {
472+ name : Some ( "java" . into ( ) ) ,
473+ exe : Some ( exe. into ( ) ) ,
474+ cmdline : Some ( cmdline. into_iter ( ) . map ( ToOwned :: to_owned) . collect ( ) ) ,
475+ } ) ;
476+ assert ! ( name. map( |s| s. strip_suffix( ".war" ) . is_some( ) ) == Some ( true ) ) ;
477+ }
457478}
You can’t perform that action at this time.
0 commit comments