WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Try to create runtime xenstored's directories at startup

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Try to create runtime xenstored's directories at startup time.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2006 17:04:11 +0000
Delivery-date: Fri, 12 May 2006 01:58:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 08f5adb5058b6122e802aa243c4dd253c701c00c
# Parent  fdd64fd51edd2d12f5b004ead3787e1847049192
Try to create runtime xenstored's directories at startup time.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_core.c |   15 +++++++++++++++
 tools/xenstore/xs_lib.c         |    4 ++--
 tools/xenstore/xs_lib.h         |    2 ++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff -r fdd64fd51edd -r 08f5adb5058b tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu May 11 13:49:20 2006 +0100
+++ b/tools/xenstore/xenstored_core.c   Thu May 11 15:01:54 2006 +0100
@@ -1811,6 +1811,21 @@ int main(int argc, char *argv[])
 
        reopen_log();
 
+       /* make sure xenstored directory exists */
+       if (mkdir(xs_daemon_rundir(), 0755)) {
+               if (errno != EEXIST) {
+                       perror("error: mkdir daemon rundir");
+                       exit(-1);
+               }
+       }
+
+       if (mkdir(xs_daemon_rootdir(), 0755)) {
+               if (errno != EEXIST) {
+                       perror("error: mkdir daemon rootdir");
+                       exit(-1);
+               }
+       }
+
        if (dofork) {
                openlog("xenstored", 0, LOG_DAEMON);
                daemonize();
diff -r fdd64fd51edd -r 08f5adb5058b tools/xenstore/xs_lib.c
--- a/tools/xenstore/xs_lib.c   Thu May 11 13:49:20 2006 +0100
+++ b/tools/xenstore/xs_lib.c   Thu May 11 15:01:54 2006 +0100
@@ -26,13 +26,13 @@
 
 /* Common routines for the Xen store daemon and client library. */
 
-static const char *xs_daemon_rootdir(void)
+const char *xs_daemon_rootdir(void)
 {
        char *s = getenv("XENSTORED_ROOTDIR");
        return (s ? s : "/var/lib/xenstored");
 }
 
-static const char *xs_daemon_rundir(void)
+const char *xs_daemon_rundir(void)
 {
        char *s = getenv("XENSTORED_RUNDIR");
        return (s ? s : "/var/run/xenstored");
diff -r fdd64fd51edd -r 08f5adb5058b tools/xenstore/xs_lib.h
--- a/tools/xenstore/xs_lib.h   Thu May 11 13:49:20 2006 +0100
+++ b/tools/xenstore/xs_lib.h   Thu May 11 15:01:54 2006 +0100
@@ -46,6 +46,8 @@ struct xs_permissions
 #define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2)
 
 /* Path for various daemon things: env vars can override. */
+const char *xs_daemon_rootdir(void);
+const char *xs_daemon_rundir(void);
 const char *xs_daemon_socket(void);
 const char *xs_daemon_socket_ro(void);
 const char *xs_domain_dev(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Try to create runtime xenstored's directories at startup time., Xen patchbot-unstable <=