File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,9 @@ static void signal_cb(EV_P_ ev_signal *w, int revents)
940
940
switch (w -> signum ) {
941
941
case SIGINT :
942
942
case SIGTERM :
943
+ #ifndef __MINGW32__
944
+ case SIGUSR1 :
945
+ #endif
943
946
ev_unloop (EV_A_ EVUNLOOP_ALL );
944
947
}
945
948
}
@@ -1328,6 +1331,11 @@ int start_ss_local_server(profile_t profile)
1328
1331
ev_signal_init (& sigterm_watcher , signal_cb , SIGTERM );
1329
1332
ev_signal_start (EV_DEFAULT , & sigint_watcher );
1330
1333
ev_signal_start (EV_DEFAULT , & sigterm_watcher );
1334
+ #ifndef __MINGW32__
1335
+ struct ev_signal sigusr1_watcher ;
1336
+ ev_signal_init (& sigusr1_watcher , signal_cb , SIGUSR1 );
1337
+ ev_signal_start (EV_DEFAULT , & sigusr1_watcher );
1338
+ #endif
1331
1339
1332
1340
// Setup keys
1333
1341
LOGI ("initializing ciphers... %s" , method );
@@ -1405,6 +1413,9 @@ int start_ss_local_server(profile_t profile)
1405
1413
1406
1414
ev_signal_stop (EV_DEFAULT , & sigint_watcher );
1407
1415
ev_signal_stop (EV_DEFAULT , & sigterm_watcher );
1416
+ #ifndef __MINGW32__
1417
+ ev_signal_stop (EV_DEFAULT , & sigusr1_watcher );
1418
+ #endif
1408
1419
1409
1420
// cannot reach here
1410
1421
return 0 ;
Original file line number Diff line number Diff line change @@ -83,5 +83,7 @@ int start_ss_local_server(profile_t profile);
83
83
84
84
// To stop the service on posix system, just kill the daemon process
85
85
// kill(pid, SIGKILL);
86
+ // Otherwise, If you start the service in a thread, you may need to send a signal SIGUSER1 to the thread.
87
+ // pthread_kill(pthread_t, SIGUSR1);
86
88
87
89
#endif // _SHADOWSOCKS_H
You can’t perform that action at this time.
0 commit comments