Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by Bill Nixon
Tue, 22 Dec 1992 01:17
How to open a connection without PublicWindowServer set?
Author: Bill Nixon
Date: Tue, 22 Dec 1992 01:17
Date: Tue, 22 Dec 1992 01:17
41 lines
1904 bytes
1904 bytes
I wrote a little application which allows me to pop up an alert panel on the Workspace from the command line, ala /usr/lib/NextPrinter/Inform. This works great as long as I am doing it from a Terminal Session I started. But, it does not work if I rlogin into the machine. I know about PublicWindowServer and DON'T want to turn it on for various reasons. I tried to su to root and do the same thing, but this doesn't even work. I mucked around and read in the loginwindow(8) man page that an application must be descended from either the Workspace or be a special system process such as the printer daemon. And yes, this seems to hold true. Now, how can I get around this? I want to write a one of the aforementioned special system processes that can write to the Workspace without Public Window Server being set but have no idea what the Workspace is looking for... Why do I want to do this? Well, I'd like to put up an panel on a machine when I am about reboot a machine remotely like this: rlogin machine su displaymsg "Message is going to reboot in 60 seconds" sleep 60 reboot Any pointers to help solve this problem would be greatly appreciated. Note that I am trying to do this under NeXTSTEP 3.0. Thanks! -- bnixon@fnma.com or ...!uunet!fnma.com!bnixon (NeXT Mail Okay) Bill Nixon, Senior Programmer Analyst, Advanced Technology, 2H-4S FannieMae, 3900 Wisconsin Ave NW, Washington, DC 22016 (202) 752-5468
Re: How to open a connection without PublicWindowServer set?
Author: Gary Ritchie
Date: Tue, 22 Dec 1992 22:08
Date: Tue, 22 Dec 1992 22:08
40 lines
2467 bytes
2467 bytes
> > Now, how can I get around this? I want to write a one of > the aforementioned special system processes that can write > to the Workspace without Public Window Server being set but > have no idea what the Workspace is looking for... > I have found one way to do this. It's not particularly elegant, but it works, and it allows each user to enable/disable the feature. I mention using Speaker/Listener because I know it works under these circumstances, but Distributed Objects would probably be the best way to go. First, write a Workspace daemon that has a known public Listener. To do this, you will need the publicCheckInAs: method documented in the latest NeXTanswers, otherwise you cannot create a public Listener without turning on Public Window Server. Workspace daemons are non NeXTSTEP programs with a .daemon extension that are launched by the WS at login time. You use the LaunchPaths default to get this to happen. The most elegant way is to have the daemon install the default the first time it is run. Anyway, the user logs in, and the daemon is run as a user process. Now, you write a command-line utility that looks for the known Listener port, and sends it a predetermined message (ie. displayMessage:(char *)msg. The daemon pops up a panel, and the job is done. The only problems I can think of are that (1) each user must install the daemon and (2) this won't display a panel on the login screen. Still, I think it would be a handy way to broadcast a message to logged-on users. Hmm. It's the last day before my XMas holiday, I'm bored, and I realize that my answer is a bit obscure. I'll see if I can get this working in the next couple of hours and post it on an archive site. No promises :-) --- Gary Ritchie gary@nshade.uah.ualberta.ca NightShade Software
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads