tools: make xenstore domain easy configurable

Add configuration entries to sysconfig.xencommons for selection of the
xenstore type (domain or daemon) and start the selected xenstore
service via a script called from sysvinit or systemd.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Juergen Gross authored and Wei Liu committed 2016-08-05 10:37:12 +01:00
1 parent c74dd50bc0
commit 7b61011e14
3 files changed
+72 -20

No files matched your search

@@ -5,13 +5,25 @@
# Log xenconsoled messages (cf xl dmesg)
#XENCONSOLED_TRACE=[none|guest|hv|all]
## Type: string
## Default: daemon
#
# Select type of xentore service.
#
# This can be either of:
# * daemon
# * domain
#
# Changing this requires a reboot to take effect.
#
#XENSTORETYPE=daemon
## Type: string
## Default: xenstored
#
# Select xenstore implementation, this can be either
# of these below. If using systemd it's preferred that you
# just edit the xenstored.service unit file and change
# the XENSTORED variable there.
# of these below.
# Only evaluated if XENSTORETYPE is "daemon".
#
# This can be either of:
# * @sbindir@/oxenstored
@@ -26,20 +38,44 @@
# Additional commandline arguments to start xenstored,
# like "--trace-file @XEN_LOG_DIR@/xenstored-trace.log"
# See "@sbindir@/xenstored --help" for possible options.
# Only evaluated if XENSTORETYPE is "daemon".
XENSTORED_ARGS=
## Type: string
## Default: Not defined, tracing off
#
# Log xenstored messages
# Only evaluated if XENSTORETYPE is "daemon".
#XENSTORED_TRACE=[yes|on|1]
## Type: string
## Default: "@XEN_LIB_STORED@"
#
# Running xenstored on XENSTORED_ROOTDIR
# Only evaluated if XENSTORETYPE is "daemon".
#XENSTORED_ROOTDIR=@XEN_LIB_STORED@
## Type: string
## Default: @LIBEXEC@/boot/xenstore-stubdom.gz
#
# xenstore domain kernel.
# Only evaluated if XENSTORETYPE is "domain".
#XENSTORE_DOMAIN_KERNEL=@LIBEXEC@/boot/xenstore-stubdom.gz
## Type: integer
## Default: 8
#
# xenstore domain memory size in MiB.
# Only evaluated if XENSTORETYPE is "domain".
#XENSTORE_DOMAIN_SIZE=8
## Type: string
## Default: ""
#
# Additional arguments for starting the xenstore domain.
# Only evaluated if XENSTORETYPE is "domain".
XENSTORE_DOMAIN_ARGS=
## Type: string
## Default: Not defined, xenbackendd debug mode off
#
+32 -10
View File
@@ -48,18 +48,40 @@ test_xenstore && exit 0
test -f @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons && . @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T @XEN_LOG_DIR@/xenstored-trace.log"
[ "$XENSTORETYPE" = "" ] && XENSTORETYPE=daemon
/bin/mkdir -p @XEN_RUN_DIR@
[ "$XENSTORETYPE" = "daemon" ] && {
[ -z "$XENSTORED_ROOTDIR" ] && XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
/bin/rm -f $XENSTORED_ROOTDIR/tdb* &>/dev/null
[ -z "$XENSTORED_TRACE" ] || XENSTORED_ARGS="$XENSTORED_ARGS -T @XEN_LOG_DIR@/xenstored-trace.log"
[ -z "$XENSTORED" ] && XENSTORED=@XENSTORED@
[ -x "$XENSTORED" ] || {
echo "No xenstored found"
exit 1
}
if [ -n "$XENSTORED" ] ; then
echo -n Starting $XENSTORED...
$XENSTORED --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
else
echo "No xenstored found"
exit 1
fi
timeout_xenstore $XENSTORED || exit 1
systemd-notify --booted 2>/dev/null || timeout_xenstore $XENSTORED || exit 1
exit 0
exit 0
}
[ "$XENSTORETYPE" = "domain" ] && {
[ -z "$XENSTORE_DOMAIN_KERNEL" ] && XENSTORE_DOMAIN_KERNEL=@LIBEXEC@/boot/xenstore-stubdom.gz
XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --kernel $XENSTORE_DOMAIN_KERNEL"
[ -z "$XENSTORE_DOMAIN_SIZE" ] && XENSTORE_DOMAIN_SIZE=8
XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --memory $XENSTORE_DOMAIN_SIZE"
echo -n Starting $XENSTORE_DOMAIN_KERNEL...
${LIBEXEC_BIN}/init-xenstore-domain $XENSTORE_DOMAIN_ARGS || exit 1
systemd-notify --ready 2>/dev/null
exit 0
}
echo "illegal value $XENSTORETYPE for XENSTORETYPE"
exit 1
@@ -10,14 +10,8 @@ ConditionPathExists=/proc/xen/capabilities
Type=notify
NotifyAccess=all
RemainAfterExit=true
KillMode=none
Environment=XENSTORED_ARGS=
Environment=XENSTORED=@XENSTORED@
EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
ExecStart=@XEN_SCRIPT_DIR@/launch-xenstore
[Install]
WantedBy=multi-user.target
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.