From 0985b23bc36ae4b7f91a7b613bc71de8ace81928 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 12 Jan 2016 15:19:04 +0100 Subject: Touch /etc/cron.d after adding/modifying files, so cron will rescan the dir --- .../hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 2 ++ .../idleaction/data/opt/openslx/scripts/idleaction-cron_script | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index 6c0b667b..ce910a2b 100755 --- a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -198,6 +198,8 @@ for DELAY in 1 1 0; do ${START}-59/5 * * * * root /opt/openslx/scripts/cron-system_usage_update EOF + touch "/etc/cron.d" # Sometimes, aufs doesn't update the mtime of dirs when creating files, + # so cron would not rescan the cron directory exit 0 fi sleep "$DELAY" diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index 9a9bdf1c..100bce82 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -133,9 +133,6 @@ if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRON [ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_reboot" >> "$CRONFILE" done - ( - sleep 20 - systemctl restart cron - ) & + touch "/etc/cron.d" # Aufs bug where it won't update dir mtime when creating the file within fi -- cgit v1.2.3-55-g7522 From 16f9e3d9965fad6970b8a7327b66a591a07dc4c5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 12 Jan 2016 15:20:30 +0100 Subject: [idleaction] Use proper shutdown and reboot This has been working reliably for a while now --- .../modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script | 2 +- .../idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff | 2 +- .../idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index 100bce82..b0e67e4f 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -95,7 +95,7 @@ if [ -n "${SLX_SHUTDOWN_TIMEOUT}" ] && [ "${SLX_SHUTDOWN_TIMEOUT}" -gt 0 ] && [ [ "$IDLE" -gt "$NOW" ] && IDLE="$NOW" IDLE=$(( $NOW - $IDLE )) if [ "$IDLE" -gt "$SLX_SHUTDOWN_TIMEOUT" ]; then - poweroff -nf # TODO: Do proper shutdown once it works reliably + poweroff fi fi diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff index 5b5acda2..742189db 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff @@ -2,5 +2,5 @@ # TODO: Warn user, wait 5 minutes, etc... -poweroff -nf +poweroff diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot index fa3adf65..6c13601f 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot @@ -2,5 +2,5 @@ # TODO: Warn user, wait 5 minutes, etc... -echo 'b' > /proc/sysrq-trigger +reboot -- cgit v1.2.3-55-g7522 From 09af53e04132c58e7f2f31e6602113d3862fe2d3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 13 Jan 2016 21:52:34 +0100 Subject: [vmware] Remove useless include --- .../vmchooser/vmware/includes/set_hardware.inc | 66 ---------------------- .../opt/openslx/vmchooser/vmware/run-virt.include | 5 +- 2 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc (limited to 'remote/modules') diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc deleted file mode 100644 index a94f5b26..00000000 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc +++ /dev/null @@ -1,66 +0,0 @@ -######################################### -# Include: Hardware checks and settings # -######################################### - -# check for 3D configuration setting -case "$enable3d" in - true|yes) - enable3d="TRUE" - ;; - *) - enable3d="FALSE" - ;; -esac - -# set standard sound card, overwrite depending on OS (options sb16, es1371, hdaudio) -sound="es1371" - -# set sound card explicitly if there is more than one card in the host system -sound_fileName='sound.fileName = "-1" -sound.autodetect = "TRUE"' - -# check for whitelisted HW-3D -source /opt/openslx/config -FORCE3D="" -if [ -n "$SLX_VMWARE_3D" ]; then - FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"' -fi - -# read only the first 30 lines to be sure -imghead=$(head -n 30 "${diskfile}") -hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}') - - -if [ -z "$override_hddtype" ]; then - hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}') -else - hddrv=$override_hddtype -fi - -PCIE= -case "${hddrv}" in - ide) - ide="TRUE" - scsi="FALSE" - ;; - lsisas*) - ide="FALSE" - scsi="TRUE" - PCIE='pciBridge4.present = "TRUE" - pciBridge4.virtualDev = "pcieRootPort" - pciBridge4.functions = "8"' - ;; - lsilogic|buslogic) - ide="FALSE" - scsi="TRUE" - ;; - scsi) - ide="FALSE" - scsi="TRUE" - hddrv="lsilogic" - ;; - *) - slxlog "virt-vmware-hdd" "vmware: Unknown HDD adapter type $hddrv" - ;; -esac - diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index f63092bd..4b30c5e6 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -40,9 +40,6 @@ else # declaration of default variables for vmware source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables - # hardware checks: sources /opt/openslx/config to check for whitelisted HW-3D - source "${VMWAREINCLUDEDIR}/set_hardware.inc" - # write configuration files source "${VMWAREINCLUDEDIR}/write_config_files.inc" @@ -53,7 +50,7 @@ else # needs writelog() from vmchooser-run_virt source "${VMWAREINCLUDEDIR}/logging.inc" && logging -fi +fi # $maxhardwareversion -- cgit v1.2.3-55-g7522 From 4d1c783aa4e0a4c842e278fbf2dc99448c24e629 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 13 Jan 2016 22:13:07 +0100 Subject: [vmware] Cap hwversion to 10 if enable3d && useBlacklistedDriver --- .../vmchooser/vmware/includes/parse_vmx.inc | 10 ++++--- .../vmware/includes/set_hardware_legacy.inc | 1 - .../opt/openslx/vmchooser/vmware/run-virt.include | 31 +++++++++++----------- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc index f8f43ad3..092abce5 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc @@ -99,11 +99,15 @@ HEREEND # Serial, parallel: Empty, nothing is being currently set. TODO later. -# Graphics, GPU: 3D will be activated if FORCE3D is set. -# Force3D is set in set_hardware.inc if SLX_VMWARE_3D is set in config. -if [ -n "$FORCE3D" ]; then +# Graphics, GPU: 3D will be enabled (even if vmware doesn't support the chip) if we whitelisted it. +if [ -n "$SLX_VMWARE_3D" ]; then writelog "FORCE3D set - overriding 3D in vmx file." echo 'mks.gl.allowBlacklistedDrivers = "TRUE"' >> "$TMPDIR/$IMGUUID" + # We override... play safe and cap the hwVersion to 10, since some i915 chips goofed up with 12 + # Investigate if we might have to do this in other cases where we don't override + if grep -qi '^mks.enable3d.*true' "$TMPDIR/$IMGUUID"; then + vmw_cap_hw_version "10" + fi else writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware." fi diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc index 899f5aea..22718839 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc @@ -43,7 +43,6 @@ case "$enable3d" in esac # check for whitelisted HW-3D -source /opt/openslx/config FORCE3D="" if [ -n "$SLX_VMWARE_3D" ]; then FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"' diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index 4b30c5e6..5c76a180 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -22,40 +22,41 @@ VMWAREINCLUDEDIR=/opt/openslx/vmchooser/vmware/includes vmostype=$(rv_clean_string "$vmostype") +# declaration of default variables for vmware +source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables +# General global openslx config +source /opt/openslx/config + +# TODO: Where to put global helper functions that could be used in several units below? +vmw_cap_hw_version() { + [ -z "$1" ] && writelog "cap_hw_version called without parameter!" && return 1 + [ "$1" -lt "$maxhardwareversion" ] && maxhardwareversion="$1" +} + if [ "$LEGACY" ]; then - # declaration of default variables for vmware - source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables # hardware checks - # sources /opt/openslx/config to check for whitelisted HW-3D source "${VMWAREINCLUDEDIR}/set_hardware_legacy.inc" && set_hardware_legacy # write configuration files # write_config_files calls: # set_vmhome_preferences_header # set_vmware_startup_file source "${VMWAREINCLUDEDIR}/write_config_files_legacy.inc" && write_config_files_legacy - # logging and stdout - # needs writelog() from vmchooser-run_virt - source "${VMWAREINCLUDEDIR}/logging.inc" && logging else - # declaration of default variables for vmware - source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables - # write configuration files source "${VMWAREINCLUDEDIR}/write_config_files.inc" # parse the given vmx file source "${VMWAREINCLUDEDIR}/parse_vmx.inc" - - # logging and stdout - # needs writelog() from vmchooser-run_virt - source "${VMWAREINCLUDEDIR}/logging.inc" && logging - fi -# $maxhardwareversion +# logging and stdout +# needs writelog() from vmchooser-run_virt +source "${VMWAREINCLUDEDIR}/logging.inc" && logging +# Apply $maxhardwareversion to final VMX HWVER=$(grep -i '^virtualHW.version *= *' "$conffile" | head -n 1 | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g') if [ -n "$HWVER" ] && [ "$HWVER" -gt "$maxhardwareversion" ]; then + writelog "Hardware version capped to $maxhardwareversion (was $HWVER)" sed -i 's/^virtualHW\.version.*$/virtualHW.version = "'$maxhardwareversion'"/I' "$conffile" fi -- cgit v1.2.3-55-g7522 From fdba12213a1542f20c3c8ef2e0db24f98fc52385 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 13 Jan 2016 22:35:17 +0100 Subject: [kdm*] Don't use hard reboot/poweroff as it's not necessary Long time ago, the normal shutdown procedure would lock up the system, but this works reliably on newer kernels now. --- remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc | 4 ++-- remote/modules/kdm/data/etc/kde4/kdm/kdmrc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc index 0b283d2a..e1f9f357 100644 --- a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc +++ b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc @@ -46,8 +46,8 @@ Startup=/etc/X11/Xstartup [Shutdown] AllowFifo=false -HaltCmd=/usr/bin/systemctl -ff poweroff -RebootCmd=/usr/bin/systemctl -ff reboot +HaltCmd=/usr/bin/systemctl poweroff +RebootCmd=/usr/bin/systemctl reboot [Xdmcp] Enable=false diff --git a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc index f7e7be86..5f9f9e39 100644 --- a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc +++ b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc @@ -44,8 +44,8 @@ Startup=/etc/X11/Xstartup [Shutdown] AllowFifo=false -HaltCmd=/usr/bin/systemctl -ff poweroff -RebootCmd=/usr/bin/systemctl -ff reboot +HaltCmd=/usr/bin/systemctl poweroff +RebootCmd=/usr/bin/systemctl reboot [Xdmcp] Enable=false -- cgit v1.2.3-55-g7522 From 9c14140ec9d487aac7be949beabe957e9684959a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 14 Jan 2016 00:05:18 +0100 Subject: [idleaction] Warn user about scheduled reboot/poweroff and delay by 5 minutes --- .../opt/openslx/scripts/idleaction-cron_script | 6 +- .../openslx/scripts/idleaction-scheduled_action | 77 ++++++++++++++++++++++ .../openslx/scripts/idleaction-scheduled_poweroff | 6 -- .../openslx/scripts/idleaction-scheduled_reboot | 6 -- 4 files changed, 80 insertions(+), 15 deletions(-) create mode 100755 remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action delete mode 100755 remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff delete mode 100755 remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot (limited to 'remote/modules') diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index b0e67e4f..b7617940 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -29,7 +29,7 @@ if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then if [ -n "$DISPLAY" ]; then # Seems to be x11 IDLE= - export XAUTHORITY=$(ps a | grep -v grep | grep -o -- '-auth.*$' | awk '{print $2}') + export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') [ -n "$XAUTHORITY" ] && [ -f "$XAUTHORITY" ] && IDLE=$(xprintidle) # Now that we have DISPLAY and XAUTHORITY set, xprintidle should work if [ -z "$IDLE" ]; then @@ -122,7 +122,7 @@ if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRON [ -z "$HOUR$MINUTE" ] && invalid_time && continue [ "$HOUR" -lt 0 -o "$HOUR" -gt 23 ] && invalid_time && continue [ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue - echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_poweroff" >> "$CRONFILE" + echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_action poweroff" >> "$CRONFILE" done # do it again for SLX_REBOOT_SCHEDULE for time in $SLX_REBOOT_SCHEDULE; do @@ -131,7 +131,7 @@ if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRON [ -z "$HOUR$MINUTE" ] && invalid_time && continue [ "$HOUR" -lt 0 -o "$HOUR" -gt 23 ] && invalid_time && continue [ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue - echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_reboot" >> "$CRONFILE" + echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_action reboot" >> "$CRONFILE" done touch "/etc/cron.d" # Aufs bug where it won't update dir mtime when creating the file within fi diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action new file mode 100755 index 00000000..6ef6969c --- /dev/null +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action @@ -0,0 +1,77 @@ +#!/bin/ash + +if [ "$(whoami)" != "root" ]; then + echo "Only root can call this" + exit 1 +fi + +if [ $# -ne 1 ]; then + echo "$0 " + exit 1 +fi + +MODE=$1 + +if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ]; then + slxlog "idleaction-failed-call" "Invalid call to idleaction-scheduled_action. Mode '$MODE' unknown." + exit 1 +fi + +NUM=$(who | wc -l) +[ "$NUM" = "0" ] && $MODE # Easy way out - machine is idle + +# Someone logged in +for MINUTES in 5 X X X X X X X 3 X X X 2 X X X 1 X X X; do + NUM=$(who | wc -l) + [ "$NUM" = "0" ] && break + if [ "$MINUTES" != "X" ]; then + USERS=0 + if [ "$MODE" = "reboot" ]; then + MESSAGE="Das System wird in $MINUTES Minute(n) neugestartet, bitte beenden Sie Ihre Sitzung. +The system will reboot in $MINUTES minute(s). Please save your work and end the session." + else + MESSAGE="Dieser Rechner wird in $MINUTES Minute(n) abgeschaltet, bitte beenden Sie Ihre Sitzung. +The system will power off in $MINUTES minute(s). Please save your work and end the session." + fi + for d in $(who | awk '{print $2}' | sort -u); do + if [ "${d:0:1}" = ":" ]; then + # X11 + export DISPLAY=$d + export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') + # TODO: Don't look... We need to pick a proper util for this + /opt/openslx/cups/printergui --error "$MESSAGE" & + unset DISPLAY XAUTHORITY + USERS=$(( $USERS + 1 )) + elif [ "${d:0:3}" = "tty" ]; then + # Regular tty + cat > "/dev/$d" <<-EOF + * + *************************** + $MESSAGE + *************************** + * + EOF + USERS=$(( $USERS + 1 )) + elif [ "${d:0:3}" = "pts" ]; then + # pts - xterm or ssh session + cat > "/dev/pts/${d:3}" <<-EOF + * + *************************** + $MESSAGE + *************************** + * + EOF + USERS=$(( $USERS + 1 )) + fi + done + FILE=$(mktemp) + who > "$FILE" + slxlog "idleaction-busy" "Postponed $MODE ($MINUTES minutes max.) - $USERS user(s) still active" + sleep 1 + rm -- "$FILE" + fi + sleep 15 +done + +$MODE + diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff deleted file mode 100755 index 742189db..00000000 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/ash - -# TODO: Warn user, wait 5 minutes, etc... - -poweroff - diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot deleted file mode 100755 index 6c13601f..00000000 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/ash - -# TODO: Warn user, wait 5 minutes, etc... - -reboot - -- cgit v1.2.3-55-g7522 From 6fcc57bd06ad2f05eb488c9c684faaa41bead6f0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Jan 2016 16:22:23 +0100 Subject: [run-virt] Don't exit 1 if we don't have a vmstore as it's optional nowadays --- remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote/modules') diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store b/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store index 4559e1e3..9d478918 100755 --- a/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store +++ b/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store @@ -2,7 +2,7 @@ . /opt/openslx/config || exit 1 -[ -z "$SLX_VM_NFS" ] && slxlog "mount-vmstore-missing" "No SLX_VM_NFS given in /opt/openslx/config!" && exit 1 +[ -z "$SLX_VM_NFS" ] && exit 0 # create target directory mkdir -p /mnt/vmstore -- cgit v1.2.3-55-g7522 From 7ff0aa4ba96f51a1b4ab4732dd4349f98bde5e0f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 Jan 2016 14:26:03 +0100 Subject: [busybox] Enable utmp feature so who is actually included --- remote/modules/busybox/openslx-busybox-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote/modules') diff --git a/remote/modules/busybox/openslx-busybox-config b/remote/modules/busybox/openslx-busybox-config index ee5e99ee..00a008d7 100644 --- a/remote/modules/busybox/openslx-busybox-config +++ b/remote/modules/busybox/openslx-busybox-config @@ -39,7 +39,7 @@ CONFIG_LAST_SUPPORTED_WCHAR=767 CONFIG_LONG_OPTS=y CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_CLEAN_UP is not set -# CONFIG_FEATURE_UTMP is not set +CONFIG_FEATURE_UTMP=y # CONFIG_FEATURE_WTMP is not set CONFIG_FEATURE_PIDFILE=y CONFIG_PID_FILE_PATH="/var/run" -- cgit v1.2.3-55-g7522 From 8d806ffba5dd22c433720c38a7e5111207ed5af5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 21 Jan 2016 10:49:29 +0100 Subject: [vmchooser2] Add support for new location related parameters --- remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser index 4f30f447..a99207ff 100755 --- a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser +++ b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser @@ -16,7 +16,7 @@ else fi MEM=$(grep -m1 '^MemTotal:' /proc/meminfo | awk '{print $2}') -if [ -n "$SLX_VMCHOOSER_TAB" ] && [ "$SLX_VMCHOOSER_TAB" -ge 0 -a "$SLX_VMCHOOSER_TAB" -le 2 ]; then +if [ -n "$SLX_VMCHOOSER_TAB" ] && [ "$SLX_VMCHOOSER_TAB" -ge 0 -a "$SLX_VMCHOOSER_TAB" -le 2 ] 2>/dev/null; then TAB="$SLX_VMCHOOSER_TAB" elif [ "$MEM" -lt 3000000 ]; then # Check RAM size; if it's not that much, default to the native linux sessions TAB=0 @@ -24,9 +24,13 @@ else TAB=2 fi -if [ -n "$SLX_VM_POOL_FILTER" ]; then - exec vmchooser.real "$@" --url "$URL" --pool "$SLX_VM_POOL_FILTER" --fullscreen --tab "$TAB" -else - exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" +EXTRA= +[ -n "$SLX_VMCHOOSER_TEMPLATES" ] && EXTRA="$EXTRA --template-mode $SLX_VMCHOOSER_TEMPLATES" +[ -n "$SLX_VMCHOOSER_FORLOCATION" ] && EXTRA="$EXTRA --location-mode $SLX_VMCHOOSER_FORLOCATION" + +if [ -z "$SLX_LOCATIONS" ]; then + exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" $EXTRA fi +exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" --locations "$SLX_LOCATIONS" $EXTRA + -- cgit v1.2.3-55-g7522