File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ extern "C" {
17
17
18
18
#include " orchdaemon.h"
19
19
#include " saihelper.h"
20
+ #include < signal.h>
20
21
21
22
using namespace std ;
22
23
using namespace swss ;
@@ -70,12 +71,35 @@ void usage()
70
71
cout << " -m MAC: set switch MAC address" << endl;
71
72
}
72
73
74
+ void sighup_handler (int signo)
75
+ {
76
+ /*
77
+ * Don't do any logging since they are using mutexes.
78
+ */
79
+
80
+ sai_attribute_t attr;
81
+
82
+ attr.id = SAI_REDIS_SWITCH_ATTR_PERFORM_LOG_ROTATE;
83
+ attr.value .booldata = true ;
84
+
85
+ if (sai_switch_api != NULL )
86
+ {
87
+ sai_switch_api->set_switch_attribute (&attr);
88
+ }
89
+ }
90
+
73
91
int main (int argc, char **argv)
74
92
{
75
93
swss::Logger::linkToDbNative (" orchagent" );
76
94
77
95
SWSS_LOG_ENTER ();
78
96
97
+ if (signal (SIGHUP, sighup_handler) == SIG_ERR)
98
+ {
99
+ SWSS_LOG_ERROR (" failed to setup SIGHUP action" );
100
+ exit (1 );
101
+ }
102
+
79
103
int opt;
80
104
sai_status_t status;
81
105
You can’t perform that action at this time.
0 commit comments