public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* do package updates automatically kill running exes?
@ 2015-08-13  6:19 Andrew Schulman
  2015-08-13 10:09 ` Jon TURNEY
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Schulman @ 2015-08-13  6:19 UTC (permalink / raw)
  To: cygwin-apps

I've noticed that when I update a package, the exe's in it get killed.  For
example, when emacs gets updated, my running emacsen die.

Is this something that setup explicitly does, for all packages?  Or that some
packages do for themselves in a preremove script?  Or just a byproduct of
replacing a running exe?

Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13  6:19 do package updates automatically kill running exes? Andrew Schulman
@ 2015-08-13 10:09 ` Jon TURNEY
  2015-08-13 11:54   ` Andrew Schulman
  0 siblings, 1 reply; 12+ messages in thread
From: Jon TURNEY @ 2015-08-13 10:09 UTC (permalink / raw)
  To: Andrew Schulman, cygwin-apps

On 13/08/2015 07:19, Andrew Schulman wrote:
> I've noticed that when I update a package, the exe's in it get killed.  For
> example, when emacs gets updated, my running emacsen die.
>
> Is this something that setup explicitly does, for all packages?  Or that some
> packages do for themselves in a preremove script?  Or just a byproduct of
> replacing a running exe?

Since [1], if a dll or exe can't be updated because it is loaded into a 
process, setup can terminate the process.

But this isn't something it should be doing *silently*, there being both 
a dialog to request permission to kill the process, and logging of the 
process being killed, so I'm not sure how you can be unclear on this?

[1] 
https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;a=commit;h=ec366f61ad90cab92bc685900281e1cfe4cc7cb1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 10:09 ` Jon TURNEY
@ 2015-08-13 11:54   ` Andrew Schulman
  2015-08-13 18:00     ` Achim Gratz
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Schulman @ 2015-08-13 11:54 UTC (permalink / raw)
  To: cygwin-apps

> On 13/08/2015 07:19, Andrew Schulman wrote:
> > I've noticed that when I update a package, the exe's in it get killed.  For
> > example, when emacs gets updated, my running emacsen die.
> >
> > Is this something that setup explicitly does, for all packages?  Or that some
> > packages do for themselves in a preremove script?  Or just a byproduct of
> > replacing a running exe?
> 
> Since [1], if a dll or exe can't be updated because it is loaded into a 
> process, setup can terminate the process.
> 
> But this isn't something it should be doing *silently*, there being both 
> a dialog to request permission to kill the process, and logging of the 
> process being killed, so I'm not sure how you can be unclear on this?
> 
> [1] 
> https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;a=commit;h=ec366f61ad90cab92bc685900281e1cfe4cc7cb1

OK. Right, I have seen and used that dialog.  But more often, I just notice that
after an update, processes have exited.  This happened to me recently with
mintty, for example, but there have been others.

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.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 11:54   ` Andrew Schulman
@ 2015-08-13 18:00     ` Achim Gratz
  2015-08-13 19:02       ` Andrew Schulman
  0 siblings, 1 reply; 12+ messages in thread
From: Achim Gratz @ 2015-08-13 18:00 UTC (permalink / raw)
  To: cygwin-apps

Andrew Schulman writes:
> OK. Right, I have seen and used that dialog.  But more often, I just notice that
> after an update, processes have exited.  This happened to me recently with
> mintty, for example, but there have been others.

If you do an automated install, you will not be prompted.

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


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 18:00     ` Achim Gratz
@ 2015-08-13 19:02       ` Andrew Schulman
  2015-08-13 19:19         ` Jon TURNEY
  2015-08-13 19:39         ` Achim Gratz
  0 siblings, 2 replies; 12+ messages in thread
From: Andrew Schulman @ 2015-08-13 19:02 UTC (permalink / raw)
  To: cygwin-apps

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 19:02       ` Andrew Schulman
@ 2015-08-13 19:19         ` Jon TURNEY
  2015-08-14 11:36           ` Andrew Schulman
  2015-08-13 19:39         ` Achim Gratz
  1 sibling, 1 reply; 12+ messages in thread
From: Jon TURNEY @ 2015-08-13 19:19 UTC (permalink / raw)
  To: Andrew Schulman, cygwin-apps

On 13/08/2015 20:02, Andrew Schulman wrote:
>>> 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.

What problem are you trying to solve here?

IMHO you should not kill a process without user confirmation, and there 
is (currently) no way your preremove script to do that.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 19:02       ` Andrew Schulman
  2015-08-13 19:19         ` Jon TURNEY
@ 2015-08-13 19:39         ` Achim Gratz
  2015-08-13 21:07           ` cyg Simple
  1 sibling, 1 reply; 12+ messages in thread
From: Achim Gratz @ 2015-08-13 19:39 UTC (permalink / raw)
  To: cygwin-apps

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.

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.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 19:39         ` Achim Gratz
@ 2015-08-13 21:07           ` cyg Simple
  0 siblings, 0 replies; 12+ messages in thread
From: cyg Simple @ 2015-08-13 21:07 UTC (permalink / raw)
  To: cygwin-apps

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-13 19:19         ` Jon TURNEY
@ 2015-08-14 11:36           ` Andrew Schulman
  2015-08-14 14:13             ` Jon TURNEY
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Schulman @ 2015-08-14 11:36 UTC (permalink / raw)
  To: cygwin-apps

> On 13/08/2015 20:02, Andrew Schulman wrote:
> >>> 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.
> 
> What problem are you trying to solve here?

fish 2.2, when it comes out, will throw scary-looking errors and maybe
malfunction if any exes from fish 2.1.1 are still running.  In particular fish
2.1.1 runs fishd to share environment variables between instances.  fish 2.2
doesn't use fishd, and will throw errors if any instances of fishd are still
running.

So IMO the best option will be to killall fish in the preremove script for fish
2.1.1.  I think the cost of having to restart your shell is pretty low, and will
be better than having users puzzle through the error messages from fish 2.2.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-14 11:36           ` Andrew Schulman
@ 2015-08-14 14:13             ` Jon TURNEY
  2015-08-14 18:28               ` Achim Gratz
  0 siblings, 1 reply; 12+ messages in thread
From: Jon TURNEY @ 2015-08-14 14:13 UTC (permalink / raw)
  To: Andrew Schulman, cygwin-apps

On 14/08/2015 12:35, Andrew Schulman wrote:
>> On 13/08/2015 20:02, Andrew Schulman wrote:
>>>>> 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.
>>
>> What problem are you trying to solve here?
>
> fish 2.2, when it comes out, will throw scary-looking errors and maybe
> malfunction if any exes from fish 2.1.1 are still running.  In particular fish
> 2.1.1 runs fishd to share environment variables between instances.  fish 2.2
> doesn't use fishd, and will throw errors if any instances of fishd are still
> running.
>
> So IMO the best option will be to killall fish in the preremove script for fish
> 2.1.1.  I think the cost of having to restart your shell is pretty low, and will
> be better than having users puzzle through the error messages from fish 2.2.

I don't understand why you need to do anything over and above what setup 
already does.

Setup cannot replace /usr/bin/fish.exe while there is a running process 
with it loaded, and will request permission to kill those processes 
before trying to replace it (and if denied, schedule a replacement for 
the next reboot)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-14 14:13             ` Jon TURNEY
@ 2015-08-14 18:28               ` Achim Gratz
  2015-08-17 13:31                 ` cyg Simple
  0 siblings, 1 reply; 12+ messages in thread
From: Achim Gratz @ 2015-08-14 18:28 UTC (permalink / raw)
  To: cygwin-apps

Jon TURNEY writes:
> I don't understand why you need to do anything over and above what
> setup already does.

Read on.

> Setup cannot replace /usr/bin/fish.exe while there is a running
> process with it loaded, and will request permission to kill those
> processes before trying to replace it (and if denied, schedule a
> replacement for the next reboot)

His problem is that the process he wants to have killed has its
executable deleted, not replaced (/usr/bin/fishd.exe).  I haven't tested
it, but I would guess that setup would need to kill it anyway because it
could not be deleted while it was running.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: do package updates automatically kill running exes?
  2015-08-14 18:28               ` Achim Gratz
@ 2015-08-17 13:31                 ` cyg Simple
  0 siblings, 0 replies; 12+ messages in thread
From: cyg Simple @ 2015-08-17 13:31 UTC (permalink / raw)
  To: cygwin-apps

On 8/14/2015 2:28 PM, Achim Gratz wrote:
> Jon TURNEY writes:
>> I don't understand why you need to do anything over and above what
>> setup already does.
> 
> Read on.
> 
>> Setup cannot replace /usr/bin/fish.exe while there is a running
>> process with it loaded, and will request permission to kill those
>> processes before trying to replace it (and if denied, schedule a
>> replacement for the next reboot)
> 
> His problem is that the process he wants to have killed has its
> executable deleted, not replaced (/usr/bin/fishd.exe).  I haven't tested
> it, but I would guess that setup would need to kill it anyway because it
> could not be deleted while it was running.

The opened EXE file can be marked for deletion and then renamed allowing
the new file to be copied.  The side effect would be a shutdown at a
later time would delete the renamed file and the new process would start
with the changed file.

-- 
cyg Simple

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-17 13:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13  6:19 do package updates automatically kill running exes? Andrew Schulman
2015-08-13 10:09 ` Jon TURNEY
2015-08-13 11:54   ` Andrew Schulman
2015-08-13 18:00     ` Achim Gratz
2015-08-13 19:02       ` Andrew Schulman
2015-08-13 19:19         ` Jon TURNEY
2015-08-14 11:36           ` Andrew Schulman
2015-08-14 14:13             ` Jon TURNEY
2015-08-14 18:28               ` Achim Gratz
2015-08-17 13:31                 ` cyg Simple
2015-08-13 19:39         ` Achim Gratz
2015-08-13 21:07           ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).