-
Notifications
You must be signed in to change notification settings - Fork 1
/
UpdateCoreSwitchUSpaceMain.cpp
48 lines (43 loc) · 1.12 KB
/
UpdateCoreSwitchUSpaceMain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Processor/UpdateCoreSwitchUSpaceProcessor.h"
#include "Common/Common.h"
#include "Common/DBCommon.h"
//------------------------------------
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <dirent.h>
//------------------------------------
extern "C"
{
#include <pthread.h>
}
#include <iostream>
using namespace std;
#define ListConfig "ConfigList"
int main(int argc, char* argv[])
{
int child_id;
string strLine;
if (CUtilities::CheckExistingProcess("cmdbUSpaceCoreSwitch") != -1)
{
printf("Process is existed !!\n");
return 0;
}
//===============================FORK==================================//
printf("Starting Update CoreSwitch U Space Process : %s !!\n", argv[0]);
child_id = fork();
if (child_id) {
cout << "I'm parent of " << child_id << endl;
}
else {
CUpdateCoreSwitchUSpaceProcessor *pUpdateCoreSwitchUSpaceProcessor = new CUpdateCoreSwitchUSpaceProcessor("Config.ini");
pUpdateCoreSwitchUSpaceProcessor->Proceed();
delete pUpdateCoreSwitchUSpaceProcessor;
}
return 0;
}