Get started with vmop-agent.
This commit is contained in:
parent
d2c39dc06a
commit
4a7a309f07
6 changed files with 95 additions and 7 deletions
2
dev-example/vmop-agent/99-vmop-agent.rules
Normal file
2
dev-example/vmop-agent/99-vmop-agent.rules
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
SUBSYSTEM=="virtio-ports", ATTR{name}=="org.jdrupes.vmop_agent.0", \
|
||||
TAG+="systemd" ENV{SYSTEMD_WANTS}="vmop-agent.service"
|
||||
19
dev-example/vmop-agent/vmop-agent
Executable file
19
dev-example/vmop-agent/vmop-agent
Executable 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
|
||||
15
dev-example/vmop-agent/vmop-agent.service
Normal file
15
dev-example/vmop-agent/vmop-agent.service
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue