version 1.16, 2003/04/07 20:22:33
|
version 1.17, 2003/04/29 22:13:00
|
|
|
} | } |
| |
// get the pid from the file | // get the pid from the file |
fscanf(pid_file, "%ld\n", &pid); |
fscanf(pid_file, "%d\n", &pid); |
|
|
|
fclose(pid_file); |
| |
if (pid == 0) | if (pid == 0) |
{ | { |
|
|
#if defined(PEGASUS_OS_HPUX) | #if defined(PEGASUS_OS_HPUX) |
struct pst_status pstru; | struct pst_status pstru; |
| |
if (pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid) != -1) |
int ret_code; |
|
ret_code = pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid); |
|
|
|
if ( (ret_code != -1 ) && (strcmp(pstru.pst_ucomm, "cimserver")) == 0) |
{ | { |
|
// cimserver is running |
return true; | return true; |
} | } |
#endif | #endif |
|
|
} | } |
| |
// get the pid from the file | // get the pid from the file |
fscanf(pid_file, "%ld\n", &pid); |
fscanf(pid_file, "%d\n", &pid); |
|
|
|
fclose(pid_file); |
| |
if (pid == 0) | if (pid == 0) |
{ | { |
|
|
#if defined(PEGASUS_OS_HPUX) | #if defined(PEGASUS_OS_HPUX) |
struct pst_status pstru; | struct pst_status pstru; |
| |
if (pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid) != -1) |
int ret_code; |
|
ret_code = pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid); |
|
|
|
if ( (ret_code != -1 ) && (strcmp(pstru.pst_ucomm, "cimserver")) == 0) |
{ | { |
|
// cimserver is running, kill the process |
kill(pid, SIGKILL); | kill(pid, SIGKILL); |
} | } |
#endif | #endif |