delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/02/17:50:18

Message-Id: <200503022250.j22MoGN5023127@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: "Alec Klauk" <alec AT pennmedia DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Keeping cygwin updated on remote systems
Date: Wed, 2 Mar 2005 16:48:58 -0600
MIME-Version: 1.0
In-Reply-To: <422642FF.166358A9@dessent.net>
X-Qmail-Scanner-Message-ID: <110980384968097140 AT mail DOT pennmedia DOT com>

Is there an actual email I can send my questions reguarding cygwin services?


Alec

-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of
Brian Dessent
Sent: Wednesday, March 02, 2005 4:50 PM
To: cygwin AT cygwin DOT com
Subject: Re: Keeping cygwin updated on remote systems

"DePriest, Jason R." wrote:

> How can I handle in-use files if I am not using setup.exe?
> 
> I would love to hear any suggestions that anyone has.

You'll have to cobble something together and use a non-Cygwin method to do
the file replacement.  For example, if you're using rsync over ssh then you
will be unable to replace ssh.exe, rsync.exe, cygwin1.dll, and probably a
handful of other DLLs -- check "cygcheck /bin/ssh" and "cygcheck
/bin/rsync".

One way might be to write in use files as "whatever.exe.new" and add the
list of replacements to a text file.  You might be able to do this by piping
the output of your rsync command into a script that looks for write errors
and copies those over the files with ".new" appended.

Then write a windows command script (.cmd) that stops all cygwin services
and processes, reads that list and uses windows move to replace them, and
then restarts whatever needs to be restarted.  Schedule this .cmd file to
run every N minutes from Windows' task scheduler and have it check for the
replacements text file.  Or you could use the "at"
command through ssh to schedule this .cmd task to happen in N minutes if you
detect that inuse files needed to be replaced.

You could also use the method that setup.exe uses which is Windows' own "in
file use replacement", but this requires a reboot which you may not want to
mess with.  If you do want to try this you can look for the inuse.exe tool
which comes with the Resource Kit.  I think that this amounts to writing the
src/dest list of filenames in \0-delimited format to
HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\PendingFileRenameOperations.  But you have to use Native paths here
because win32 subsystem has not yet started.  So c:\foo\bar becomes
\??\c:\foo\bar.  I think you prepend this with '!' to indicate that the file
is to be deleted first, I'm not sure.

Finally, you could also try using a win32-native sshd and scp or rsync
client.  You could have this installed listening on a nonstandard port, as a
service that you start before an upgrade and then stop when finished, so as
not to have extra stuff running normally.  But, you would have to make sure
that permissions and ownership are handled correctly, because native windows
tools may not understand them.  If so you could also use a native program
like cacls or xcacls over native-ssh to make sure that the ACLs are set
correctly.

Brian

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



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