]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Improve messages for rrdcached daemon failed due to PID Exist (#743)
authorManoj Kumar <manoj.kumar.mbm@gmail.com>
Wed, 28 Sep 2016 16:29:12 +0000 (21:59 +0530)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 28 Sep 2016 16:29:12 +0000 (18:29 +0200)
*  Improve messages for rrdcached daemon failed due to PID Exist
    New messages added in order to get clarity about the nature of problem

* Review Comment incorporated regarding indentation of error messages

src/rrd_daemon.c

index db548e78f413f9cebd6ecbe30715ddfc3329ed47..0cb86dcab11b363930293070cf2bd8e5de6ad88b 100644 (file)
@@ -524,16 +524,21 @@ static int check_pidfile(void)
   char pid_str[16];
 
   pid_fd = open_pidfile("open", O_RDWR);
-  if (pid_fd < 0)
+  if (pid_fd < 0){
+     fprintf(stderr,"FATAL: Fail to create/open PID file \n");
     return pid_fd;
+     }
 
   if (read(pid_fd, pid_str, sizeof(pid_str)) <= 0) {
+     fprintf(stderr,"FATAL: Empty PID file exist\n");
     close(pid_fd);
     return -1;
   }
 
   pid = atoi(pid_str);
   if (pid <= 0) {
+     fprintf(stderr,"FATAL: PID file is corrupted\n");
+
     close(pid_fd);
     return -1;
   }