Skip to content

Commit de2803c

Browse files
committed
fdctl: update kill stage to kill firedancer binaries
1 parent 1781a01 commit de2803c

File tree

1 file changed

+16
-0
lines changed
  • src/app/shared_dev/commands/configure

1 file changed

+16
-0
lines changed

src/app/shared_dev/commands/configure/kill.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ maybe_kill( config_t const * config,
5959
}
6060
}
6161

62+
if( FD_LIKELY( cmdline_len>=9UL ) ) {
63+
if( FD_UNLIKELY( !strcmp( proc_cmdline + (cmdline_len-5), "firedancer" ) ) ) {
64+
killed = 1;
65+
FD_LOG_NOTICE(( "killing process `%s` (%lu): is firedancer", proc_cmdline, pid ));
66+
if( FD_UNLIKELY( -1==kill( (int)pid, SIGKILL ) && errno!=ESRCH ) ) FD_LOG_ERR(( "kill failed (%i-%s)", errno, fd_io_strerror( errno ) ));
67+
}
68+
}
69+
70+
if( FD_LIKELY( cmdline_len>=14UL ) ) {
71+
if( FD_UNLIKELY( !strcmp( proc_cmdline + (cmdline_len-5), "firedancer-dev" ) ) ) {
72+
killed = 1;
73+
FD_LOG_NOTICE(( "killing process `%s` (%lu): is firedancer-dev", proc_cmdline, pid ));
74+
if( FD_UNLIKELY( -1==kill( (int)pid, SIGKILL ) && errno!=ESRCH ) ) FD_LOG_ERR(( "kill failed (%i-%s)", errno, fd_io_strerror( errno ) ));
75+
}
76+
}
77+
6278
if( FD_UNLIKELY( killed ) ) return killed;
6379

6480
char path[ PATH_MAX ];

0 commit comments

Comments
 (0)