diff --git a/scripts/qemu-guest b/scripts/qemu-guest index 47336338..14cbfd45 100755 --- a/scripts/qemu-guest +++ b/scripts/qemu-guest @@ -339,28 +339,15 @@ _ideid_2_unit() printf '%d' "$UNIT" } -## -## ARE WE ROOT? -## -if [ $( id -u ) != 0 ]; then - if [ -x $( which sudo ) ]; then - echo "Trying to get root privileges..." 1>&2 - exec sudo "$0" "$@" - exit 2 - fi - - echo "Please run as root" 1>&2 - exit 1 -fi - ## ## MAIN ## QEMU_BASE_ARGS=() QEMU_ARGS=() -SOCK_MONITOR="/run/$( basename "$0" )-$$_monitor.socket" -SOCK_SERIAL="/run/$( basename "$0" )-$$_serial.socket" -PIDFILE="/run/$( basename "$0" )-$$_qemu.pid" +RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run}" +SOCK_MONITOR="$RUNTIME_DIR/$( basename "$0" )-$$_monitor.socket" +SOCK_SERIAL="$RUNTIME_DIR/$( basename "$0" )-$$_serial.socket" +PIDFILE="$RUNTIME_DIR/$( basename "$0" )-$$_qemu.pid" TEMP="/tmp/$( basename "$0" )-$$" ARG_MACHINETYPE="x86pc"