public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* some questions relating kde-cygwin and XWin
@ 2004-01-08 10:37 Ralf Habacker
  2004-01-08 15:55 ` Igor Pechtchanski
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Habacker @ 2004-01-08 10:37 UTC (permalink / raw)
  To: cygwin-xfree

Hi, 

1. for the next kde-cygwin 3.1.4 release I'm going to build a start script, 
which starts all required applications like ipc-daemon2, XWin and KDE basic 
apps and kills this processes after a logout, if they are started by the 
script. I like to build this script without any inferences especially to 
other XWin instances running on other displays, so I'm required to get the 
pid of the started XWin instance. 
I've search in the sources of the Xserver but, have not found any useable 
feature, so my question is, is there any way known to retrieve the pid of a 
started XWin instance or is there a possibility to shutdown the server by a 
xclient app ? 
If there is no such feature, what about adding a command line option to store 
the server pid in a file ? 

2. The Xserver could be shutdowned by the Tray X icon or by the X in the Xwin 
windows title. I've read that Xwin now supports specific menu entry (I 
remember only that this was implemented, not more) 

I'm looking for a way to run a script for an controlled kde shutdown after 
triggering a server shutdown but before the xserver shutdown is performed.

Unfortunally I haven't found and doc about this in the xfree docs neither I 
found any usefull thread with an overview of this feature for evaluating a 
possible implementation, so my question is if anone can give me a pointer to 
some docs. 

3. run.exe does not support space in path. I've search for any sources, but 
haven't  found anyone only the binary seems to available in startup-scripts 
package. So my question is, if this could be fixed ? 

BTW: There is a font size problem on http://xfree86.cygwin.com/devel/server in 
the Topic Souce Code: 

Ralf 



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

* Re: some questions relating kde-cygwin and XWin
  2004-01-08 10:37 some questions relating kde-cygwin and XWin Ralf Habacker
@ 2004-01-08 15:55 ` Igor Pechtchanski
  2004-01-10  0:23   ` Ralf Habacker
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Pechtchanski @ 2004-01-08 15:55 UTC (permalink / raw)
  To: cygwin-xfree

On Thu, 8 Jan 2004, Ralf Habacker wrote:

> Hi,
>
> 1. for the next kde-cygwin 3.1.4 release I'm going to build a start script,
> which starts all required applications like ipc-daemon2, XWin and KDE basic
> apps and kills this processes after a logout, if they are started by the
> script. I like to build this script without any inferences especially to
> other XWin instances running on other displays, so I'm required to get the
> pid of the started XWin instance.
> I've search in the sources of the Xserver but, have not found any useable
> feature, so my question is, is there any way known to retrieve the pid of a
> started XWin instance or is there a possibility to shutdown the server by a
> xclient app ?
> If there is no such feature, what about adding a command line option to store
> the server pid in a file ?

Well, since you can shut down a server via a key combination or an API
call, it might be a good idea to write a small X app (xshutdown?  xkill?)
that would send a shut down message to the server running on a given
display...  It should be very easy to write -- unless someone gets to it,
I'll see if I can cook up something in the next couple of weeks.

> 2. The Xserver could be shutdowned by the Tray X icon or by the X in the Xwin
> windows title. I've read that Xwin now supports specific menu entry (I
> remember only that this was implemented, not more)
>
> I'm looking for a way to run a script for an controlled kde shutdown after
> triggering a server shutdown but before the xserver shutdown is performed.
>
> Unfortunally I haven't found and doc about this in the xfree docs neither I
> found any usefull thread with an overview of this feature for evaluating a
> possible implementation, so my question is if anone can give me a pointer to
> some docs.

Wouldn't X either send a HUP signal or a shutdown event of some sort to
all X apps running on that display?  If not, could it?

> 3. run.exe does not support space in path. I've search for any sources, but
> haven't  found anyone only the binary seems to available in startup-scripts
> package. So my question is, if this could be fixed ?
>
> Ralf

<http://neuro.gatech.edu/users/cwilson/cygutils/run/>

FWIW, you should be able to use the 'setsid' command (in the 'setsid'
package) or a 'disown' bash builtin to achieve similar effect.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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

* Re: some questions relating kde-cygwin and XWin
  2004-01-08 15:55 ` Igor Pechtchanski
@ 2004-01-10  0:23   ` Ralf Habacker
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Habacker @ 2004-01-10  0:23 UTC (permalink / raw)
  To: cygwin-xfree

On Thursday 08 January 2004 16:55, Igor Pechtchanski wrote:
> On Thu, 8 Jan 2004, Ralf Habacker wrote:
> > Hi,
> >
> > 1. for the next kde-cygwin 3.1.4 release I'm going to build a start
> > script, which starts all required applications like ipc-daemon2, XWin and
> > KDE basic apps and kills this processes after a logout, if they are
> > started by the script. I like to build this script without any inferences
> > especially to other XWin instances running on other displays, so I'm
> > required to get the pid of the started XWin instance.
> > I've search in the sources of the Xserver but, have not found any useable
> > feature, so my question is, is there any way known to retrieve the pid of
> > a started XWin instance or is there a possibility to shutdown the server
> > by a xclient app ?
> > If there is no such feature, what about adding a command line option to
> > store the server pid in a file ?
>
> Well, since you can shut down a server via a key combination or an API
> call, it might be a good idea to write a small X app (xshutdown?  xkill?)
> that would send a shut down message to the server running on a given
> display...  It should be very easy to write -- unless someone gets to it,
> I'll see if I can cook up something in the next couple of weeks.
Unfortunally I'm probably not able to write such an app. 
BTW: xkill is already in the x sources available and used for killing 
xclients, so xshutdown would be a nice name. 

Anyway after search more I've got a solution, which may be interest for others 
The bash variable $! returns the pid of the last started process 

#!/bin/bash
<snip>

Xwin .. 
XWIN_PID=$!
.<start x clients >

kill $XWIN_PID 


This may be interesting for example in startxwin.bat for killing the X server 
at the end of a session. 
Another useful example may be /usr/X11R6/bin/startx in conjunction using 
ipc-daemon2. See the example from the kde-cygwin startx script 
<snip>
#
# start ipc-daemon2
# and save the pid for killing later
#
ipc-daemon2 &
IPC_PID=$!

#
# start xserver and kde
#
xinit .... 
#
# kill ipc-daemon2 if started above
# if ipc-daemon2 was started out of this script, IPC_PID contains the 
# pid of the above started ipc-daemon2 instance, which kill itself, so the
# following kill does have any affect like expected. 
#
kill $IPC_PID >/dev/null 2>&1

> > 2. The Xserver could be shutdowned by the Tray X icon or by the X in the
> > Xwin windows title. I've read that Xwin now supports specific menu entry
> > (I remember only that this was implemented, not more)
> >
> > I'm looking for a way to run a script for an controlled kde shutdown
> > after triggering a server shutdown but before the xserver shutdown is
> > performed.
> >
> > Unfortunally I haven't found and doc about this in the xfree docs neither
> > I found any usefull thread with an overview of this feature for
> > evaluating a possible implementation, so my question is if anone can give
> > me a pointer to some docs.
>
> Wouldn't X either send a HUP signal or a shutdown event of some sort to
> all X apps running on that display?  If not, could it?
Hmmh, I don't know if X does this and I think for kde this wouldn't be enough 
but it seems that I have to analyse more kde internals on how doing this. 

> > 3. run.exe does not support space in path. I've search for any sources,
> > but haven't  found anyone only the binary seems to available in
> > startup-scripts package. So my question is, if this could be fixed ?
> >
> > Ralf
>
> <http://neuro.gatech.edu/users/cwilson/cygutils/run/>

Thanks, have got the sources and fixed the problem. The problem was that bash 
surround pathes containing spaces with '"'. May I send the patch to this list 
or directly to Charles Wilson ? 


> FWIW, you should be able to use the 'setsid' command (in the 'setsid'
> package) or a 'disown' bash builtin to achieve similar effect.

This hint lead me to the bash documentation, where I found the $! trick. 
Thanks for this pointer. 

Ralf 


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

end of thread, other threads:[~2004-01-10  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08 10:37 some questions relating kde-cygwin and XWin Ralf Habacker
2004-01-08 15:55 ` Igor Pechtchanski
2004-01-10  0:23   ` Ralf Habacker

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