Get started with vmop-agent.

This commit is contained in:
Michael Lipp 2025-02-25 15:43:47 +01:00
parent d2c39dc06a
commit 4a7a309f07
6 changed files with 95 additions and 7 deletions

View file

@ -0,0 +1,2 @@
SUBSYSTEM=="virtio-ports", ATTR{name}=="org.jdrupes.vmop_agent.0", \
TAG+="systemd" ENV{SYSTEMD_WANTS}="vmop-agent.service"

View file

@ -0,0 +1,19 @@
#!/usr/bin/bash
hostSerial="/dev/virtio-ports/org.jdrupes.vmop_agent.0"
if [ ! -w "$hostSerial" ]; then
echo >&2 "Device $hostSerial not writable"
exit 1
fi
if ! exec {con}<>"$hostSerial"; then
echo >&2 "Cannot open device $hostSerial"
exit 1
fi
echo >&${con} "220 Hello"
while read line <&${con}; do
true
done

View file

@ -0,0 +1,15 @@
[Unit]
Description=VM-Operator (Guest) Agent
BindsTo=dev-virtio\x2dports-org.jdrupes.vmop_agent.0.device
After=dev-virtio\x2dports-org.jdrupes.vmop_agent.0.device multi-user.target
IgnoreOnIsolate=True
[Service]
UMask=0077
#EnvironmentFile=/etc/sysconfig/vmop-agent
ExecStart=/usr/local/libexec/vmop-agent
Restart=always
RestartSec=0
[Install]
WantedBy=dev-virtio\x2dports-org.jdrupes.vmop_agent.0.device