delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/02/16:01:54

X-Spam-Check-By: sourceware.org
Date: Fri, 2 Dec 2005 16:01:44 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Peter <pli9+PUB AT borkborkbork DOT itsa DOT ucsf DOT edu>
cc: cygwin AT cygwin DOT com
Subject: Re: screen-4.0.2 on Cygwin 1.5.R18-1
In-Reply-To: <Pine.LNX.4.64.0512021522430.31904@upf.uneineq.rqh>
Message-ID: <Pine.GSO.4.63.0512021556020.8881@slinky.cs.nyu.edu>
References: <1133503614 DOT 349 DOT ezmlm AT cygwin DOT com> <Pine DOT LNX DOT 4 DOT 64 DOT 0512020110450 DOT 27976 AT upf DOT uneineq DOT rqh> <Pine DOT GSO DOT 4 DOT 63 DOT 0512021017170 DOT 27528 AT slinky DOT cs DOT nyu DOT edu> <Pine DOT LNX DOT 4 DOT 64 DOT 0512021522430 DOT 31904 AT upf DOT uneineq DOT rqh>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, 2 Dec 2005, Peter wrote:

> Thanks for your quick reply.  It gives me a bit more to think about; I
> don't really know my way around cygwin/*nux that well, from the
> administrative end; I've just been an end user for a long time.
>
> > How exactly do you invoke screen?  Does "setsid" work for you?  Does
> > "nohup"?  IIRC, bash also has an option for controlling whether
> > background processes are terminated on exit...
>
> How will I know whether setsid is working?  I tried setting the setuid
> bits via chmod, but I don't know what I'm doing other than that.  I'll
> try nohup and look through the shell documentation for options.  I'm
> either invoking screen from the command line as my user, or as SYSTEM
> (by scheduling a cmd window with the NT "at" command).  This works okay,
> but the process does not persist.

"setsid" is a program like "nohup" that dissociates a process from the
console.  It has nothing to do with the setuid bit.

> I've tried running it as a service like so:
> 	cygrunsrv -I screen -p /usr/local/bin/screen -a '-d -m'
> 	cygrunsrv -S screen
>
> I get the hanging, plus it runs as SYSTEM unless I add the options to
> run it as myself.  Now that I think of it, perhaps I need to add -i for
> interactive; I'll try that.

You might also run something that'll switch user context before running
screen (e.g., su).

> > What is the error message when screen runs as SYSTEM?  I suspect it's
> > a fifo permission issue...
>
> I haven't figured out how to get the error messages out of cygrunsrv
> processes, but I should be able to figure that out and get back to you.

By default cygrunsrv logs program output to /var/log/PROGRAM.log and to
the Windows Event Log.  Check in both places.

> I know that it runs okay up to a point as SYSTEM because it creates a
> new S-SYSTEM directory in /tmp/uscreens and creates fifos there (which I
> can investigate post hoc by taking control of the directory).

Does "chmod 666 /tmp/uscreens/S-SYSTEM/*" help?

> > As for hanging does it consume CPU at all?  Try attaching to the
> > process with strace and seeing where it hangs.
>
> Will do.
>
> > If you wish for others to try reproducing your behavior, please post
> > the "minor changes" you mentioned above (as a patch).
>
> Here you go.  Like I said: very minor changes.  More intelligent changes
> are almost certainly possible, but I don't really have time to read
> through the source code and figure things out much more.  Have other
> people done more meticulous patching?  Most patches I googled are now
> 404.

Thanks, I'll try to build with this patch later.

Hope you get screen working correctly.  Once you're able to do that,
please consider contributing screen as a Cygwin package.  See the
"Contributing" section of the Cygwin web page for details.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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

- Raw text -


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