|
|
|
@ -174,22 +174,26 @@ int main( int argc, char *argv[] ){ |
|
|
|
| SW_INFO_DEBUG_MODE |
|
|
|
#endif
|
|
|
|
; |
|
|
|
//Clenup Shared Memory Zone
|
|
|
|
system( "rm -f -R /dev/shm/argus" ); |
|
|
|
//if( !isProcessUniq( argv[0] ) ){
|
|
|
|
if( fileExist( gsCFG_PID_FILE ) ){ |
|
|
|
FILE * fd = fopen( gsCFG_PID_FILE, "r" ); |
|
|
|
if ( fd ) { |
|
|
|
char Kaka[64]; |
|
|
|
readLine( fd, Kaka, 64 ); |
|
|
|
pid_t tPID = ( pid_t ) atol( Kaka ); |
|
|
|
if ( kill( tPID, 0 ) == 0 ) { |
|
|
|
printf("Can not Start!\nThe Process [%s] Already is Runing[PID:%lld]\n", argv[0], tPID ); |
|
|
|
return 33; |
|
|
|
}; |
|
|
|
|
|
|
|
//if( !isProcessUniq( argv[0] ) )
|
|
|
|
if( fileExist( gsCFG_PID_FILE ) ){ |
|
|
|
FILE * fd = fopen( gsCFG_PID_FILE, "r" ); |
|
|
|
if ( fd ) { |
|
|
|
char testString[64]; |
|
|
|
readLine( fd, testString, 64 ); |
|
|
|
pid_t tPID = ( pid_t ) atol( testString ); |
|
|
|
if ( kill( tPID, 0 ) == 0 ) { |
|
|
|
printf("Can not Start!\nThe Process [%s] Already is Runing[PID:%lld]\n", argv[0], tPID ); |
|
|
|
fclose( fd ); |
|
|
|
return 33; |
|
|
|
}; |
|
|
|
fclose(fd); |
|
|
|
}; |
|
|
|
//};
|
|
|
|
}; |
|
|
|
//Clenup Shared Memory Zone
|
|
|
|
system( "rm -f -R /dev/shm/argus" ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reading Config
|
|
|
|
if( argc > 1 ){ |
|
|
|
|