X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave.korn@artimi.com>
To: <cygwin@cygwin.com>
References:  <loom.20080904T183156-413@post.gmane.org> <48C0316C.F9E434A9@dessent.net> <00fc01c90f39$f4006970$9601a8c0@CAM.ARTIMI.COM>  <loom.20080910T172329-77@post.gmane.org> <007101c9136b$a62b3e10$9601a8c0@CAM.ARTIMI.COM>  <loom.20080910T174541-80@post.gmane.org>
Subject: RE: setup.exe --quiet-mode
Date: Wed, 10 Sep 2008 19:21:57 +0100
Message-ID: <007c01c91372$1c48c3a0$9601a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To:  <loom.20080910T174541-80@post.gmane.org>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Rob wrote on 10 September 2008 19:03:

> I think the safest bet for me in this case is to just kill off everything
> and run setup. 

  It's really for the best.  Upgrading Cygwin while *anything* is still
running is basically something we don't support, and the replace-on-reboot
option is really just a crude catchall for those inevitable times when people
do forget to shut everything down (it's usually services) in a
try-and-keep-it-limping-along-until-it-can-be-fixed sort of way; but as you've
seen, there are big (postinstall-script-sized) loopholes in it.

> 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.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/

