This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: setup.exe --quiet-mode


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]