This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: do package updates automatically kill running exes?
- From: cyg Simple <cygsimple at gmail dot com>
- To: cygwin-apps at cygwin dot com
- Date: Thu, 13 Aug 2015 17:07:10 -0400
- Subject: Re: do package updates automatically kill running exes?
- Authentication-results: sourceware.org; auth=none
- References: <qscosattddeocejq80t47mllp22muvqt3p at 4ax dot com> <qscosattddeocejq80t47mllp22muvqt3p-e09XROE/p8c at public dot gmane dot org> <55CC6CE0 dot 9040908 at dronecode dot org dot uk> <0k0psats80nbi13clrq5tmv7pat7pfevlh at 4ax dot com> <0k0psats80nbi13clrq5tmv7pat7pfevlh-e09XROE/p8c at public dot gmane dot org> <871tf7vzl1 dot fsf at Rainer dot invalid> <1bqpsat4pv5lfnql0m1srui7pkvaspsd2t at 4ax dot com> <87wpwzuger dot fsf at Rainer dot invalid>
On 8/13/2015 3:39 PM, Achim Gratz wrote:
> Andrew Schulman writes:
>>>> Anyway, that answers my question. If I want to be sure a process from one of my
>>>> packages exits, I need to put a killall into its preremove script.
>>>
>>> I've put a "pkill ." in all scripts that run setup (with the requisite
>>> are you sure? y/N).
>>
>> Ugh, both psmisc (killall) and procps (pkill) aren't in base, so both of
>> those may fail.
>
> I'm not advocating to use these from pre-remove scripts. What is the
> problem you are trying to solve? While you can run setup with active
> Cygwin processes if you really know what you're doing, the long-standing
> instructiosn are that you shiould shut down all running Cygwin processes
> before running it.
This was exactly my thought.
>
> As for my own installers, I can assume pkill to be available as long as
> the Cygwin installation is still existing, since these are installed
> with all installation option.
>
The pre-remove script could determine if the file is open by a process
and rename it before copying the new version in place. The renamed file
would be marked for deletion when all handles to it are closed. Or do
it in the other order and if the file remains after deletion the rename it.
--
cyg Simple