public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Searching how to replace dosfilewarning functionality
@ 2020-01-29 22:49 Denis Excoffier
  2020-01-30  5:09 ` ASSI
  2020-01-30  7:20 ` Andrey Repin
  0 siblings, 2 replies; 3+ messages in thread
From: Denis Excoffier @ 2020-01-29 22:49 UTC (permalink / raw)
  To: cygwin; +Cc: Denis Excoffier

Hello,

I see (https://cygwin.com/ml/cygwin-cvs/2020-q1/msg00042.html) that the Cygwin code that handles the dos_file_warning option will be removed soon.

I use this option. I don’t use it directly (for DOS paths) but as a signal to be sure that no Cygwin process remains present on my system. This is useful
in some cases (re-reading /etc/passwd, /etc/nsswitch.conf occurs only for the first process) but also mainly to make sure that if my PC uses memory or CPU at 100%,
Cygwin is not the culprit (since no Cygwin process remains loaded). I don’t use cygrunsrv or equivalent.

I do this:
1) I replace "bool dos_file_warning;"  with "bool dos_file_warning = true;", and recompile cygwin1.dll. This has to be done at a regular basis, at each new version or snapshot.
2) In my .cshrc i install "echo \\ /nonexistent*" (or something more clever, like "echo \\ /nonexistent* |& head --lines=-6").
3) When I login, if I see "Cygwin WARNING:", this means that apart from the current process, there is no other Cygwin process in my system. An important feature is that the "Cygwin WARNING" message never appears afterwards (in subsequent shells, like in xterm’s).
4) If I exit from a shell that has displayed "Cygwin WARNING:", I’m sure that no Cygwin process remains (I know that my .cshrc is clean about process creation etc.).

Is there any alternative to this almost-functionality if this code is removed?

Regards,

Denis Excoffier.





--
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] 3+ messages in thread

* Re: Searching how to replace dosfilewarning functionality
  2020-01-29 22:49 Searching how to replace dosfilewarning functionality Denis Excoffier
@ 2020-01-30  5:09 ` ASSI
  2020-01-30  7:20 ` Andrey Repin
  1 sibling, 0 replies; 3+ messages in thread
From: ASSI @ 2020-01-30  5:09 UTC (permalink / raw)
  To: cygwin

Denis Excoffier writes:
> Is there any alternative to this almost-functionality if this code is removed?

/usr/bin/kill -1


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

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

--
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] 3+ messages in thread

* Re: Searching how to replace dosfilewarning functionality
  2020-01-29 22:49 Searching how to replace dosfilewarning functionality Denis Excoffier
  2020-01-30  5:09 ` ASSI
@ 2020-01-30  7:20 ` Andrey Repin
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Repin @ 2020-01-30  7:20 UTC (permalink / raw)
  To: Denis Excoffier, cygwin

Greetings, Denis Excoffier!

> I do this:
> 1) I replace "bool dos_file_warning;"  with "bool dos_file_warning =
> true;", and recompile cygwin1.dll. This has to be done at a regular basis, at each new version or snapshot.
> 2) In my .cshrc i install "echo \\ /nonexistent*" (or something more
> clever, like "echo \\ /nonexistent* |& head --lines=-6").
> 3) When I login, if I see "Cygwin WARNING:", this means that apart from the
> current process, there is no other Cygwin process in my system. An important
> feature is that the "Cygwin WARNING" message never appears afterwards (in subsequent shells, like in xterm’s).
> 4) If I exit from a shell that has displayed "Cygwin WARNING:", I’m sure
> that no Cygwin process remains (I know that my .cshrc is clean about process creation etc.).

> Is there any alternative to this almost-functionality if this code is removed?

I fail to see why you want to do such mental gymnastics.

Just create a script like

  test $( ps -al | grep -vE "\<${TTY##/dev/}\>" |& wc -l ) -gt 1 && {
    echo There\'s likely other processes running from Cygwin environment.
    echo Please stop them or use --force to suppress this test.
    exit 1
  }

and run it whenever you suspect Cygwin tasks running in background.

[C:\arc\cygwin\install]$ install-cygwin.sh
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     1563       1    1563     187240  ?             18   Jan 29 /usr/bin/cygrunsrv
     1562       1    1562     187172  ?         197608   Jan 29 /usr/bin/ssh-pageant
     1564    1563    1564     190868  ?             18   Jan 29 /usr/sbin/cygserver
There's likely other processes running from Cygwin environment.
Please stop them or use --force to suppress this test.


-- 
With best regards,
Andrey Repin
Thursday, January 30, 2020 10:03:02

Sorry for my terrible english...
--
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] 3+ messages in thread

end of thread, other threads:[~2020-01-30  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 22:49 Searching how to replace dosfilewarning functionality Denis Excoffier
2020-01-30  5:09 ` ASSI
2020-01-30  7:20 ` 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).