Replace custom virtiofsd package by trixie repository package and remove deprecated wrapper scripts
This commit is contained in:
parent
c709bceab9
commit
becf8fb451
5 changed files with 2 additions and 58 deletions
|
|
@ -16,11 +16,6 @@ lmnsynci ALL=(root) NOPASSWD: /usr/local/bin/vm-aria2
|
|||
%role-student ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
||||
%role-teacher ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
||||
|
||||
# vm-virtiofsd: Start Virtiofsd as systemd-service
|
||||
%examusers ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||
%role-student ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||
%role-teacher ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||
|
||||
# desktop-sync:
|
||||
%examusers ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
||||
%role-student ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -149,7 +149,7 @@ start_virtiofs_service() {
|
|||
local drive_letter=$3
|
||||
local socket="/run/user/${UID}/virtiofs-${VM_NAME}-${target_name,,}.sock"
|
||||
|
||||
systemd-run --user /usr/local/bin/virtiofsd --uid-map=":${GUEST_UID}:${UID}:1:" --gid-map=":${GUEST_GID}:$(id -g):1:" \
|
||||
systemd-run --user /usr/lib/qemu/virtiofsd --uid-map=":${GUEST_UID}:${UID}:1:" --gid-map=":${GUEST_GID}:$(id -g):1:" \
|
||||
--socket-path "${socket}" --shared-dir "${shared_dir}" --syslog
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
# if less than one arguments supplied, display usage
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "This script takes as input the name of the VM " >&2
|
||||
echo "Usage: $0 vm_name" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_NAME="$1"
|
||||
|
||||
## Make sure VMs can read the base directory:
|
||||
chgrp 1010 "/lmn/media/${SUDO_USER}"
|
||||
chmod 0775 "/lmn/media/${SUDO_USER}"
|
||||
|
||||
socket="/run/user/$(id -u $SUDO_USER)/virtiofs-${VM_NAME}.sock"
|
||||
|
||||
# FIXME: This does not work. In windows, there is no virtiofs device.
|
||||
# In GNU/Linux it's only readable.
|
||||
#
|
||||
#if ! systemctl -q is-active virtiofs-${VM_NAME}.socket ; then
|
||||
# systemd-run --unit=virtiofs-${VM_NAME} \
|
||||
# --slice=system-virtiofs \
|
||||
# --collect \
|
||||
# --socket-property=ListenStream="$socket" \
|
||||
# --socket-property=Accept=no \
|
||||
# --socket-property=SocketMode=0700 \
|
||||
# --socket-property=SocketUser=${SUDO_USER} \
|
||||
# --property=Type=exec \
|
||||
# --property=StandardInput=socket \
|
||||
# /usr/local/bin/virtiofsd --log-level debug --sandbox none \
|
||||
# --syslog --fd=0 --shared-dir "/lmn/media/${SUDO_USER}"
|
||||
#else
|
||||
# systemctl restart virtiofs-${VM_NAME}.socket
|
||||
#fi
|
||||
|
||||
if [[ ! -S "$socket" ]] ; then
|
||||
systemd-run --unit=virtiofs-${VM_NAME} \
|
||||
--slice=system-virtiofs \
|
||||
--collect \
|
||||
--property=Type=exec \
|
||||
--property=SuccessExitStatus=1 \
|
||||
--property="ExecStopPost=rm $socket" \
|
||||
/usr/local/bin/virtiofsd --socket-path "$socket" \
|
||||
--shared-dir "/lmn/media/${SUDO_USER}"
|
||||
fi
|
||||
sleep 1
|
||||
chown "${SUDO_USER}" "$socket"
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
- virt-viewer
|
||||
- dialog # for vm-netboot menu
|
||||
- python3-impacket
|
||||
- virtiofsd
|
||||
|
||||
# - name: allow all users to use VMs
|
||||
# lineinfile:
|
||||
|
|
@ -125,9 +126,7 @@
|
|||
- vm-upload
|
||||
- vm-sync
|
||||
- vm-link-images
|
||||
- vm-virtiofsd
|
||||
- vm-vminfo
|
||||
- virtiofsd
|
||||
- vm-aria2
|
||||
- uploadseed
|
||||
- desktop-sync
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue