Verbesserung des on_shutdown\doinstall##.cmd Skripts

Antworten
luca
Beiträge: 15
Registriert: 24 Aug 2015, 16:07

Verbesserung des on_shutdown\doinstall##.cmd Skripts

Beitrag von luca »

Hallo zusammen,

mir ist aufgefallen, dass ich keine Fehlermeldungen ins lokale Log beim shutdown bekomme. Ich habe mir also mal das opsiclientd Skript unter %programfiles(x86)%\opsi.org\opsi-client-agent\on_shutdown\doinstall##.cmd angeschaut und bemerkt dass ihr den stderr nicht umleitet, was dazu führt dass die Fehlermeldungen angezeigt werden, aber nicht ins log umgeleitet werden.

Außerdem ist die zusätzliche Datei "enter.txt" überflüssig, da man dem "date" Befehl einfach ein "/T" übergeben kann. Hier mal meine Version des Skriptes. Könnt ihr gerne verwenden.

64bit:

Code: Alles auswählen

@echo off
rem *****************************************************************
rem opsiclientd_shutdown_starter.exe performs the following actions:
rem - read credentials from opsiclientd.conf
rem - connect to opsiclientd
rem - read backend info for modules file 
rem   (module on_shutdown is activated?)
rem - fire event on_shutdown (default=gui_startup) 
rem   to start product Installation on client
rem - wait for completion of installation (end of task)
rem *****************************************************************

set logFile=C:\opsi.org\tmp\doinstall.log

echo Start opsi product installation ...
echo doinstall64.cmd started > "%logFile%"
date /T  >> "%logFile%"
cd "%ProgramFiles(x86)%\opsi.org\opsi-client-agent" >> "%logFile%"
opsiclientd_shutdown_starter.exe on_shutdown 1>> "%logFile%" 2>&1
32bit:

Code: Alles auswählen

@echo off
rem *****************************************************************
rem opsiclientd_shutdown_starter.exe performs the following actions:
rem - read credentials from opsiclientd.conf
rem - connect to opsiclientd
rem - read backend info for modules file 
rem   (module on_shutdown is activated?)
rem - fire event on_shutdown (default=gui_startup) 
rem   to start product Installation on client
rem - wait for completion of installation (end of task)
rem *****************************************************************

set logFile=C:\opsi.org\tmp\doinstall.log

echo Start opsi product installation ...
echo doinstall64.cmd started > "%logFile%"
date /T  >> "%logFile%"
cd "%ProgramFiles%\opsi.org\opsi-client-agent" >> "%logFile%"
opsiclientd_shutdown_starter.exe on_shutdown 1>> "%logFile%" 2>&1
Grüße
Luca
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Verbesserung des on_shutdown\doinstall##.cmd Skripts

Beitrag von n.wenselowski »

Hallo Luca,

danke für den Hinweis.
Ich habe dafür ein internes Ticket aufgemacht.


Viele Grüße

Niko

Code: Alles auswählen

import OPSI
Antworten