]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: Fix install.sh for systemd
authorOlaf Hering <olaf@aepfle.de>
Fri, 12 May 2023 11:36:44 +0000 (11:36 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 16 May 2023 19:03:02 +0000 (20:03 +0100)
On a fedora system, if you run `sudo sh install.sh` you break your
system. The installation clobbers /var/run, a symlink to /run.
A subsequent boot fails when /var/run and /run are different since
accesses through /var/run can't find items that now only exist in /run
and vice-versa.

Skip populating /var/run/xen during make install.
The directory is already created by some scripts. Adjust all remaining
scripts to create XEN_RUN_DIR at runtime.

Use the shell variable XEN_RUN_DIR instead of hardcoded paths.

XEN_RUN_STORED is covered by XEN_RUN_DIR because xenstored is usually
started afterwards.

Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/Makefile
tools/hotplug/FreeBSD/rc.d/xencommons.in
tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
tools/hotplug/Linux/init.d/xendriverdomain.in
tools/hotplug/Linux/systemd/xenconsoled.service.in
tools/hotplug/NetBSD/rc.d/xendriverdomain.in

index 4906fdbc237c62e61379983911e0c592759e855c..1ff90ddfa013e70563f24006ba1b356630378cea 100644 (file)
@@ -58,9 +58,7 @@ build all: subdirs-all
 install:
        $(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
        $(INSTALL_DIR) $(DESTDIR)$(XEN_LOG_DIR)
-       $(INSTALL_DIR) $(DESTDIR)$(XEN_RUN_DIR)
        $(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_DIR)
-       $(INSTALL_DIR) $(DESTDIR)$(XEN_RUN_STORED)
        $(INSTALL_DIR) $(DESTDIR)$(PKG_INSTALLDIR)
        $(MAKE) subdirs-install
 
index 7f7cda289f8ab1530dd4cc49660c056c5fc64abd..6f429e4b0c25e516454c5d985b0a8f171349e1ed 100644 (file)
@@ -34,6 +34,7 @@ xen_startcmd()
        local time=0
        local timeout=30
 
+       mkdir -p "${XEN_RUN_DIR}"
        xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${XENSTORED})
        if test -z "$xenstored_pid"; then
                printf "Starting xenservices: xenstored, xenconsoled."
index a032822e337e227d3a8fc0acb7997028417b50ac..f487c43468bc489fd43b066530e586a643c17738 100644 (file)
@@ -27,6 +27,7 @@ xendriverdomain_start()
 {
        printf "Starting xenservices: xl devd."
 
+       mkdir -p "${XEN_RUN_DIR}"
        PATH="${bindir}:${sbindir}:$PATH" ${sbindir}/xl devd --pidfile ${XLDEVD_PIDFILE} ${XLDEVD_ARGS}
 
        printf "\n"
index c63060f62a5045c6514dd4a32402beca2734fc45..17b381c3dcc40a69b693195dde327de9bcb48f4b 100644 (file)
@@ -49,6 +49,7 @@ fi
 
 do_start () {
        echo Starting xl devd...
+       mkdir -p "${XEN_RUN_DIR}"
        ${sbindir}/xl devd --pidfile=$XLDEVD_PIDFILE $XLDEVD_ARGS
 }
 do_stop () {
index 1f03de9041ed3f17bf611d69579e9c72ced141d0..d84c09aa9c51528c35f083e08d8226f4e9a316ef 100644 (file)
@@ -11,7 +11,7 @@ Environment=XENCONSOLED_TRACE=none
 Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
 EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
-ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR}
+ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} @XEN_RUN_DIR@
 ExecStart=@sbindir@/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
 
 [Install]
index f47b0b189c7417963a0f2e02c0eed0ec385cd735..87afc061ac1d6ccd1caaf93346fff007b09224f4 100644 (file)
@@ -23,7 +23,7 @@ XLDEVD_PIDFILE="@XEN_RUN_DIR@/xldevd.pid"
 
 xendriverdomain_precmd()
 {
-       :
+       mkdir -p "${XEN_RUN_DIR}"
 }
 
 xendriverdomain_startcmd()