delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/09/11/08:41:25

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: setup.exe --quiet-mode
Date: Thu, 11 Sep 2008 13:40:39 +0100
Message-ID: <5E25AF06EFB9EA4A87C19BC98F5C8753016D87EE@core-email.int.ascribe.com>
In-Reply-To: <007c01c91372$1c48c3a0$9601a8c0@CAM.ARTIMI.COM>
References: <loom DOT 20080904T183156-413 AT post DOT gmane DOT org> <48C0316C DOT F9E434A9 AT dessent DOT net> <00fc01c90f39$f4006970$9601a8c0 AT CAM DOT ARTIMI DOT COM> <loom DOT 20080910T172329-77 AT post DOT gmane DOT org> <007101c9136b$a62b3e10$9601a8c0 AT CAM DOT ARTIMI DOT COM> <loom DOT 20080910T174541-80 AT post DOT gmane DOT org> <007c01c91372$1c48c3a0$9601a8c0 AT CAM DOT ARTIMI DOT COM>
From: "Phil Betts" <Phil DOT Betts AT ascribe DOT com>
To: <cygwin AT cygwin DOT com>
Reply-To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m8BCfNu5015546

Dave Korn wrote on Wednesday, September 10, 2008 7:22 PM::

> Rob wrote on 10 September 2008 19:03:
> 
>> Since I'll be doing this upgrade on close to 100 boxes,
>> I've been trying to devise a *relatively* unattended process.
>> In case it helps anyone in the future, here's a snippet of my cmd
>> script I have so far: 
>> 
>> echo off
>> echo This will kill all cygwin related processes and update cygwin
>> echo Hit CTRL-C now to abort, otherwise:
>> pause
>> c:\cygwin\bin\bash.exe --login -c "ps -la|sed 's/^I/ /'|awk '{print
>> $4}'|grep - v WINPID >/tmp/pids.txt"
>> for /F %i in (c:\cygwin\tmp\pids.txt) DO taskkill /PID %i /F
>> del /F c:\cygwin\tmp\pids.txt
>> echo running setup...
>> \\fileserver\cygwin\setup-2.602.exe -q -L -l \\fileserver\cygwin -R
>> C:\cygwin echo Done
> 
>   That seems like a good start, but it's perhaps just a little bit
> crude in the way it handles services; if you kill them stone dead
> like that, the SCM will try and restart any that are set for
> auto-restart-on-fail.  It would probably be a minor improvement if
> you add an extra bit of bash to shut them down gracefully by invoking
> cygrunsrv on them, something a bit like ... 
> 
> c:\cygwin\bin\bash.exe --login -c "cygrunsrv -L | xargs -n 1
> cygrunsrv -E" 
> 
> ... and only then carry on to brute-force kill the leftovers.
> 

I don't know if this will work, but if you've around 100 boxes to
upgrade, it's probably worth investigating.

Instead of upgrading with the possibility of in use files, then 
rebooting to fix any problems, why not attack it the other way round?  
Install your script as a RunOnce task in the registry, then reboot.
The reboot will ensure there are no in use files, the script will 
invoke setup (I think) before any services or normal startup tasks, so
you should be confident that setup will complete successfully, and not 
require a second reboot.

Obviously, this will cause some unnecessary reboots, but this is
Windowsland where rebooting is a way of life; even Windows'
programmers never expected uptime to exceed 2^32 milliseconds.


Regarding the "setup not running postinstall scripts if there are any
in-use files" suggestion, could I suggest that this idea be modified
slightly?

Postponing all scripts could leave the system (prior to reboot) with 
a package which was successfully installed, but not postinstalled, and
therefore potentially unusable when it could have been completely
installed.  All that is necessary is to ensure that the packages'
dependencies are honoured when running their postinstall scripts.
This would ensure that as much as possible of the installation could
be completed prior to rebooting.

e.g. if package A depends on packages B and C, but a file from package 
B is in use, package C can be completely installed and postinstalled,
but package A can only be installed.  Running its postinstall script
must be delayed until after package B's postinstall script has run
following a reboot.


Phil
-- 
This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019