Changeset 9238
- Timestamp:
- 03/13/12 17:12:28 (14 months ago)
- Location:
- branches/stable/src/apps/ucache
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/src/apps/ucache/ucached.c
r9234 r9238 212 212 rc = write(writefd, "SUCCESS\tExiting ucached", BUFF_SIZE); 213 213 } 214 remove(UCACHED_STARTED); 214 215 close(writefd); 215 216 close(readfd); … … 558 559 { 559 560 int rc = 0; 560 void *rp;561 561 562 562 gossip_enable_file(UCACHED_LOG_FILE, "a"); … … 576 576 { 577 577 out = stdout; 578 }579 580 /* Continue ucached if it's the only ucached */581 char ps_buff1[256];582 char ps_buff2[256];583 FILE *pipe = popen("ps -e | grep -w ucached", "r");584 585 /* Should catch 1 line result, but not 2 */586 rp = fgets(ps_buff1, 256, pipe);587 rp = fgets(ps_buff2, 256, pipe); /* Should be zero if only 1 ucached */588 if(rp == NULL)589 {590 /* Remove old FIFOs in case daemon was killed last time */591 remove(FIFO1);592 remove(FIFO2);593 }594 else595 {596 puts("FAILURE: Daemon already started");597 puts(ps_buff1);598 puts(ps_buff2);599 exit(EXIT_FAILURE);600 578 } 601 579 -
branches/stable/src/apps/ucache/ucached.h
r9234 r9238 24 24 #ifndef UCACHED_INFO_FILE 25 25 #define UCACHED_INFO_FILE "/tmp/ucached.info" 26 #endif 27 28 #ifndef UCACHED_STARTED 29 #define UCACHED_STARTED "/tmp/ucached.started" 26 30 #endif 27 31
