From cf037ad50701aa29ffe8e0cccebb4aab3c7751b2 Mon Sep 17 00:00:00 2001 From: thaibault Date: Tue, 2 Jul 2013 14:38:54 +0200 Subject: Patched code to support persistent virtual machines for specified users. --- .../vmchooser/data/opt/openslx/bin/clc.bash | 306 +++++++++++++++++++++ .../vmchooser/data/opt/openslx/bin/run-virt.sh | 34 ++- .../vmchooser/data/opt/openslx/bin/xmlfilter.sh | 26 +- 3 files changed, 359 insertions(+), 7 deletions(-) create mode 100755 remote/modules/vmchooser/data/opt/openslx/bin/clc.bash (limited to 'remote/modules/vmchooser/data') diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash new file mode 100755 index 00000000..f5c989f4 --- /dev/null +++ b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash @@ -0,0 +1,306 @@ +#!/bin/bash + +# region header + +# Copyright Torben Sickert 16.12.2012 + +# License +# This library written by Torben Sickert stand under a creative commons +# naming 3.0 unported license. +# see http://creativecommons.org/licenses/by/3.0/deed.de + +# vim: set tabstop=4 shiftwidth=4 expandtab: +# vim: foldmethod=marker foldmarker=region,endregion: + +# Dependencies: + +# vmware or virtualbox + +# Notes: + +# USE "sudo bin/vmware-vmx --new-sn JJ237-G52E2-08X0C-C3306-0WCQ1" +# To activate wmware workstation! + +# Abbreviation for "createLinkedClone". +__NAME__='clc' + +# endregion + +# Provides the main module scope. +function clc() { + +# region configuration + + # region private properties + + # region command line arguments + + local _VERBOSE='no' + local _SUPPORTED_HYPERVISOR=('VMware' 'virtualBox') + # NOTE: This value will be determined automatically. If no hypervisor + # could be detected this value will be used as default. + # The first value from supported Machines is taken as default. + local _HYPERVISOR="$_SUPPORTED_HYPERVISOR" + local _PERSISTENT_SHORT_DESCRIPTION_SUFFIX=' --persistent--' + + # endregion + + local _STANDARD_OUTPUT=/dev/null + local _ERROR_OUTPUT=/dev/null + local _BASIC_IMAGE_CONFIGURATION_FILE_PATH='' + local _TARGET_PATH='' + local _CREATE_PERSISTENT_CONFIG='no' + + # endregion + +# endregion + +# region functions + + # region command line interface + + # Prints a description about how to use this program. + function clcPrintUsageMessage() { + cat << EOF + $__NAME__ Generates a linked clone from given machine description file in + given target location. +EOF + return $? + } + + # Prints a description about how to use this program by providing examples. + function clcPrintUsageExamples() { + cat << EOF + # Getting a help message. + >>> $0 --help + + # Creating a linked clone. + >>> $0 /path/to/config.xml ~/.persistentLinkedClones/ + + # Creating a linked clone in verbose mode. + >>> $0 /path/to/config.xml ~/.persistentLinkedClones/ --verbose + + # Creating a linked clone in verbose mode with debugging output. + >>> $0 /path/to/config.xml ~/.persistentLinkedClones/ --verbose --debug + + # Creating a linked clone in verbose mode with debugging output. + >>> $0 /path/to/config.xml ~/.persistentLinkedClones/ -v -d +EOF + return $? + } + + # Prints descriptions about each available command line option. + function clcPrintCommandLineOptionDescriptions() { + # NOTE; All letters are used for short options. + cat << EOF + -h --help Shows this help message. + + -v --verbose Tells you what is going on (default: "$_VERBOSE"). + + -d --debug Gives you any output from all tools which are used + (default: "$_DEBUG"). + + -c --create-persistent-config If set an xml file for persistent openslx + boot will be created (default: "$_CREATE_PERSISTENT_CONFIG"). +EOF + return $? + } + + # Provides a help message for this module. + function clcPrintHelpMessage() { + echo -e \ + "\nUsage: $0 BASIC_IMAGE_CONFIGURATION_FILE_PATH TARGET_PATH [options]\n" && \ + clcPrintUsageMessage "$@" && \ + echo -e '\nExamples:\n' && \ + clcPrintUsageExamples "$@" && \ + echo -e '\nOption descriptions:\n' && \ + clcPrintCommandLineOptionDescriptions "$@" && \ + echo && \ + return $? + } + + # Provides the command line interface and interactive questions. + function clcCommandLineInterface() { + while true; do + case "$1" in + -h|--help) + shift + clcPrintHelpMessage "$0" + exit 0 + ;; + -v|--verbose) + shift + _VERBOSE='yes' + ;; + -d|--debug) + shift + _DEBUG='yes' + _STANDARD_OUTPUT=/dev/stdout + _ERROR_OUTPUT=/dev/stderr + ;; + -c|--create-persistent-config) + shift + _CREATE_PERSISTENT_CONFIG='yes' + ;; + + '') + shift + break 2 + ;; + *) + if [[ ! "$_BASIC_IMAGE_CONFIGURATION_FILE_PATH" ]]; then + _BASIC_IMAGE_CONFIGURATION_FILE_PATH="$1" + elif [[ ! "$_TARGET_PATH" ]]; then + _TARGET_PATH="$1" + else + clcLog 'critical' \ + "Given argument: \"$1\" is not available." '\n' + clcPrintHelpMessage "$0" + return 1 + fi + shift + ;; + esac + done + if [[ ! "$_BASIC_IMAGE_CONFIGURATION_FILE_PATH" ]] || \ + [[ ! "$_TARGET_PATH" ]]; then + clcLog 'critical' \ + "You have to provide a basic image configuration file and a destination path." + clcPrintHelpMessage "$0" + return 1 + fi + local supportedVirtualMachine + for supportedVirtualMachine in ${_SUPPORTED_HYPERVISOR[*]}; do + if [[ "$(clcGetXMLValue 'virtualMachine' | \ + grep --ignore-case "$supportedVirtualMachine")" ]]; then + _HYPERVISOR="$supportedVirtualMachine" + clcLog 'debug' "Detected \"$_HYPERVISOR\" as hypervisor." + break + fi + done + clcLog 'info' "Using \"$_HYPERVISOR\" as hypervisor." && \ + return $? + } + + # Grabs a value from currently loaded xml file. + function clcGetXMLValue() { + grep --ignore-case --only-matching "<$1 param=.*" \ + "$_BASIC_IMAGE_CONFIGURATION_FILE_PATH" | awk -F '"' '{ print $2 }' + return $? + } + + # Handles logging messages. Returns non zero and exit on log level error to + # support chaining the message into toolchain. + function clcLog() { + local loggingType='info' + local message="$1" + if [ "$2" ]; then + loggingType="$1" + message="$2" + fi + if [ "$_VERBOSE" == 'yes' ] || [ "$loggingType" == 'error' ] || \ + [ "$loggingType" == 'critical' ]; then + if [ "$3" ]; then + echo -e -n "$3" + fi + echo -e "${loggingType}: $message" + fi + if [ "$loggingType" == 'error' ]; then + exit 1 + fi + } + + # endregion + + # region tools + + # Returns the minimal vmx vmware configuration file content to create a + # snapshot. + function clcGetTemporaryVMXContent() { + cat << EOF +.encoding = "UTF-8" +config.version = "8" +virtualHW.version = "7" +ide0:0.present = "TRUE" +ide0:0.fileName = "$1" +displayName = "" +EOF + return $? + } + + # Creates a snapshot from VMware generated virtual machine. + function clcCreateVMwareSnapshot() { + local temporaryConfigurationPath="$(mktemp --directory)/" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + local temporaryConfigurationFilePath="$(mktemp --suffix '.vmx')" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + clcGetTemporaryVMXContent "/var/lib/virt/vmware/$(clcGetXMLValue 'image_name')" \ + 1>"$temporaryConfigurationFilePath" 2>"$_ERROR_OUTPUT" && \ + mv "$temporaryConfigurationFilePath" "$temporaryConfigurationPath" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + clcLog "Needed files generated in \"$temporaryConfigurationPath\" generated." && \ + vmrun snapshot "$temporaryConfigurationPath"*.vmx \ + persistentUserSnapshot 1>"$_STANDARD_OUTPUT" \ + 2>"$_ERROR_OUTPUT" && \ + mv "$temporaryConfigurationPath"*.vmdk "$_TARGET_PATH" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" + local result=$? + if [[ "$_DEBUG" == 'no' ]]; then + rm --recursive "$temporaryConfigurationPath" 1>"$_STANDARD_OUTPUT" \ + 2>"$_ERROR_OUTPUT" + fi + return $result + } + + # Creates a snapshot from virtualBox generated virtual machine. + function clcCreateVirtualBoxSnapshot() { + local temporaryConfigurationPath="$(mktemp --directory)" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + VBoxManage clonevm TODO ->(VMNAME) --snapshot base --options link \\ + --basefolder "$temporaryConfigurationPath" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + mv "${temporaryConfigurationPath}/Snapshots/"*.vmdk "$_TARGET_PATH" \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + rm --recursive "$temporaryConfigurationPath" 1>"$_STANDARD_OUTPUT" \ + 2>"$_ERROR_OUTPUT" && \ + return $? + } + + # Creates a persistent version of given config file. + function clcCreatePersistentConfig() { + cp "$_BASIC_IMAGE_CONFIGURATION_FILE_PATH" "$_TARGET_PATH" && \ + 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" && \ + sed --in-place --regexp-extended \ + "s/(< *short_description[^>]*param=\"[^\"]*)(\")/\\1$_PERSISTENT_SHORT_DESCRIPTION_SUFFIX\\2/g" \ + "$_TARGET_PATH" 1>"$_STANDARD_OUTPUT" 2>"$_ERROR_OUTPUT" + return $? + } + + # endregion + +# endregion + +# region controller + + clcCommandLineInterface "$@" || return $? + if [[ "$_CREATE_PERSISTENT_CONFIG" == 'yes' ]]; then + clcCreatePersistentConfig || \ + clcLog 'error' 'Creating persitent config failed.' + else + "clcCreate${_HYPERVISOR}Snapshot" || \ + clcLog 'error' 'Creating Linked Clone failed.' + fi + clcLog 'Program has successfully finished.' && \ + return $? + +# endregion + +} + +# region footer + +if [[ "$0" == *"${__NAME__}.bash" ]]; then + "$__NAME__" "$@" +fi + +# endregion diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh index f338cd37..48c63789 100755 --- a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh @@ -110,8 +110,29 @@ filecheck () ### Get XML file and dir ################################################################################ +## Added for persistent support. +diskmode='nonpersistent' +xmlfile="$1" +if [[ "$(grep --extended-regexp '< *persistent *param=".+"' "$1")" ]]; then + imageFilePath=$(grep -io '/dev/null | grep '/' >/dev/null 2>&1; then xmlpath=$(dirname ${xmlfile}) xmlfile=$(basename ${xmlfile}) @@ -170,6 +191,12 @@ writelog "VM config:" # Name of the virt image imgname=$(grep -io '/dev/null | grep -q '^/' >/dev/null 2>&1; then @@ -181,6 +208,11 @@ if echo ${imgname} 2>/dev/null | grep -q '^/' >/dev/null 2>&1; then elif echo ${xmlfile} 2>/dev/null | grep -q '^/tmp/' >/dev/null 2>&1; then vmpath=$imgname imgname=$(basename ${imgname}) +# TODO(torben) check if this code is necessary in future. +## Added for persistent support. +elif [[ "$userBranchFilePath" ]]; then + vmpath="$userBranchFilePath" +## # Else use same path as xml else imgpath=${xmlpath} diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh index ded5d114..67e49d3e 100755 --- a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh @@ -33,18 +33,32 @@ if [ -f ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf ]; then . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/vmchooser.conf fi -for FILE in $(find $1 -iname "*.xml"); do +function handlePersistentVM() { + if [[ "$(grep --extended-regexp \ + " 100644 remote/modules/vmchooser/data/opt/openslx/bin/clc.bash mode change 100755 => 100644 remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh mode change 100755 => 100644 remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh (limited to 'remote/modules/vmchooser/data') diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash old mode 100755 new mode 100644 diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh old mode 100755 new mode 100644 index 48c63789..826bfecd --- a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh @@ -117,7 +117,7 @@ if [[ "$(grep --extended-regexp '< *persistent *param=".+"' "$1")" ]]; then imageFilePath=$(grep -io '/dev/null | grep '/' >/dev/null 2>&1; then xmlpath=$(dirname ${xmlfile}) xmlfile=$(basename ${xmlfile}) else - xmlpath=${path} + xmlpath=${vmchooser_xmlpath} fi # full path xmlfile="${xmlpath}/${xmlfile%.xml}.xml" @@ -191,11 +191,10 @@ writelog "VM config:" # Name of the virt image imgname=$(grep -io '/dev/null | grep -q '^/' >/dev/null 2>&1; then elif echo ${xmlfile} 2>/dev/null | grep -q '^/tmp/' >/dev/null 2>&1; then vmpath=$imgname imgname=$(basename ${imgname}) -# TODO(torben) check if this code is necessary in future. ## Added for persistent support. elif [[ "$userBranchFilePath" ]]; then vmpath="$userBranchFilePath" diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh old mode 100755 new mode 100644 -- cgit v1.2.3-55-g7522 From 41108f3056d91b4f8c6fa41be48a4f314f0b5dce Mon Sep 17 00:00:00 2001 From: thaibault Date: Tue, 2 Jul 2013 14:50:35 +0200 Subject: Add executable rights to all scripts. --- remote/modules/vmchooser/data/opt/openslx/bin/clc.bash | 0 remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh | 0 remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh | 0 remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 remote/modules/vmchooser/data/opt/openslx/bin/clc.bash mode change 100644 => 100755 remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh mode change 100644 => 100755 remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh mode change 100644 => 100755 remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include (limited to 'remote/modules/vmchooser/data') diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash old mode 100644 new mode 100755 diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh old mode 100644 new mode 100755 diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh old mode 100644 new mode 100755 diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include old mode 100644 new mode 100755 -- cgit v1.2.3-55-g7522 From 47733a7f2f1ac3e07795c56a11cdf4019628e6bc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 4 Jul 2013 17:29:19 +0200 Subject: [vmchooser] Create text file in floppy image that tells the guest the host's resolution [vmplayer] do not override enable3d setting from xml when system supports 3d --- .../vmchooser/data/opt/openslx/bin/run-virt.sh | 31 +++------------------- .../data/etc/openslx/vmware/run-virt.include | 1 - 2 files changed, 3 insertions(+), 29 deletions(-) (limited to 'remote/modules/vmchooser/data') diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh index 826bfecd..eacb8837 100755 --- a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh @@ -365,30 +365,6 @@ hddrv="ide" audio="true" remotedesktopport="590${VM_ID}" -# Display resolution within the host system -hostres=$(xvidtune -show 2>/dev/null| grep -ve "^$") -xres=$(echo "${hostres}" | awk '{print $3}') -yres=$(echo "${hostres}" | awk '{print $7}') - -# Resolution defined via xml parameter: fullscreen, full/X*Y/depth; windowed, -# win/X*Y/depth -userres=$(grep -io '/dev/null | \ @@ -429,10 +405,9 @@ fi # Copy guest configuration (with added information) config.xml to be accessed # via virtual floppy -# fixme -> to be changed (vmchooser adapts the file content!?) -#TODO: wozu echo? -#echo "Please fix the config.xml generation" -cp ${xmlfile} /etc/openslx/vmchooser/fd-loop/config.xml +cp "$xmlfile" "/etc/openslx/vmchooser/fd-loop/config.xml" +# Add another file with resolution information +xrandr | grep -o -E 'current\s*[0-9]+\s*x\s*[0-9]+' | cut -c 8- | sed -r 's/(\s|\t|\n)//g' | head -1 > "/etc/openslx/vmchooser/fd-loop/hostres.txt" # Get all virtual machine specific stuff from the respective include file if [ -e /etc/openslx/${xmlvirt}/run-virt.include ] ; then diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include index 9b0fea91..45ff2d72 100644 --- a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include +++ b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include @@ -351,7 +351,6 @@ esac local FORCE3D="" if [ -n "$SLX_VMWARE_3D" ]; then FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"' - enable3d="TRUE" fi # serial/parallel port defined (e.g. "ttyS0, lp0" or "autodetect") -- cgit v1.2.3-55-g7522 From 7c375528887dae948b29d6dad70ed807dd681c85 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 5 Jul 2013 12:02:08 +0200 Subject: [pam] Cleanup, formatting, force nscd usage in nsswitch.conf, set timeouts for LDAP lookups --- remote/modules/nscd/data/etc/nscd.conf | 2 +- remote/modules/pam/data/etc/ldap.conf | 3 +++ remote/modules/pam/data/etc/pam.d/common-session | 23 +++++++++++----------- remote/modules/pam/data/etc/pam.d/kdm | 9 ++++----- remote/modules/pam/data/etc/pam.d/kdm-np | 6 +++--- remote/modules/pam/data/etc/pam.d/login | 3 ++- .../etc/systemd/system/activate-nss-ldap.service | 4 +++- .../vmchooser/data/opt/openslx/bin/run-virt.sh | 2 +- 8 files changed, 29 insertions(+), 23 deletions(-) (limited to 'remote/modules/vmchooser/data') diff --git a/remote/modules/nscd/data/etc/nscd.conf b/remote/modules/nscd/data/etc/nscd.conf index d0a3b107..863a6f50 100644 --- a/remote/modules/nscd/data/etc/nscd.conf +++ b/remote/modules/nscd/data/etc/nscd.conf @@ -61,7 +61,7 @@ auto-propagate group yes enable-cache hosts yes - positive-time-to-live hosts 3600 + positive-time-to-live hosts 1800 negative-time-to-live hosts 20 suggested-size hosts 211 check-files hosts yes diff --git a/remote/modules/pam/data/etc/ldap.conf b/remote/modules/pam/data/etc/ldap.conf index 43b1640e..483595d2 100644 --- a/remote/modules/pam/data/etc/ldap.conf +++ b/remote/modules/pam/data/etc/ldap.conf @@ -1,5 +1,8 @@ URI ldaps://bv1.ruf.uni-freiburg.de ldaps://bv2.ruf.uni-freiburg.de ldaps://bv3.ruf.uni-freiburg.de BASE ou=people,dc=uni-freiburg,dc=de +BIND_TIMELIMIT 5 +TIMELIMIT 10 +LOGDIR /tmp/ldap TLS_REQCERT allow nss_base_passwd ou=people,dc=uni-freiburg,dc=de?one?rufdienst=ldap*)(&(rufclienthome=*)(rufstatus=enabled) nss_base_group ou=group,dc=uni-freiburg,dc=de?one diff --git a/remote/modules/pam/data/etc/pam.d/common-session b/remote/modules/pam/data/etc/pam.d/common-session index af0e62fb..6182d470 100644 --- a/remote/modules/pam/data/etc/pam.d/common-session +++ b/remote/modules/pam/data/etc/pam.d/common-session @@ -13,24 +13,25 @@ # pam-auth-update(8) for details. # here are the per-package modules (the "Primary" block) -session [default=1] pam_permit.so +session [default=1] pam_permit.so # here's the fallback if no module succeeds -session requisite pam_deny.so +session requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around -session required pam_permit.so +session required pam_permit.so # The pam_umask module will set the umask according to the system default in # /etc/login.defs and user settings, solving the problem of different # umask settings with different shells, display managers, remote sessions etc. # See "man pam_umask". -session optional pam_umask.so +session optional pam_umask.so # and here are more per-package modules (the "Additional" block) -session required pam_systemd.so -session optional pam_env.so readenv=1 -session optional pam_krb5.so minimum_uid=1000 -session [success=1] pam_unix.so -session [success=ok] pam_ldap.so -session sufficient pam_script.so -session optional pam_mkhomedir.so skel=/etc/skel umask=0022 +session required pam_systemd.so +session optional pam_env.so readenv=1 +session optional pam_env.so readenv=1 envfile=/etc/default/locale +session optional pam_krb5.so minimum_uid=1000 +session [success=1] pam_unix.so +session [success=ok] pam_ldap.so +session sufficient pam_script.so +session optional pam_mkhomedir.so skel=/etc/skel umask=0022 # end of pam-auth-update config diff --git a/remote/modules/pam/data/etc/pam.d/kdm b/remote/modules/pam/data/etc/pam.d/kdm index 11b5f1fc..e6a4ec9b 100644 --- a/remote/modules/pam/data/etc/pam.d/kdm +++ b/remote/modules/pam/data/etc/pam.d/kdm @@ -4,8 +4,7 @@ auth required pam_nologin.so auth required pam_env.so readenv=1 auth required pam_env.so readenv=1 envfile=/etc/default/locale -auth include common-auth -session required pam_limits.so -account include common-account -password include common-password -session include common-session +auth include common-auth +account include common-account +password include common-password +session include common-session diff --git a/remote/modules/pam/data/etc/pam.d/kdm-np b/remote/modules/pam/data/etc/pam.d/kdm-np index 8c1a2a81..dc10e5b5 100644 --- a/remote/modules/pam/data/etc/pam.d/kdm-np +++ b/remote/modules/pam/data/etc/pam.d/kdm-np @@ -5,7 +5,7 @@ auth required pam_nologin.so auth required pam_env.so readenv=1 auth required pam_env.so readenv=1 envfile=/etc/default/locale session required pam_limits.so -account include common-account -password include common-password -session include common-session +account include common-account +password include common-password +session include common-session auth required pam_permit.so diff --git a/remote/modules/pam/data/etc/pam.d/login b/remote/modules/pam/data/etc/pam.d/login index 561c71df..1065f351 100644 --- a/remote/modules/pam/data/etc/pam.d/login +++ b/remote/modules/pam/data/etc/pam.d/login @@ -40,7 +40,8 @@ auth requisite pam_nologin.so # that a module could execute code in the wrong domain. # When the module is present, "required" would be sufficient (When SELinux # is disabled, this returns success.) -session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close +# OpenSLX: Not Needed? +#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close # This module parses environment configuration file(s) # and also allows you to use an extended config diff --git a/remote/modules/pam/data/etc/systemd/system/activate-nss-ldap.service b/remote/modules/pam/data/etc/systemd/system/activate-nss-ldap.service index 518681b6..bbac775a 100644 --- a/remote/modules/pam/data/etc/systemd/system/activate-nss-ldap.service +++ b/remote/modules/pam/data/etc/systemd/system/activate-nss-ldap.service @@ -1,8 +1,10 @@ [Unit] Description=Activate NSS-LDAP lookups +Before=graphical.target [Service] Type=oneshot -ExecStart=/opt/openslx/bin/sed -i -e 's/^passwd.*/passwd:\t\tfiles ldap/g;s/^group.*/group:\t\tfiles ldap/g' /etc/nsswitch.conf +ExecStart=-/opt/openslx/bin/mkdir /tmp/ldap +ExecStart=/opt/openslx/bin/sed -i -e 's/^passwd:.*$/passwd:\t\tcache files ldap/;s/^group:.*$/group:\t\tcache files ldap/;s/^hosts:.*files/hosts:\t\tcache files/' /etc/nsswitch.conf ExecStart=/usr/bin/systemctl restart nscd diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh index eacb8837..bf642ed0 100755 --- a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh @@ -407,7 +407,7 @@ fi # via virtual floppy cp "$xmlfile" "/etc/openslx/vmchooser/fd-loop/config.xml" # Add another file with resolution information -xrandr | grep -o -E 'current\s*[0-9]+\s*x\s*[0-9]+' | cut -c 8- | sed -r 's/(\s|\t|\n)//g' | head -1 > "/etc/openslx/vmchooser/fd-loop/hostres.txt" +xrandr | grep -o -E 'current\s*[0-9]+\s*x\s*[0-9]+' | cut -c 8- | sed -r 's/(\s|\t|\n)//g' | head -n 1 > "/etc/openslx/vmchooser/fd-loop/hostres.txt" # Get all virtual machine specific stuff from the respective include file if [ -e /etc/openslx/${xmlvirt}/run-virt.include ] ; then -- cgit v1.2.3-55-g7522