public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Gerald Villemure" <GVillemure@ik.ca>
To: <cygwin@cygwin.com>
Subject: Re: Win98se and using SSHD as a TRUE service
Date: Fri, 09 Nov 2001 10:26:00 -0000	[thread overview]
Message-ID: <004901c1694c$61ea4aa0$0200000a@dyn.ik.ca> (raw)
In-Reply-To: <007101c16923$4bedc4d0$4aa18c09@wdg.uk.ibm.com>

I tried adding this code I grabbed from the VNC source:

  // Obtain a handle to the kernel library
  HINSTANCE kerneldll = LoadLibrary("KERNEL32.DLL");
  if (kerneldll == NULL)
     break;

  // And find the RegisterServiceProcess function
  DWORD (*RegisterService)(DWORD, DWORD);
  RegisterService = (DWORD (*)(DWORD, DWORD))
     GetProcAddress(kerneldll, "RegisterServiceProcess");
  if (RegisterService == NULL)
     break;

  // Register this process with the OS as a service!
  RegisterService(NULL, 1);

I put this in the file called daemon.c but I am unable to compile.

If I was to guess the problem lies in the fact that you can't mix and match
Win32 code with Unix code.

It looks like porting cygrunsrv to Win95 may be the only solution.

Le me know if there is any other avenue I can try.

Gerald
PS. Are there any open source "service control manager" packages out there?

----- Original Message -----
From: "Max Bowsher" <maxb@ukf.net>
To: "Gerald Villemure" <GVillemure@ik.ca>; <cygwin@cygwin.com>
Sent: Friday, November 09, 2001 2:34 PM
Subject: Re: Win98se and using SSHD as a TRUE service


> The elegant reusable solution would require the creation of a
cygrunsrv-like
> program for 9x/Me. Whilst none of the programming would be particularly
> challenging, the whole program would basically have to be rewritten,
because
> the 9x/Me service control manager is 100% different from the NT/2k SCM.
You
> are increasingly unlikely to find anyone who can be bothered to write the
> program, now that the 9x/Me product line is obsolete.
>
> A quick and dirty fix would be to add a call to RegisterServiceProcess[See
> Win32 API docs] in the initialization code of ssh, and recompile. That
would
> give you a version of ssh which would fix your problem (but wouldn't run
on
> NT/2k).
>
> Max Bowsher.
>
> ----- Original Message -----
> From: "Gerald Villemure" <GVillemure@ik.ca>
> To: <cygwin@cygwin.com>
> Sent: Friday, November 09, 2001 5:06 AM
> Subject: Win98se and using SSHD as a TRUE service
>
>
> > I would like to say that if I knew how to code I would be the first to
> > volunteer to develope a fix.  At this point I can mostly offer my time
as
> a
> > tester more then anything else.
> >
> > The issue is this:
> >
> > I put the following entry into the registry:
> >
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
> > "C:\\CYGWIN\\BIN\\BASH.EXE --login -c /usr/sbin/sshd"
> >
> > This starts SSHD as a service when the system boots but the problem is
> that
> > SSHD dosen't register itself as a true service. I can say this because I
> use
> > a tool to see the processes currently running on the box called WinTOP
> which
> > you can find here:
> >
> >
> http://www.microsoft.com/windows95/downloads/contents/wutoys/w95kerneltoy/
> > default.asp
> >
> > According to WinTOP my "VNC" process is a "system process" but my "SSHD"
> is
> > a normal user level process.
> >
> > I would not care either way but for the fact that if I login via SSHD
then
> > the next time the user logs out SSHD will DIE!
> >
> > Everythign else with regards to SSHD work VERY well.
> >
> > Last tested with:
> > Win98se
> > Cygwin 1.3.4-4
> > OpenSSH 3.0p1-1
> >
> > Thanks for any help,
> >
> > Gerald
> > --------------------------------------------------------------------
> > I n t e r K n o w l e d g e
> > Gerald Villemure
> > I am a DO-er, not a TRY-er.                  email: GVillemure@ik.ca




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  reply	other threads:[~2001-11-09 10:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-08 21:04 Gerald Villemure
2001-11-09  5:34 ` Max Bowsher
2001-11-09 10:26   ` Gerald Villemure [this message]
2001-11-11  8:26 JAmes Coleman
2001-11-11  8:26 ` Gerald Villemure
2001-11-11  8:26   ` JAmes Coleman
2001-11-11  8:26     ` Gerald Villemure
2001-11-11  8:26   ` Corinna Vinschen
2001-11-11  8:26 GregHolmes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004901c1694c$61ea4aa0$0200000a@dyn.ik.ca' \
    --to=gvillemure@ik.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).