File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ A [bunyan logger](https://github.com/trentm/node-bunyan) instance. Created by de
161
161
Sets the timeout (in ms) after that an idle connection is closed by the server
162
162
__ Default:__ ` 0 `
163
163
164
+ #### ` endOnProcessSignal `
165
+ Whether to close ftp server and exit process on SIGTERM/SIGINT/SIGQUIT signals or not
166
+ __ Default:__ ` true `
167
+
164
168
## CLI
165
169
166
170
` ftp-srv ` also comes with a builtin CLI.
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ class FtpServer extends EventEmitter {
24
24
whitelist : [ ] ,
25
25
greeting : null ,
26
26
tls : false ,
27
- timeout : 0
27
+ timeout : 0 ,
28
+ endOnProcessSignal : true ,
28
29
} , options ) ;
29
30
30
31
this . _greeting = this . setupGreeting ( this . options . greeting ) ;
@@ -70,9 +71,11 @@ class FtpServer extends EventEmitter {
70
71
71
72
const quit = _ . debounce ( this . quit . bind ( this ) , 100 ) ;
72
73
73
- process . on ( 'SIGTERM' , quit ) ;
74
- process . on ( 'SIGINT' , quit ) ;
75
- process . on ( 'SIGQUIT' , quit ) ;
74
+ if ( this . options . endOnProcessSignal ) {
75
+ process . on ( 'SIGTERM' , quit ) ;
76
+ process . on ( 'SIGINT' , quit ) ;
77
+ process . on ( 'SIGQUIT' , quit ) ;
78
+ }
76
79
}
77
80
78
81
get isTLS ( ) {
You can’t perform that action at this time.
0 commit comments