File: libvirt-daemon-system.config

package info (click to toggle)
libvirt 9.0.0-4%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 155,976 kB
  • sloc: ansic: 513,441; xml: 179,638; python: 10,469; sh: 3,737; perl: 2,769; makefile: 429; javascript: 116; cpp: 22
file content (34 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh -e

# Only perform this check/warning if the libvirt user groups aren't there
# already
if getent passwd libvirt-qemu >/dev/null \
&& getent group  libvirt-qemu >/dev/null; then
    exit 0
fi

# Source debconf library.
. /usr/share/debconf/confmodule

# Allocated UID and GID for libvirt-qemu
LIBVIRT_QEMU_UID=64055
LIBVIRT_QEMU_GID=64055

# Check if allocated UID/GID are assigned to a different user/group.
UID_TO_NAME="$(getent passwd $LIBVIRT_QEMU_UID | cut -d: -f1)"
GID_TO_NAME="$(getent group  $LIBVIRT_QEMU_GID | cut -d: -f1)"

if ( [ -n "$UID_TO_NAME" ] && [ "$UID_TO_NAME" != 'libvirt-qemu' ] ) \
|| ( [ -n "$GID_TO_NAME" ] && [ "$GID_TO_NAME" != 'libvirt-qemu' ] ) \
then
    # Ask if the user would like to continue or abort installation.
    db_input high libvirt-daemon-system/id_warning || true
    db_go
    db_get libvirt-daemon-system/id_warning
    if [ "$RET" = "false" ]; then
        exit 1
    fi
fi

db_stop
exit 0