@@ -31,7 +31,10 @@ type Process struct {
3131func (p * Process ) IsWorker () bool { return strings .HasPrefix (p .Cmd , "nginx: worker" ) }
3232
3333// IsMaster returns true if the process is a NGINX master process.
34- func (p * Process ) IsMaster () bool { return strings .HasPrefix (p .Cmd , "nginx: master" ) }
34+ func (p * Process ) IsMaster () bool {
35+ return strings .HasPrefix (p .Cmd , "nginx: master" ) ||
36+ strings .HasPrefix (p .Cmd , "{nginx-debug} nginx: master" )
37+ }
3538
3639// IsShuttingDown returns true if the process is shutting down. This can identify workers that are in the process of a
3740// graceful shutdown. See [changing NGINX configuration] for more details.
@@ -66,13 +69,14 @@ func convert(ctx context.Context, p *process.Process, o options) (*Process, erro
6669 }
6770
6871 name , _ := p .NameWithContext (ctx ) // slow: shells out to ps
69- if name != "nginx" {
72+ if name != "nginx" && name != "nginx-debug" {
7073 return nil , errNotAnNginxProcess
7174 }
7275
7376 cmdLine , _ := p .CmdlineWithContext (ctx ) // slow: shells out to ps
7477 // ignore nginx processes in the middle of an upgrade
75- if ! strings .HasPrefix (cmdLine , "nginx:" ) || strings .Contains (cmdLine , "upgrade" ) {
78+ if ! strings .HasPrefix (cmdLine , "nginx:" ) || ! strings .HasPrefix (cmdLine , "{nginx-debug} nginx:" ) ||
79+ strings .Contains (cmdLine , "upgrade" ) {
7680 return nil , errNotAnNginxProcess
7781 }
7882
0 commit comments