Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Neo startup by boot time program - needs a window?
Neo startup by boot time program - needs a window?
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
tigerSnark
Blue Pill


Joined: Mar 29, 2006
Posts: 4

PostPosted: Wed Apr 12, 2006 11:12 am    Post subject: Neo startup by boot time program - needs a window?

We use open offfice as a converter from Microsoft Office documents to PDF on the Mac by having OO listen to a port (after starting it with the "-accept etc" string as documented.

This works fine if a user logs on and runs a shell script to start openoffice. However, we cannot get it to work within a startup item that starts at boot time. One issue seems to be running oo as root (which is what startup items run as). I have gotten around that by using a wrapper script that runs the oo script as a special user defined for the task. But, I then get the following error:

Apr 12 14:15:30 Hyacinthe soffice: kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only

Apr 12 14:15:38 Hyacinthe soffice: An unexpected Java error has been detected by HotSpot Virtual Machine:
Apr 12 14:15:38 Hyacinthe soffice: An error report file has been written to:
Apr 12 14:15:38 Hyacinthe soffice: /Users/neo/Library/Logs/Java/JavaNativeCrash_pid515.crash.log
Apr 12 14:15:38 Hyacinthe soffice: If this error is reproducible, please report it with the following information:
Apr 12 14:15:38 Hyacinthe soffice: 1. Provide the steps to reproduce, a test case, and any relevant information
Apr 12 14:15:38 Hyacinthe soffice: 2. The corresponding JavaNativeCrash_pid<num>.crash.log (Java state)
Apr 12 14:15:38 Hyacinthe soffice: 3. The corresponding <name>.crash.log (native state; generated by CrashReporter)
Apr 12 14:15:38 Hyacinthe soffice: File report at: http://bugreport.apple.com/
Apr 12 14:15:44 Hyacinthe crashdump[641]: soffice crashed
Apr 12 14:15:45 Hyacinthe crashdump[641]: crash report written to: /Users/neo/Library/Logs/CrashReporter/soffice.crash.log

this means, i think, that oo still needs to communicate with the windows system even though its invoked by:

soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -invisible -nologo -headless &

The problem stems from the fact that since our program starts up at boot time, it starts in a context that does not have access to the windows server.

So: 1. is there a way to run without a window context?
2. Can oo run as root on the mac?

Thanks in advance.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Apr 12, 2006 11:15 am    Post subject:

Moved to the OpenOffice.org X11 support forum as this is not a NeoOffice question.

Patrick
Back to top
jjmckenzie51
The Anomaly


Joined: Apr 01, 2005
Posts: 1055
Location: Southeastern Arizona

PostPosted: Wed Apr 12, 2006 11:34 am    Post subject: Re: Neo startup by boot time program - needs a window?

tigerSnark wrote:
We use open offfice as a converter from Microsoft Office documents to PDF on the Mac by having OO listen to a port (after starting it with the "-accept etc" string as documented.

This works fine if a user logs on and runs a shell script to start openoffice. However, we cannot get it to work within a startup item that starts at boot time. One issue seems to be running oo as root (which is what startup items run as). I have gotten around that by using a wrapper script that runs the oo script as a special user defined for the task. But, I then get the following error:

(error messages removed)

this means, i think, that oo still needs to communicate with the windows system even though its invoked by:

soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -invisible -nologo -headless &

The problem stems from the fact that since our program starts up at boot time, it starts in a context that does not have access to the windows server.

So: 1. is there a way to run without a window context?
2. Can oo run as root on the mac?


Simple answers: OpenOffice.org needs to 'talk' to an X11 server even if it is invoked using the -invisible parameter. If you do not startup a X11 server before invoking soffice, you will get errors.
I think, for safety reasons, OpenOffice.org cannot be started as root. However, I will have to confirm this when I get back to my Mac.

James
Back to top
tigerSnark
Blue Pill


Joined: Mar 29, 2006
Posts: 4

PostPosted: Wed Apr 12, 2006 12:38 pm    Post subject:

While the files are both named soffice, this was the soffice that is in NeoOffice: NeoOffice.app/Contents/MacOS/soffice.

Is that not the way to launch it to get the connectivity to the socket?

i.e.

#!/bin/sh

export PATH=/Applications/NeoOffice.app/Contents/MacOS:${PATH}

soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -invisible -nologo -headless &
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Apr 12, 2006 12:53 pm    Post subject:

Moving back to NeoOffice support as I was mistaken in moving it in the first place.

To answer your question, the problem is that you are trying to run a Mac app like it is an X11 app. Since NeoOffice is native, it uses the Mac window server APIs to do all drawing (and even if you are running OOo or Neo without a window, it still needs access to the Mac window server to do offscreen image drawing, font layout, etc.). In other words, both OOo and Neo are GUI apps and do not run headless. They may act as a server, but they still need a monitor.

Unlike X11, the Mac window server is very restrictive in which user can connect to it. Basically, only users with a logged in session can connect to the Mac window server. So, to do what you want to do, you are going to have to have your Mac be connected to a real or virtual monitor and log into a real user after booting. Then you should be able to run NeoOffice.

Patrick
Back to top
Guest
Guest





PostPosted: Wed Apr 12, 2006 4:57 pm    Post subject:

tiger wrote:
"We use open offfice as a converter from Microsoft Office documents to PDF on the Mac by having OO listen to a port (after starting it with the "-accept etc" string as documented. "


Uh, why go to all that trouble if Neo can read and write Word .docs?
Back to top
tigerSnark
Blue Pill


Joined: Mar 29, 2006
Posts: 4

PostPosted: Wed Apr 12, 2006 6:13 pm    Post subject:

pluby wrote:
Moving back to NeoOffice support as I was mistaken in moving it in the first place.

To answer your question, the problem is that you are trying to run a Mac app like it is an X11 app. Since NeoOffice is native, it uses the Mac window server APIs to do all drawing (and even if you are running OOo or Neo without a window, it still needs access to the Mac window server to do offscreen image drawing, font layout, etc.). In other words, both OOo and Neo are GUI apps and do not run headless. They may act as a server, but they still need a monitor.

Unlike X11, the Mac window server is very restrictive in which user can connect to it. Basically, only users with a logged in session can connect to the Mac window server. So, to do what you want to do, you are going to have to have your Mac be connected to a real or virtual monitor and log into a real user after booting. Then you should be able to run NeoOffice.

Patrick


Thanks for the explanation - at least it points me to a rationale for what I'm seeing and points to a solution path.
Back to top
guest
Guest





PostPosted: Wed Sep 27, 2006 9:35 am    Post subject:

Quote:
Quote:
Unlike X11, the Mac window server is very restrictive in which user can connect to it. Basically, only users with a logged in session can connect to the Mac window server. So, to do what you want to do, you are going to have to have your Mac be connected to a real or virtual monitor and log into a real user after booting. Then you should be able to run NeoOffice.


Thanks for the explanation - at least it points me to a rationale for what I'm seeing and points to a solution path.


Well, I do not understand why soffice doesn't run as a server...
Since this thread ended in April, I understand you found a solution? It's solved in NeoOffice 2.x?

Regards
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Sep 27, 2006 10:04 am    Post subject:

guest wrote:
Well, I do not understand why soffice doesn't run as a server...
Since this thread ended in April, I understand you found a solution? It's solved in NeoOffice 2.x?


NeoOffice and its underlying OpenOffice.org need a window server to operate as both are GUI applications. If you run as server, you still need to have a window server that the application can talk to. This will not change as we have no plans to make NeoOffice run in "headless" mode.

Patrick
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Wed Sep 27, 2006 10:07 am    Post subject:

No, there isn't actually any resolution to this. Neo is a client application only. It requires the ability to make a connection to WindowServer to run and isn't supported in "headless" mode. You must be logged into a Mac to use the software, and this will not be changed in Neo.

If you're trying to construct a server-based headless solution on a Mac, you'll need to run the X11 version. You can then redirect it to a different "virtual" X11 Server through solutions like VNC if it still requires a windowing system.

ed
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.