[OGo-MacOSX] Starting ogo-webui at boot time on OS X

Tabitha McNerney macosx@opengroupware.org
Mon, 5 Dec 2005 01:20:07 -1000


------=_Part_32179_4377761.1133781607814
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello all,

I just wrote a launchd property list and named it "ogo-webui.plist"  (for
those who are unfamiliar with launchd and launchctl, which is new to Mac OS
X beginning with Tiger, please refer to this excellent article <
http://www.afp548.com/article.php?story=3D20050620071558293 > ). I included
the property list in this email message (see below).

The motivation in doing so is to run ogo-webui when the Mac OS X server
machine boots up. The general recommendation from Apple's man pages for
launchd is to place user applications that the administrator should launch
on behalf of the user in /Library/LaunchAgents ... which I did.

I run OpenGroupware as a user named "ogo" so I logged into my server as ogo
and dumped out the environment variables with "$ env" and also looked at my
GNUstep.sh file to make sure that what is sourced into the environment ends
up being copied into the launchd plist as EnvironmentVariables. I also
direct standard out put and error to a log file (appends automatically with
launchd).

I had no problem running (and ogo-webui appeared to read the defaults just
fine because there were no complains about not finding anything), but when =
I
would try to hit ogo-webui via Apache, I'd get the error below about "ACCES=
S
DENIED" and it looks like apache's trying to speak to ogo-webuin on a
different port other than 20000 for some weird reason (not the case however
if I log in as user ogo and run ogo-webui manually from a shell).

Its a bit perplexing and I'm wondering what I may have missed? Anyone else
try this before? If not launchd, what options are there in Mac OS X / Tiger
for running ogo-webui automatically at startup up time? Would I have to
create a StartupItem or an rc script?

Best regards,

Tabitha
--------------------------------------------

ogo$ cat logfile
Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-webui-1.0| CTI Dialers:
2005-12-05 11:06:25.309 ogo-webui-1.0[872] WARNING: disabled login spaces
which are unsupported on this Foundation library.
Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-webui-1.0| root has no password,
you need to assign one!
Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-webui-1.0|
OpenGroupware.orginstance initialized.
Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-webui-1.0| WOHttpAdaptor listenin=
g
on address *:20000
Dec 05 11:07:17 ogo-webui-1.0 [872]: [ERROR] <0x02C0FC90[WOHttpAdaptor]>
ACCESS DENIED: <0x02C10880[NGInternetSocketAddress]: host=3Dlocalhost
port=3D49703>
--------------------------------------------

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version=3D"1.0">
<dict>
    <key>UserName</key>
        <string>ogo</string>
    <key>Label</key>
        <string>org.opengroupware.ogo-webui</string>
    <key>OnDemand</key>
        <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/OGoRoot/Tools/ogo-webui-1.0</string>
        <string>-WOPort</string>
        <string>20000</string>
        <string>-WOHttpAllowHost</string>
        <string>'("127.0.0.1", localhost)'</string>
    </array>
   <key>EnvironmentVariables</key>
   <dict>
     <key>GNUSTEP_LOCAL_ROOT</key>
       <string>/usr/local/OGoRoot</string>
     <key>GNUSTEP_HOST</key>
       <string>powerpc-apple-darwin8.2.0</string>
        <key>GUILE_LOAD_PATH</key>

<string>/Volumes/vol1/Users/ogo/GNUstep/Library/Libraries/Guile:/usr/local/=
OGoRoot/Library/Libraries/Guile</string>
        <key>GNUSTEP_NETWORK_ROOT</key>
            <string>/usr/local/OGoRoot</string>
        <key>GNUSTEP_MAKEFILES</key>
            <string>/usr/local/OGoRoot/Library/Makefiles</string>
        <key>GNUSTEP_ROOT</key>
            <string>/usr/local/OGoRoot</string>
        <key>OGoROOT</key>
            <string>/usr/local/OGoRoot</string>
        <key>GNUSTEP_FLATTENED</key>
            <string>yes</string>
        <key>GNUSTEP_HOST_OS</key>
            <string>darwin8.2.0</string>
        <key>GNUSTEP_HOST_VENDOR</key>
            <string>apple</string>
        <key>GNUSTEP_HOST_CPU</key>
            <string>powerpc</string>
        <key>GNUSTEP_USER_ROOT</key>
            <string>/Volumes/vol1/Users/ogo/GNUstep</string>
        <key>GNUSTEP_SYSTEM_ROOT</key>
            <string>/usr/local/OGoRoot</string>
        <key>LIBRARY_COMBO</key>
            <string>apple-apple-nil</string>
        <key>GNUSTEP_PATHLIST</key>

<string>/Volumes/vol1/Users/ogo/GNUstep:/usr/local/OGoRoot</string>
        <key>DYLD_FRAMEWORK_PATH</key>

<string>/Volumes/vol1/Users/ogo/GNUstep/Library/Frameworks:/usr/local/OGoRo=
ot/Library/Frameworks</string>
        <key>DYLD_LIBRARY_PATH</key>

<string>/Volumes/vol1/Users/ogo/GNUstep/Library/Libraries:/usr/local/OGoRoo=
t/Library/Libraries</string>
        <key>LANG</key>
            <string>en_US.UTF-8</string>
        <key>CLASSPATH</key>

<string>.:/usr/local/share/postgresql/java/postgresql.jar:/Volumes/vol1/Use=
rs/ogo/GNUstep/Library/Libraries/Java:/usr/local/OGoRoot/Library/Libraries/=
Java</string>
        <key>PATH</key>

<string>/Volumes/vol1/Users/ogo/GNUstep/Tools:/usr/local/OGoRoot/Tools:/bin=
:/sbin:/usr/bin:/usr/sbin:/usr/local/bin</string>
   </dict>

    <key>StandardOutPath</key>
        <string>/usr/local/OGoRoot/logs/logfile</string>
    <key>StandardErrorPath</key>
        <string>/usr/local/OGoRoot/logs/logfile</string>
    <key>ServiceDescription</key>
        <string>The OpenGroupware (OGo) main listener app</string>
</dict>
</plist>

------=_Part_32179_4377761.1133781607814
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello all,<br><br>I just wrote a launchd property list and named it &quot;o=
go-webui.plist&quot;&nbsp; (for those who are unfamiliar with launchd and l=
aunchctl, which is new to Mac OS X beginning with Tiger, please refer to th=
is excellent article &lt;&nbsp;=20
<a href=3D"http://www.afp548.com/article.php?story=3D20050620071558293">htt=
p://www.afp548.com/article.php?story=3D20050620071558293</a> &gt; ). I incl=
uded the property list in this email message (see below).<br><br>The motiva=
tion in doing so is to run ogo-webui when the Mac OS X server machine boots=
 up. The general recommendation from Apple's man pages for launchd is to pl=
ace user applications that the administrator should launch on behalf of the=
 user in /Library/LaunchAgents ... which I did.=20
<br><br>I run OpenGroupware as a user named &quot;ogo&quot; so I logged int=
o my server as ogo and dumped out the environment variables with &quot;$ en=
v&quot; and also looked at my GNUstep.sh file to make sure that what is sou=
rced into the environment ends up being copied into the launchd plist as En=
vironmentVariables. I also direct standard out put and error to a log file =
(appends automatically with launchd).=20
<br><br>I had no problem running (and ogo-webui appeared to read the defaul=
ts just fine because there were no complains about not finding anything), b=
ut when I would try to hit ogo-webui via Apache, I'd get the error below ab=
out &quot;ACCESS DENIED&quot; and it looks like apache's trying to speak to=
 ogo-webuin on a different port other than 20000 for some weird reason (not=
 the case however if I log in as user ogo and run ogo-webui manually from a=
 shell).
<br><br>Its a bit perplexing and I'm wondering what I may have missed? Anyo=
ne else try this before? If not launchd, what options are there in Mac OS X=
 / Tiger for running ogo-webui automatically at startup up time? Would I ha=
ve to create a StartupItem or an rc script?
<br><br>Best regards,<br><br>Tabitha<br>-----------------------------------=
---------<br><br>ogo$ cat logfile <br>Dec 05 11:06:25 ogo-webui-1.0 [872]: =
|ogo-webui-1.0| CTI Dialers: <br>2005-12-05 11:06:25.309 ogo-webui-1.0[872]=
 WARNING: disabled login spaces which are unsupported on this Foundation li=
brary.
<br>Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-webui-1.0| root has no passwo=
rd, you need to assign one!<br>Dec 05 11:06:25 ogo-webui-1.0 [872]: |ogo-we=
bui-1.0| OpenGroupware.org instance initialized.<br>Dec 05 11:06:25 ogo-web=
ui-1.0
 [872]: |ogo-webui-1.0| WOHttpAdaptor listening on address *:20000<br>Dec 0=
5 11:07:17 ogo-webui-1.0 [872]: [ERROR] &lt;0x02C0FC90[WOHttpAdaptor]&gt; A=
CCESS DENIED: &lt;0x02C10880[NGInternetSocketAddress]: host=3Dlocalhost por=
t=3D49703&gt;
<br>--------------------------------------------<br><br>&lt;?xml version=3D=
&quot;1.0&quot; encoding=3D&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE plist PUB=
LIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;<a href=3D"http:=
//www.apple.com/DTDs/PropertyList-1.0.dtd">
http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>&quot;&gt;<br>&lt;plist v=
ersion=3D&quot;1.0&quot;&gt;<br>&lt;dict&gt;<br>&nbsp;&nbsp;&nbsp; &lt;key&=
gt;UserName&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string=
&gt;ogo&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &lt;key&gt;Label&lt;/key&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;org.opengroupware.o=
go-webui&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &lt;key&gt;OnDemand&lt;/key&g=
t;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;false/&gt;<br>&nbsp;&nbsp;&=
nbsp; &lt;key&gt;ProgramArguments&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &lt;arr=
ay&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;/usr/local/OG=
oRoot/Tools/ogo-
webui-1.0&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;strin=
g&gt;-WOPort&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;st=
ring&gt;20000&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s=
tring&gt;-WOHttpAllowHost&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp; &lt;string&gt;'(&quot;<a href=3D"http://127.0.0.1">
127.0.0.1</a>&quot;, localhost)'&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/=
array&gt;<br>&nbsp;&nbsp; &lt;key&gt;EnvironmentVariables&lt;/key&gt;<br>&n=
bsp;&nbsp; &lt;dict&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_LOCA=
L_ROOT&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;/u=
sr/local/OGoRoot&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_HOST&lt;/key&gt;<br>&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;powerpc-apple-darwin8.2.0&lt;/s=
tring&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GUILE_LOAD_PA=
TH&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&lt;string&gt;/Volumes/vol1/Users/ogo/GNUstep/Library/Libraries/Guile:/usr/=
local/OGoRoot/Library/Libraries/Guile&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_NETWORK_ROOT&l=
t;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;=
string&gt;/usr/local/OGoRoot&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; &lt;key&gt;GNUSTEP_MAKEFILES&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;/usr/local/OGoRoot/Librar=
y/Makefiles&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_ROOT&lt;/key&g=
t;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&g=
t;/usr/local/OGoRoot&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
; &lt;key&gt;OGoROOT&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp; &lt;string&gt;/usr/local/OGoRoot&lt;/string&gt;<br>&nbsp;=
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_FLATTENED&lt;/key&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;=
yes&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUS=
TEP_HOST_OS&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbs=
p;&nbsp; &lt;string&gt;darwin8.2.0&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nb=
sp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_HOST_VENDOR&lt;/key&gt;<br>&nbsp;&nbsp;&=
nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;apple&lt;/string&=
gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_HOST_CPU&lt;/k=
ey&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;stri=
ng&gt;powerpc&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;k=
ey&gt;GNUSTEP_USER_ROOT&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
; &nbsp;&nbsp;&nbsp; &lt;string&gt;/Volumes/vol1/Users/ogo/GNUstep&lt;/stri=
ng&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_SYSTEM_ROOT&lt=
;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s=
tring&gt;/usr/local/OGoRoot&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbs=
p;&nbsp; &lt;key&gt;LIBRARY_COMBO&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;apple-apple-nil&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;GNUSTEP_PATHLIST&lt;/k=
ey&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;stri=
ng&gt;/Volumes/vol1/Users/ogo/GNUstep:/usr/local/OGoRoot&lt;/string&gt;<br>=
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;DYLD_FRAMEWORK_PATH&lt;/ke=
y&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;strin=
g&gt;/Volumes/vol1/Users/ogo/GNUstep/Library/Frameworks:/usr/local/OGoRoot/=
Library/Frameworks&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;DYLD_LIBRARY_PATH&lt;/=
key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;str=
ing&gt;/Volumes/vol1/Users/ogo/GNUstep/Library/Libraries:/usr/local/OGoRoot=
/Library/Libraries&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&lt;key&gt;LANG&lt;/key&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;=
en_US.UTF-8&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key=
&gt;CLASSPATH&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &lt;string&gt;.:/usr/local/=
share/postgresql/java/postgresql.jar:/Volumes/vol1/Users/ogo/GNUstep/Librar=
y/Libraries/Java:/usr/local/OGoRoot/Library/Libraries/Java&lt;/string&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;key&gt;PATH&lt;/key&gt;<br>&n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;/Volum=
es/vol1/Users/ogo/GNUstep/Tools:/usr/local/OGoRoot/Tools:/bin:/sbin:/usr/bi=
n:/usr/sbin:/usr/local/bin&lt;/string&gt;<br>&nbsp;&nbsp; &lt;/dict&gt;<br>=
<br>&nbsp;&nbsp;&nbsp; &lt;key&gt;StandardOutPath&lt;/key&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;/usr/local/OGoRoot/=
logs/logfile&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &lt;key&gt;StandardErrorP=
ath&lt;/key&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;/usr=
/local/OGoRoot/logs/logfile&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp; &lt;key&gt=
;ServiceDescription&lt;/key&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;string&gt;The OpenGroupware (=
OGo) main listener app&lt;/string&gt;<br>&lt;/dict&gt;<br>&lt;/plist&gt;<br=
><br><br><br><br><br><br>

------=_Part_32179_4377761.1133781607814--