git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/localfs/etc/systemd/system
diff options
context:
space:
mode:
Diffstat (limited to 'localfs/etc/systemd/system')
-rw-r--r--localfs/etc/systemd/system/cluster-muromachi.target6
-rw-r--r--localfs/etc/systemd/system/freshclam.service15
-rw-r--r--localfs/etc/systemd/system/kvm-arch.service12
-rw-r--r--localfs/etc/systemd/system/kvm-clustervm@.service31
-rw-r--r--localfs/etc/systemd/system/kvm-debian.service12
-rw-r--r--localfs/etc/systemd/system/kvm-firewall.service21
-rw-r--r--localfs/etc/systemd/system/kvm-guestmount.service13
-rw-r--r--localfs/etc/systemd/system/kvm-infravm@.service23
-rw-r--r--localfs/etc/systemd/system/kvm-jango105.service12
-rw-r--r--localfs/etc/systemd/system/kvm-opensuse.service12
10 files changed, 157 insertions, 0 deletions
diff --git a/localfs/etc/systemd/system/cluster-muromachi.target b/localfs/etc/systemd/system/cluster-muromachi.target
new file mode 100644
index 0000000..ec63edc
--- /dev/null
+++ b/localfs/etc/systemd/system/cluster-muromachi.target
@@ -0,0 +1,6 @@
+[Unit]
+Description=Cluster "muromachi_cl"
+BindsTo=kvm-clustervm@centoscl0.service kvm-clustervm@centoscl1.service kvm-clustervm@centoscl2.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/freshclam.service b/localfs/etc/systemd/system/freshclam.service
new file mode 100644
index 0000000..a14de83
--- /dev/null
+++ b/localfs/etc/systemd/system/freshclam.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=ClamAV database updater (freshclam)
+Wants=network.target
+Requires=network.target
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/local/sbin/freshclamd start
+ExecStop=/usr/local/sbin/freshclamd stop
+TimeoutStartSec=10s
+TimeoutStopSec=30s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-arch.service b/localfs/etc/systemd/system/kvm-arch.service
new file mode 100644
index 0000000..597548f
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-arch.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=virtual machine triskel05 (Arch)
+Requires=libvirtd.service libvirt-guests.service lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/virsh start arch
+ExecStop=/bin/virsh shutdown arch
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-clustervm@.service b/localfs/etc/systemd/system/kvm-clustervm@.service
new file mode 100644
index 0000000..f21cbcd
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-clustervm@.service
@@ -0,0 +1,31 @@
+# Work in progress:
+# - Start needs to be more sophisticated in reaction to state of domains
+# - Stop should not just do a post-sleep, but instead the post section should
+# carry a script polling the state of the machine and hammering it into the
+# coffing after a certain timeout
+[Unit]
+Description=VM %i (with cluster inside)
+Wants=kvm-infravm@iscsi.service
+After=kvm-infravm@iscsi.service
+Wants=lvm2-monitor.service
+Requires=libvirtd.service
+Requires=kvm-firewall.service
+Requires=kvm-network@sosaria05.service
+Requires=kvm-network@san-cluster.service
+After=kvm-firewall.service
+After=libvirtd.service
+After=lvm2-monitor.service
+After=kvm-network@sosaria05.service
+After=kvm-network@san-cluster.service
+PartOf=cluster-muromachi.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/kvmhelper -q vm-start %i
+ExecStop=/usr/local/bin/kvmhelper -q vm-stop %i
+RemainAfterExit=yes
+TimeoutStartSec=10s
+TimeoutStopSec=60s
+
+[Install]
+WantedBy=cluster-muromachi.target
diff --git a/localfs/etc/systemd/system/kvm-debian.service b/localfs/etc/systemd/system/kvm-debian.service
new file mode 100644
index 0000000..1347a0b
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-debian.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=virtual machine balinorgel05 (Debian stable)
+Requires=libvirtd.service libvirt-guests.service lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/virsh start debian
+ExecStop=/bin/virsh shutdown debian
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-firewall.service b/localfs/etc/systemd/system/kvm-firewall.service
new file mode 100644
index 0000000..b68ede5
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-firewall.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=virtual machine cthulhu05 (Debian Firewall)
+Wants=lvm2-monitor.service
+Requires=libvirtd.service
+Requires=kvm-network@sosaria05.service
+Requires=kvm-network@san-cluster.service
+After=libvirtd.service
+After=lvm2-monitor.service
+After=kvm-network@sosaria05.service
+After=kvm-network@san-cluster.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/kvmhelper -q vm-start firewall
+ExecStop=/usr/local/bin/kvmhelper -q vm-stop firewall
+RemainAfterExit=yes
+TimeoutStartSec=10s
+TimeoutStopSec=60s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-guestmount.service b/localfs/etc/systemd/system/kvm-guestmount.service
new file mode 100644
index 0000000..fab979f
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-guestmount.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Mount KVM domains' boot partitions for direct boots
+Requires=libvirtd.service lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+# Test phase, only using arch. Will do a script later on when the amount is > 1
+ExecStart=/usr/bin/guestmount -r -o allow_other -o ro -m /dev/sda2:/:acl,user_xattr -a /dev/libvirt/arch-boot /var/lib/libvirt/boot/arch
+ExecStop=/usr/bin/guestunmount /var/lib/libvirt/boot/arch
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-infravm@.service b/localfs/etc/systemd/system/kvm-infravm@.service
new file mode 100644
index 0000000..29f8321
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-infravm@.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=Infrastructural VM %i
+Wants=lvm2-monitor.service
+Requires=libvirtd.service
+Requires=kvm-firewall.service
+Requires=kvm-network@sosaria05.service
+Requires=kvm-network@san-cluster.service
+After=kvm-firewall.service
+After=libvirtd.service
+After=lvm2-monitor.service
+After=kvm-network@sosaria05.service
+After=kvm-network@san-cluster.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/kvmhelper -q vm-start %i
+ExecStop=/usr/local/bin/kvmhelper -q vm-stop %i
+RemainAfterExit=yes
+TimeoutStartSec=10s
+TimeoutStopSec=60s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-jango105.service b/localfs/etc/systemd/system/kvm-jango105.service
new file mode 100644
index 0000000..416c1af
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-jango105.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=virtual machine jango105 (Windows 10)
+Requires=libvirtd.service libvirt-guests.service lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/virsh start jango105
+ExecStop=/bin/virsh shutdown jango105
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/localfs/etc/systemd/system/kvm-opensuse.service b/localfs/etc/systemd/system/kvm-opensuse.service
new file mode 100644
index 0000000..217dbbe
--- /dev/null
+++ b/localfs/etc/systemd/system/kvm-opensuse.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=virtual machine loukaniko05 (OpenSUSE Leap)
+Requires=libvirtd.service libvirt-guests.service lvm2-lvmetad.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/virsh start opensuse
+ExecStop=/bin/virsh shutdown opensuse
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target