Changeset 9238

Show
Ignore:
Timestamp:
03/13/12 17:12:28 (14 months ago)
Author:
walt
Message:

updates to ucache code

Location:
branches/stable/src/apps/ucache
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/stable/src/apps/ucache/ucached.c

    r9234 r9238  
    212212                rc = write(writefd, "SUCCESS\tExiting ucached", BUFF_SIZE); 
    213213            } 
     214            remove(UCACHED_STARTED); 
    214215            close(writefd); 
    215216            close(readfd); 
     
    558559{ 
    559560    int rc = 0;  
    560     void *rp; 
    561561 
    562562    gossip_enable_file(UCACHED_LOG_FILE, "a"); 
     
    576576    { 
    577577        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     else 
    595     {   
    596         puts("FAILURE: Daemon already started"); 
    597         puts(ps_buff1); 
    598         puts(ps_buff2); 
    599         exit(EXIT_FAILURE); 
    600578    } 
    601579 
  • branches/stable/src/apps/ucache/ucached.h

    r9234 r9238  
    2424#ifndef UCACHED_INFO_FILE 
    2525#define UCACHED_INFO_FILE "/tmp/ucached.info" 
     26#endif 
     27 
     28#ifndef UCACHED_STARTED 
     29#define UCACHED_STARTED "/tmp/ucached.started" 
    2630#endif 
    2731