Install on Shutdown: Pakete, die ein Reboot benötigen

Antworten
j.kroepke
Beiträge: 18
Registriert: 06 Jun 2013, 16:26

Install on Shutdown: Pakete, die ein Reboot benötigen

Beitrag von j.kroepke »

Hallo,

ich habe eine Frage zum Modul "Installation on Shutdown".

Wenn ein Paket beim Herunterfahren installiert wird und ein Neustart erfordert, wird dieses Paket beim dem nächsten Starten weiter ausgeführt. So steht es ja auch im OPSI Handbuch.

Als Workaround würde ich im WINST ein OPSI RPC Call ausführen, der den Rechner nach 30 Sekunden via Wake On LAN aufwecken würde, sowie das Produkt shutdownwanted für den Client aktiviert.
So könnten die Produkte auch nach Feierabend vollständig installiert werden.

Meine Frage wäre, ob die technisch möglich wäre und ob gegen diese Vorgangsmethode etwas dagegen spricht und ob ich auf diesem Wege auf Probleme mit unbekannte Probleme stoßen könnte.

Viele Grüße,
Jan
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Install on Shutdown: Pakete, die ein Reboot benötigen

Beitrag von SisterOfMercy »

First try out if your clients work with WOL.
In my experience about 2/3 of the clients will not turn on. The reasons can be due to incorrect bios settings (WOL not activated), power management settings, and even windows driver settings (can't figure out WHY).
Then if you have a few clients with a marvell lan chip onboard that don't really work, you're kind of screwed again.

One day I'm going to make a hardware WOL switch that does not depend on computer settings :!:

How the rest of your workaround would work - I wouldn't know about that.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
hawaii
Beiträge: 77
Registriert: 03 Dez 2013, 13:32

Re: Install on Shutdown: Pakete, die ein Reboot benötigen

Beitrag von hawaii »

Hey SistersOfMercy,

I had the WOL issues as well and was able to figure out some stuff. We use Lenovo clients and a lot Intel networkchipsets need to have intel proset installed to have WOL work properly.
Once Intel proset is installed you got more properties on the network device (configuration) available. Now you need to activate a setting to enable shutdown from S5 state -> graceful shutdown.
This setting can be applied by a registry key.

To have all this automated I created a intelproset package where it will check for a driver description on the registry and set the necessary registry key to enable WOL from S5.

The information I gathered for this solution came from several sites and people where using different vendors like dell, lenovo, hp so it seems the solution is quite generic for at least Intel networkchipsets.

Here are some links that got me started:
http://www.elvtechnology.com.au/2012/02 ... ntel-nics/
http://www.intel.com/support/network/sb/cs-016040.htm

Code: Alles auswählen

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/

[Actions]
requiredWinstVersion >= "4.11.2.6"

DefVar $MsiId32$
DefVar $UninstallProgram32$
DefVar $MsiId64$
DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $checkDriver$
DefVar $needInstall$

Set $needInstall$ = "false"

Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")


Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "intelproset"
Set $MinimumSpace$    = "50 MB"
; the path were we find the product after the installation
Set $InstallDir64$      = "%ProgramFiles64Dir%\Intel"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
	
	if FileExists("%ScriptPath%\delsub3264.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub3264.ins"
	endif
	
	if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
	endif
	
	comment "installing"

	Set $checkDriver$ = GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007] DriverDesc")
	if ($checkDriver$ = "Intel(R) Ethernet Connection I217-LM") or ($checkDriver$ = "Intel(R) 82578DM Gigabit Network Connection")
		Set $needInstall$ = "true"
	endif

	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
		if ($needInstall$ = "true")
			Message "Installing " + $ProductId$ + " 64 Bit..."
			comment "Start setup program"
			Files_install
			DosInAnIcon_Install
			sub "%ScriptPath%\check_msi-exitcode.ins"
			comment "Patch Registry"
			Registry_install /64Bit
			Files_uninstall
		else
			comment "Installation and registry tweaks not necessary....WOL will gonna be ok. (we hope)..."
		endif
	endif
	
	comment "Reboot Windows to make sure changes take affect..."
	ExitWindows /RebootWanted
endif

[Files_install]
copy -s "%ScriptPath%\proset\" "%Systemdrive%\temp\proset\"

[DosInAnIcon_Install]
cd "%Systemdrive%\temp\proset"
DxSetup.exe /qn BD=0

[Registry_install]
openkey [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007]
set "EnablePME" = "1"

[Files_uninstall]
copy %ScriptPath%\test.txt $InstallDir64$
del -sf "%Systemdrive%\temp\proset\"

[Sub_get_licensekey]
comment "License management is enabled and will be used"

comment "Trying to get a license key"
Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
; If there is an assignment of exactly one licensepool to the product the following call is possible:
; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use:
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)

DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$

if $ServiceErrorClass$ = "None"
	comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
else
	if $ServiceErrorClass$ = "LicenseConfigurationError"
		LogError "Fatal: license configuration must be corrected"
		LogError getLastServiceErrorMessage
		isFatalError
	else 
		if $ServiceErrorClass$ = "LicenseMissingError"
			LogError "Fatal: required license is not supplied"
			isFatalError
		endif
	endif
endif
Antworten