Skip to content

Instantly share code, notes, and snippets.

@bencord0
Last active November 7, 2019 03:58
Show Gist options
  • Save bencord0/10073689 to your computer and use it in GitHub Desktop.
Save bencord0/10073689 to your computer and use it in GitHub Desktop.
Xen systemd unit files
[Unit]
Description=Mount /proc/xen files
ConditionPathExists=/proc/xen
RefuseManualStop=true
[Mount]
What=xenfs
Where=/proc/xen
Type=xenfs
[Unit]
Description=mount xenstore file system
ConditionPathExists=/proc/xen
RefuseManualStop=true
[Mount]
What=xenstore
Where=/var/lib/xenstored
Type=tmpfs
[Unit]
Description=Xen watchdog daemon
Requires=proc-xen.mount
After=proc-xen.mount
ConditionPathIsDirectory=/proc/xen
[Service]
Type=forking
ExecStart=/usr/sbin/xenwatchdogd 30 15
KillSignal=USR1
[Install]
WantedBy=multi-user.target
[Unit]
Description=Xenconsoled - handles logging from guest consoles and hypervisor
Requires=proc-xen.mount
After=proc-xen.mount xenstored.service
ConditionPathExists=/proc/xen
[Service]
Type=simple
Environment=XENCONSOLED_ARGS=
Environment=XENCONSOLED_LOG=none
Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console
EnvironmentFile=-/etc/sysconfig/xenconsoled
PIDFile=/var/run/xenconsoled.pid
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=/usr/sbin/xenconsoled --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
[Install]
WantedBy=multi-user.target
[Unit]
Description=Xenstored - daemon managing xenstore file system
Requires=proc-xen.mount var-lib-xenstored.mount
After=proc-xen.mount var-lib-xenstored.mount
Before=libvirtd.service libvirt-guests.service xendomains.service xend.service
RefuseManualStop=true
ConditionPathExists=/proc/xen
[Service]
Type=forking
Environment=XENSTORED_ARGS=
Environment=XENSTORED_ROOTDIR=/var/lib/xenstored
EnvironmentFile=-/etc/sysconfig/xenstored
PIDFile=/var/run/xenstored.pid
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStartPre=-/bin/rm -f "$XENSTORED_ROOTDIR"/tdb*
ExecStartPre=/bin/mkdir -p /var/run/xen
ExecStart=/usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
ExecStartPost=/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
ExecStartPost=/usr/bin/xenstore-write "/local/domain/0/domid" "0"
[Install]
WantedBy=multi-user.target
@bencord0
Copy link
Author

bencord0 commented Apr 7, 2014

I don't use xendomains.service, letting libvirtd to handle VM autostarting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment