Skip to content

Commit 71a27ce

Browse files
committed
Implemented #7468: Add switch to control in guardian timeout before killing firebird server process
1 parent 0a54663 commit 71a27ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/utilities/guard/guard.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
9393
const TEXT* prog_name = argv[0];
9494
const TEXT* pidfilename = 0;
9595
int guard_exit_code = 0;
96+
int timeout_term = 30;
9697

9798
const TEXT* const* const end = argc + argv;
9899
argv++;
@@ -117,9 +118,13 @@ int CLIB_ROUTINE main( int argc, char **argv)
117118
case 'P':
118119
pidfilename = *argv++;
119120
break;
121+
case 'T':
122+
timeout_term = atoi(*argv++);
123+
break;
120124
default:
121125
fprintf(stderr,
122-
"Usage: %s [-signore | -onetime | -forever (default)] [-daemon] [-pidfile filename]\n",
126+
"Usage: %s [-signore | -onetime | -forever (default)] [-daemon] [-pidfile filename] "
127+
"[-timeout seconds (default 30)]\n",
123128
prog_name);
124129
exit(-1);
125130
break;
@@ -231,7 +236,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
231236
{
232237
if (shutdown_child)
233238
{
234-
ret_code = UTIL_shutdown_child(child_pid, 3, 1);
239+
ret_code = UTIL_shutdown_child(child_pid, timeout_term, 1);
235240
if (ret_code < 0)
236241
{
237242
gds__log("%s: error while shutting down %s (%d)\n",

0 commit comments

Comments
 (0)