[PATCH] rrdcached: Create the base directory on startup.

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] rrdcached: Create the base directory on startup.

by Sebastian Harl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

---
 program/src/rrd_daemon.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c
index 7406325..0422389 100644
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
@@ -2907,6 +2907,13 @@ static int read_options (int argc, char **argv) /* {{{ */
           return (3);
         }
 
+        if (rrd_mkdir_p (config_base_dir, 0777) != 0)
+        {
+          fprintf (stderr, "Failed to create base directory '%s': %s\n",
+              config_base_dir, rrd_strerror (errno));
+          return (3);
+        }
+
         /* make sure that the base directory is not resolved via
          * symbolic links.  this makes some performance-enhancing
          * assumptions possible (we don't have to resolve paths
--
1.6.5.rc2



_______________________________________________
rrd-developers mailing list
rrd-developers@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

signature.asc (204 bytes) Download Attachment

Re: [PATCH] rrdcached: Create the base directory on startup.

by Tobias Oetiker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sebastian,


Yesterday Sebastian Harl wrote:

> ---
>  program/src/rrd_daemon.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)

thanks ... applied
tobi

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi@... ++41 62 775 9902 / sb: -9900

_______________________________________________
rrd-developers mailing list
rrd-developers@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers