public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Exitcode is 0 when killing a cygwin initiated process via taskmanager
@ 2014-12-23  2:34 -
  2014-12-23  7:41 ` Marco Atzeri
  0 siblings, 1 reply; 9+ messages in thread
From: - @ 2014-12-23  2:34 UTC (permalink / raw)
  To: cygwin, anrdaemon

Hi,

>> Any idea how to solve (get the "canceled" exit code? Remember: The
>> script continues like a normal finish of the command)

> What do you mean by "canceled" exit code, pretty please?

oh, any exitcode <> 0 would be nice. Sending sigkill on debian gives a 137.

The point is, I rely on having a successfully executed command, if
exitcode is 0. In this case command is terminated, left garbage and
did not do its job and I go on like everything would be fine. How
should error checking care about such a condition / state?

Any ideas? And by the way, is such a condition in pure GNU/Linux
producible? Sigkill is quite brute force exit isn't it?

Thanks

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Exitcode is 0 when killing a cygwin initiated process via taskmanager
@ 2014-12-23 11:09 -
  2014-12-23 11:37 ` Marco Atzeri
  2014-12-23 13:00 ` -
  0 siblings, 2 replies; 9+ messages in thread
From: - @ 2014-12-23 11:09 UTC (permalink / raw)
  To: marco, cygwin, Anr Daemon

>> Using Taskmanager is brute force as cygwin dll can not act and correctly manage the exitcode


Hi,

thanks, but I do not agree. One element of the script was killed, not
the hoöe script. It should be more robust. What I do now is: Read
stdout of the program (rsync) and only if I got the right footer of
rsync I rely on exitcode 0.

That is insane.

Is it possible to kill the process of a script element in GNU and
having a returncode of 0 and a continuing script? If yes we can't use
returncodes at all anymore in shell scripts?

Thanks lopiuh

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Exitcode is 0 when killing a cygwin initiated process via taskmanager
@ 2014-12-23  0:38 -
  2014-12-23  1:50 ` Andrey Repin
  0 siblings, 1 reply; 9+ messages in thread
From: - @ 2014-12-23  0:38 UTC (permalink / raw)
  To: cygwin

Hi all,

I have a script running banana after killing a process (rsync, but
that is unimportant) through Taskmanager (End process in process tab).

It is, that the killed process exits  immediately with exitcode 0 (!)
and the bash script itself continues, which can lead to havoc because
not knowing something was canceled (continuing to mive directories
etc).

Win7, CYGWIN_NT-6.1-WOW64 Gizmo-PC 1.7.33-2(0.280/5/3) 2014-11-13
15:45 i686 Cygwin

simple to reproduce:
START script.sh
#!/usr/bin/bash
less some_file
echo "result: $?" >| erg_file

erg_file contains: result: 0 after killing less through process taskmanager

Any idea how to solve (get the "canceled" exit code? Remember: The
script continues like a normal finish of the command)

Thanks

lopiuh

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2014-12-24  1:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-23  2:34 Exitcode is 0 when killing a cygwin initiated process via taskmanager -
2014-12-23  7:41 ` Marco Atzeri
  -- strict thread matches above, loose matches on Subject: below --
2014-12-23 11:09 -
2014-12-23 11:37 ` Marco Atzeri
2014-12-23 13:00 ` -
2014-12-23 19:47   ` cyg Simple
2014-12-24  1:56   ` -
2014-12-23  0:38 -
2014-12-23  1:50 ` Andrey Repin

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