Files
xen/.gitignore
T
Luis R. Rodriguez 015330004e systemd: add xen systemd service and module files
This adds the systemd xen service / module files and integrates
support into the build system.

This goes in with AX_AVAILABLE_SYSTEMD() which will enable
systemd if development libraries have been found on your
build system. If you don't have systemd on target systems
for binaries built with systemd then the binary will not
work, you must explicitly disable systemd support if you
do not want to build systemd support.

When systemd libraries are present only systems that
have booted into systemd go through the systemd initialization,
otherwise the SysVinit is used.

These are originally based on the Fedora systemd files.

Changes made from Fedora's systemd files:

  * split sockets into two files to claim different permissions
  * Use /bin/sh -c exec to for a simple launcher implementation
  * enables systemd socket activation for C xenstored and Ocaml
    oxenstored
  * use sd_notify(), so change the service to Type=notify, because of
    this we remove the PIDFile specification as we don't care for it, and let
    systemd do its magic for us, this also means we don't have to fork
    so we use --no-fork with systemd
  * defines a modules-load.d, its original source file will be shared
    between systemd and old init systems
  * simplify service files with ConditionVirtualization=xen which uses
    the built in systemd virtualization backend detection, these
    service files will not be available to start on systems that do not
    boot with xen as a hypervisor
  * use autoconf to replace @variable@ paths for us which piggy
    backs on top of the latest autoconf changes to xen
  * removes oxenstored service file in favor of a system variable which
    controls which which xentored to use at run time, we avoid multiple
    service files this way.
  * simplifies startup to not require polling on the sockets
    as initial socket management is handled by systemd, we just
    take on the socket later once anything pokes at it, a simple nc -U
    (as root) on any of the sockets files can activate the service for example.
    Anything queued up will be sent to us once we start. Socket activation
    should in theory also let us dynamically switch between xenstores but more
    importantly we could upgrade xenstored while keeping all active
    socket communication queued up, but in order to take advantage of
    this we eventually would need to remove the requirement of not being
    able to bring down the xenstored. Even though active sockets are
    supported since most libxl communication doesn't triggger a check
    on the unix socket first administrators are encouraged to enable
    the xenstored.service to triggger an initialization of the xenstored
    upon bring up. Some systems also never use unix sockets for
    communication with the xenstored and as such active sockets will
    not be used there.
  * allow for xenstored configuration through *either* of these
    configuration files:
	- /etc/sysconfig/xenstored
	- /etc/default/xenstored
    The /etc/default/xenstored will let debian based systems do
    the same, while SUSE/OpenSUSE/Fedora/RedHat can keep on chugging
    with sysconfig. We leave these files all commented out by default
    though given that for systemd we want to encourage not using them.
  * ensures we create the run directory as most systems will likely
    be using a tmpfs for run dirs for the pid files
  * Some systems define the selinux context in the systemd Option for the
    /var/lib/xenstored tmpfs:
	Options=mode=755,context="system_u:object_r:xenstored_var_lib_t:s0"
    For the upstream version we remove that and let systems specify the
    context on their system /etc/default/xenstored or /etc/sysconfig/xenstored
    $XENSTORED_MOUNT_CTX variable, with a default to none.
  * takes advantage of the shared xendomains helper for the xendomains
    service
  * Add the new dom0 that gets kicked off for disk backend access into
    its own systemd service associated to xen

We end up with these systemd files:

General requirements:

  * proc-xen.mount
  * var-lib-xenstored.mount

xenstored:

  * xenstored.service
  * xenstored.socket
  * xenstored_ro.socket
  * xenconsoled.service
  * xen-qemu-dom0-disk-backend.service.in

Optional:

  * xendomains.service
  * xen-watchdog.service

As for integration with xen, we house keep all the systemd files
under a new directory tools/hotplug/Linux/systemd/ and will be targeted
by default when building on Linux systems if systemd development
libraries are present at build time.

The systemd files will be sanitized for meta @VARIABLES@ upon
configuration and installed upon the install target. Systems that
do not use systemd can still get systemd service unit files installed
if the build system enabled systemd support, this however does not
mandate a requirement of having systemd libraries present. Old init
scripts are always installed.

If you don't specify a prefix you will end up with the services
files under /usr/local/lib/systemd/system/ by default, and systemd
modules-load.d conf files under /usr/local/lib/modules-load.d/ which
systemd does look for (although it seems this is not documented).

Distributions are expected to provide their /usr/ prefix to end up in
the more generic location upon distribution install at
/usr/lib/systemd/system/ and /usr/lib/modules-load.d/ respectively.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- ran autogen.sh ]
2014-08-04 14:58:24 +01:00

361 lines
8.4 KiB
Plaintext

.hg
*.orig
*.rej
*~
*.swp
*.o
*.d
*.opic
*.a
*.so
*.so.[0-9]*
*.bin
*.bak
*.tmp
*.spot
*.spit
*.gcno
*.gcda
*.py[ocd]
TAGS
GTAGS
GRTAGS
GPATH
GSYMS
tags
cscope.files
cscope.in.out
cscope.out
cscope.po.out
.config
dist
stubdom/*.tar.gz
autom4te.cache/
config.log
config.status
config.cache
config/Toplevel.mk
config/Paths.mk
build-*
dist/*
docs/html/
docs/man1/
docs/man5/
docs/pdf/
docs/txt/
extras/mini-os/include/mini-os
extras/mini-os/include/x86/mini-os
extras/mini-os/include/xen
extras/mini-os/include/list.h
extras/mini-os/mini-os*
install/*
linux-[^/]*-paravirt/*
linux-2.6[^/]*/*
linux-[^/]*-rc/*
linux-[^/]*-tip/*
linux-[^/]*-git/*
linux-[^/]*.patch
mkddbxen
netbsd-[^/]*-tools/*
netbsd-[^/]*-xen0/*
netbsd-[^/]*-xenU/*
netbsd-[^/]*.patch
patches/*/.makedep
patches/ebtables-brnf-5_vs_2.4.25.diff
patches/ebtables.diff
patches/tmp/*
pristine-*
ref-*
tmp-*
stubdom/autom4te.cache/
stubdom/binutils-*
stubdom/config.log
stubdom/config.status
stubdom/config.cache
stubdom/cross-root-*
stubdom/gcc-*
stubdom/include
stubdom/ioemu
stubdom/xenstore
stubdom/libxc-*
stubdom/lwip-*
stubdom/mini-os-*
stubdom/mk-headers-*
stubdom/newlib-1.*
stubdom/newlib-x86*
stubdom/pciutils-*
stubdom/zlib-*
stubdom/grub-*
stubdom/ocaml-*
stubdom/polarssl-*
stubdom/gmp-*
stubdom/tpm_emulator-*
stubdom/lwip/
stubdom/ioemu/
stubdom/stubdompath.sh
stubdom/vtpm/vtpm_manager.h
tools/*/build/lib*/*.py
tools/autom4te.cache/
tools/config.h
tools/config.log
tools/config.status
tools/config.cache
config/Tools.mk
config/Stubdom.mk
config/Docs.mk
tools/blktap2/daemon/blktapctrl
tools/blktap2/drivers/img2qcow
tools/blktap2/drivers/lock-util
tools/blktap2/drivers/qcow-create
tools/blktap2/drivers/qcow2raw
tools/blktap2/drivers/tapdisk
tools/blktap2/drivers/tapdisk-client
tools/blktap2/drivers/tapdisk-diff
tools/blktap2/drivers/tapdisk-stream
tools/blktap2/drivers/tapdisk2
tools/blktap2/drivers/td-util
tools/blktap2/vhd/vhd-update
tools/blktap2/vhd/vhd-util
tools/blktap/drivers/blktapctrl
tools/blktap/drivers/img2qcow
tools/blktap/drivers/qcow-create
tools/blktap/drivers/qcow2raw
tools/blktap/drivers/tapdisk
tools/check/.*
tools/console/xenconsole
tools/console/xenconsoled
tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
tools/debugger/gdb/gdb-6.2.1/*
tools/debugger/gdb/gdb-6.2.1.tar.bz2
tools/debugger/gdbsx/gdbsx
tools/debugger/xenitp/xenitp
tools/firmware/*/biossums
tools/firmware/*.bin
tools/firmware/*.sym
tools/firmware/*bios/*bios*.txt
tools/firmware/etherboot/gpxe/*
tools/firmware/extboot/extboot.img
tools/firmware/extboot/signrom
tools/firmware/hvmloader/acpi/mk_dsdt
tools/firmware/hvmloader/acpi/dsdt*.c
tools/firmware/hvmloader/acpi/dsdt_*.asl
tools/firmware/hvmloader/acpi/ssdt_*.h
tools/firmware/hvmloader/hvmloader
tools/firmware/hvmloader/roms.h
tools/firmware/hvmloader/roms.inc
tools/firmware/rombios/BIOS-bochs-[^/]*
tools/firmware/rombios/_rombios[^/]*_.c
tools/firmware/rombios/rombios[^/]*.s
tools/firmware/rombios/32bit/32bitbios_flat.h
tools/firmware/vgabios/vbetables-gen
tools/firmware/vgabios/vbetables.h
tools/flask/utils/flask-getenforce
tools/flask/utils/flask-get-bool
tools/flask/utils/flask-loadpolicy
tools/flask/utils/flask-setenforce
tools/flask/utils/flask-set-bool
tools/flask/utils/flask-label-pci
tools/fs-back/fs-backend
tools/hotplug/common/hotplugpath.sh
tools/include/xen/*
tools/include/xen-foreign/*.(c|h|size)
tools/include/xen-foreign/checker
tools/libxl/libxlu_cfg_y.output
tools/libxl/xl
tools/libxl/testenum
tools/libxl/testenum.c
tools/libxl/tmp.*
tools/libxl/_libxl.api-for-check
tools/libxl/*.api-ok
tools/misc/cpuperf/cpuperf-perfcntr
tools/misc/cpuperf/cpuperf-xen
tools/misc/xc_shadow
tools/misc/xen_cpuperf
tools/misc/xen-detect
tools/misc/xen-tmem-list-parse
tools/misc/xenperf
tools/misc/xenpm
tools/misc/xen-hvmctx
tools/misc/gtraceview
tools/misc/gtracestat
tools/misc/xenlockprof
tools/misc/lowmemd
tools/misc/xencov
tools/pygrub/build/*
tools/python/build/*
tools/python/xen/util/path.py
tools/remus/imqebt/imqebt
tools/remus/kmod/*(.cmd|.mod|.ko|.mod.c|.symvers|.xen)
tools/security/secpol_tool
tools/security/xen/*
tools/security/xensec_tool
tools/tests/x86_emulator/blowfish.bin
tools/tests/x86_emulator/blowfish.h
tools/tests/x86_emulator/test_x86_emulator
tools/tests/x86_emulator/x86_emulate
tools/tests/xen-access/xen-access
tools/tests/regression/installed/*
tools/tests/regression/build/*
tools/tests/regression/downloads/*
tools/tests/mem-sharing/memshrtool
tools/tests/mce-test/tools/xen-mceinj
tools/vtpm/tpm_emulator-*.tar.gz
tools/vtpm/tpm_emulator/*
tools/vtpm/vtpm/*
tools/vtpm_manager/manager/vtpm_managerd
tools/xcutils/lsevtchn
tools/xcutils/readnotes
tools/xenfb/sdlfb
tools/xenfb/vncfb
tools/xenmon/xentrace_setmask
tools/xenmon/xenbaked
tools/xenpaging/xenpaging
tools/xenpmd/xenpmd
tools/xenstat/xentop/xentop
tools/xenstore/testsuite/tmp/*
tools/xenstore/init-xenstore-domain
tools/xenstore/xen
tools/xenstore/xenstore
tools/xenstore/xenstore-chmod
tools/xenstore/xenstore-exists
tools/xenstore/xenstore-list
tools/xenstore/xenstore-read
tools/xenstore/xenstore-rm
tools/xenstore/xenstore-write
tools/xenstore/xenstore-control
tools/xenstore/xenstore-ls
tools/xenstore/xenstored
tools/xenstore/xenstored_test
tools/xenstore/xs_crashme
tools/xenstore/xs_random
tools/xenstore/xs_stress
tools/xenstore/xs_tdb_dump
tools/xenstore/xs_test
tools/xenstore/xs_watch_stress
tools/xentrace/xentrace_setsize
tools/xentrace/tbctl
tools/xentrace/xenctx
tools/xentrace/xentrace
tools/ocaml-xenstored*
xen/.banner
xen/System.map
xen/arch/arm/asm-offsets.s
xen/arch/arm/xen.lds
xen/arch/x86/asm-offsets.s
xen/arch/x86/boot/mkelf32
xen/arch/x86/xen.lds
xen/arch/x86/boot/reloc.S
xen/arch/x86/boot/reloc.bin
xen/arch/x86/boot/reloc.lnk
xen/arch/x86/efi.lds
xen/arch/x86/efi/check.efi
xen/arch/x86/efi/disabled
xen/arch/x86/efi/mkreloc
xen/ddb/*
xen/include/headers.chk
xen/include/asm
xen/include/asm-*/asm-offsets.h
xen/include/compat/*
xen/include/hypervisor-ifs/arch
xen/include/linux
xen/include/public/public
xen/include/xen/*.new
xen/include/xen/acm_policy.h
xen/include/xen/compile.h
xen/tools/symbols
xen/xsm/flask/include/av_perm_to_string.h
xen/xsm/flask/include/av_permissions.h
xen/xsm/flask/include/class_to_string.h
xen/xsm/flask/include/flask.h
xen/xsm/flask/include/initial_sid_to_string.h
tools/flask/policy/policy.conf
tools/flask/policy/xenpolicy.24
xen/xen
xen/xen-syms
xen/xen.*
unmodified_drivers/linux-2.6/.tmp_versions
unmodified_drivers/linux-2.6/*.cmd
unmodified_drivers/linux-2.6/*.ko
unmodified_drivers/linux-2.6/*.mod.c
LibVNCServer*
tools/qemu-xen-dir-remote
tools/qemu-xen-dir
tools/qemu-xen-traditional-dir-remote
tools/qemu-xen-traditional-dir
tools/firmware/seabios-dir-remote
tools/firmware/seabios-dir
tools/firmware/ovmf-dir-remote
tools/firmware/ovmf-dir
tools/firmware/rombios/_rombios_.c
tools/firmware/rombios/rombios.s
tools/firmware/rombios/rombios.sym
tools/include/xen-foreign/checker.c
tools/include/xen-foreign/structs.pyc
tools/include/xen-foreign/x86_32.h
tools/include/xen-foreign/x86_64.h
tools/include/xen-foreign/arm32.h
tools/include/xen-foreign/arm64.h
.git
tools/misc/xen-hptool
tools/misc/xen-mfndump
tools/libxl/_*.[ch]
tools/libxl/testidl
tools/libxl/testidl.c
tools/libxl/*.pyc
tools/libxl/libxl-save-helper
tools/libxl/test_timedereg
tools/blktap2/control/tap-ctl
tools/firmware/etherboot/eb-roms.h
tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
tools/misc/xenwatchdogd
tools/misc/xen-hvmcrash
tools/misc/xen-lowmemd
tools/libvchan/vchan-node[12]
tools/ocaml/*/.ocamldep.make
tools/ocaml/*/*.cm[ixao]
tools/ocaml/*/*.cmxa
tools/ocaml/*/*.annot
tools/ocaml/*/*/.ocamldep.make
tools/ocaml/*/*/*.cm[ixao]
tools/ocaml/*/*/*.cmxa
tools/ocaml/*/*/*.annot
tools/ocaml/*/*/META
tools/ocaml/libs/xl/_libxl_types.inc
tools/ocaml/libs/xl/_libxl_types.ml.in
tools/ocaml/libs/xl/_libxl_types.mli.in
tools/ocaml/libs/xl/xenlight.ml
tools/ocaml/libs/xl/xenlight.mli
tools/ocaml/libs/xentoollog/_xtl_levels.*
tools/ocaml/libs/xentoollog/xentoollog.ml
tools/ocaml/libs/xentoollog/xentoollog.mli
tools/ocaml/xenstored/oxenstored
tools/ocaml/test/xtl
tools/ocaml/test/send_debug_keys
tools/ocaml/test/list_domains
tools/ocaml/test/dmesg
tools/ocaml/test/raise_exception
tools/debugger/kdd/kdd
tools/firmware/etherboot/ipxe.tar.gz
tools/firmware/etherboot/ipxe/
tools/python/xen/lowlevel/xl/_pyxl_types.c
tools/python/xen/lowlevel/xl/_pyxl_types.h
tools/xenstore/xenstore-watch
docs/txt/misc/*.txt
docs/txt/man/*.txt
docs/figs/*.png
tools/hotplug/Linux/systemd/*.conf
tools/hotplug/Linux/systemd/*.mount
tools/hotplug/Linux/systemd/*.socket
tools/hotplug/Linux/systemd/*.service