delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/08/22/04:20:13

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Wed, 22 Aug 2001 12:18:06 +0400
From: egor duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.53 RC/4)
Reply-To: egor duda <deo AT logos-m DOT ru>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <16746690287.20010822121806@logos-m.ru>
To: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
CC: cygdev <cygwin-developers AT cygwin DOT com>
Subject: Re: rxvt pops up console with 2001-Aug-07 shapshot
In-Reply-To: <s1szo8swmlu.fsf@jaist.ac.jp>
References: <20010814140130 DOT A26049 AT redhat DOT com>
<20010815125949 DOT A768 AT dothill DOT com> <20010816010713 DOT A26439 AT redhat DOT com>
<20010821222132 DOT A27443 AT redhat DOT com> <s1s1ym4y57g DOT fsf AT jaist DOT ac DOT jp>
<20010822091749 DOT I17561 AT cygbert DOT vinschen DOT de> <s1szo8swmlu DOT fsf AT jaist DOT ac DOT jp>
MIME-Version: 1.0

Hi!

Wednesday, 22 August, 2001 Kazuhiro Fujieda fujieda AT jaist DOT ac DOT jp wrote:

>>>> On Wed, 22 Aug 2001 09:17:49 +0200
>>>> Corinna Vinschen <vinschen AT redhat DOT com> said:

>> Kazuhiro, did you find your original problem only with inetd
>> and cygrunsrv or even when the process has been started by
>> SRVANY???

KF> My original problem is that sshd and inetd can't work without
KF> the console window when I execute it not as a service but as an
KF> normal application.

KF> For example, if you execute sshd via the startup shortcut, the
KF> console window pops up and remains until it is terminated by
KF> SIGTERM. If you execute it on a shell prompt and terminate the
KF> shell, the console window of the shell also remains.

i use this simple program in such cases.

#include <windows.h>

#define TITLESIZE 1024

int
main (int argc, char** argv)
{
  HWND console;
  char old_title [TITLESIZE];
  char new_title [TITLESIZE];
  if (!GetConsoleTitle (old_title, TITLESIZE))
    return 1;
  sprintf (new_title, "cygwin.hide.%d", GetCurrentProcessId ());
  SetConsoleTitle (new_title);
  Sleep (40);
  console = FindWindow (NULL, new_title);
  SetConsoleTitle (old_title);
  ShowWindow (console, SW_HIDE);
}

maybe we can add something like this to cygwin api? besides, cygwin
already has console handle, so title stuff won't be necessary.

>> Perhaps we should add a switch to cygrunsrv whether it should call
>> AllocConsole() or not?!?

KF> I think inetd and cygrunsrv shouldn't invoke AllocConsole() and
KF> the problem with windows popping up should be solved by Egor's
KF> ttyfier.

ttyfier is designed to run interactive applications. if you want to
run, say, 'net start some_service', which creates new console in case
it's not available, it's fine. but if you'll run it with redirected
output, e.g 'tfy net start some_service >> service.log', you won't see
in service.log what you should normally expect.

Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019