Many thanks for the troubleshooting ideas. I answered all your
questions below. Since then it''s started working all of a sudden, which
is annoying since I didn''t discover exactly why it was failing before.
I''m slightly concerned that it might *stop* working at some point in
the future just as mysteriously as it *started* working. Maybe it was
some permissions problem that I inadvertently changed while messing
around with it. Oh well. Here''s the final script...
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting SWU Rails App from script"
cd /Users/salestraining/rails/swu/
/usr/bin/ruby script/server -d -e production 2> log/startupitem.log
}
RunService "$1"
On Aug 19, 2005, at 2:48 PM, Ray Baxter wrote:
> What are the permissions on /Users/salestraining/rails/swu? Does that
> directory exist?
trg-admin:/Users/salestraining/rails root# ls -l
drwxr-xr-x 19 admin staff 646 18 Aug 21:12 swu
> Is ruby in the path at startup? Try replacing ruby script/server with
> /usr/bin/ruby script/server, or the OS X equivalent.
I tried this but I still get the error in system.log, unfortunately.
> What does it say in log/startupitem.log? Does that file exist?
trg-admin:/Users/salestraining/rails/swu/log root# cat startupitem.log
=> Rails application started on http://0.0.0.0:3000
It''s funny that it''s getting this far, but still is failing.
> Is the timestamp the same as the last startup time? Is that directory
> writable?
Yes and yes.
> Is there any additional error messages written to the console at
> startup?
Not any that popped out at me, but there may be. Here''s a better sample
of the log at /var/log/system.log...
Aug 19 19:09:53 localhost SystemStarter: Welcome to Macintosh.
Aug 19 19:09:53 localhost lookupd[119]: lookupd (version 324.5)
starting - Fri Aug 19 19:09:53 2005
Aug 19 19:09:56 localhost kernel: ApplePMUUserClient::setProperties
WakeOnACchange 0
Aug 19 19:09:56 localhost ConsoleMessage: Starting SecurityServer
Aug 19 19:09:56 localhost ConsoleMessage: Starting kernel event agent
Aug 19 19:09:56 localhost ConsoleMessage: Starting Apple Multicast DNS
Responder
Aug 19 19:09:56 localhost ConsoleMessage: Starting SWU Rails App from
script
Aug 19 19:09:56 localhost ConsoleMessage: Starting timed execution
services
Aug 19 19:09:56 localhost ConsoleMessage: Initializing network
Aug 19 19:09:56 localhost diskarbitrationd[87]: disk0s3 hfs
B507E0D3-E05D-36DE-9111-FB7B81645881 Macintosh HD /
Aug 19 19:09:56 localhost SystemStarter: Starting SecurityServer
Aug 19 19:09:56 localhost SystemStarter: Starting Apple Multicast DNS
Responder
Aug 19 19:09:56 localhost mDNSResponder[165]: mDNSResponder-58.8 (Apr
24 2004 00:15:05) starting
Aug 19 19:09:56 localhost ConsoleMessage: Checking disks
Aug 19 19:09:56 localhost SystemStarter: Starting SWU Rails App from
script
Aug 19 19:09:56 localhost SystemStarter: Starting timed execution
services
Aug 19 19:09:56 localhost SystemStarter: Initializing network
Aug 19 19:09:56 localhost SystemStarter: Starting kernel event agent
Aug 19 19:09:56 localhost SystemStarter: Checking disks
Aug 19 19:09:58 localhost kernel: ATY,Merlin_A: vram [9c000000:02000000]
Aug 19 19:09:58 localhost kernel: ATY,Merlin_B: vram [98000000:02000000]
Aug 19 19:09:58 localhost kernel: UniNEnet::monitorLinkStatus - Link is
up at 100 Mbps - Full Duplex
Aug 19 19:09:58 localhost configd[86]: AppleTalk startup
Aug 19 19:09:58 localhost configd[86]: executing
/System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/
set-hostname
Aug 19 19:09:58 localhost set-hostname[186]: setting hostname to
Training-Admin-eMac.local
Aug 19 19:09:59 localhost SystemStarter: The "HasShadow" window
property is obsolete. Use CGSSetWindowShadowAndRimParameters(cid, wid,
0.0,0.0, 0,0, CGSNoShadowStyle) to turn off the window shadow instead.
Set a break-point on CGSLogMessage to find out where this property is
set.
Aug 19 19:09:59 localhost syslogd: /dev/console: Input/output error
Aug 19 19:09:59 localhost init: kernel security level changed from 0 to
1
Aug 19 19:09:59 localhost configd[86]: posting notification
com.apple.system.config.network_change
Aug 19 19:09:59 localhost configd[86]: executing
/System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/
enable-network
Aug 19 19:09:59 localhost mach_init[2]: Server 2297 in bootstrap d03
uid 0: "/usr/sbin/lookupd": exited as a result of signal 1 [pid 119]
Aug 19 19:09:59 localhost configd[86]: executing
/System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/
set-hostname
Aug 19 19:10:00 localhost lookupd[196]: lookupd (version 324.5)
starting - Fri Aug 19 19:10:00 2005
Aug 19 19:10:00 localhost ConsoleMessage: Loading Shared IP extension
Aug 19 19:10:00 localhost ConsoleMessage: Starting network time
synchronization
Aug 19 19:10:00 localhost ConsoleMessage: Starting network file system
Aug 19 19:10:00 localhost ntpdate[242]: ntpdate 4.1.1@1.786 Fri Sep 12
18:30:10 PDT 2003 (1)
Aug 19 19:10:00 localhost ntpdate[242]: step time server 172.21.22.17
offset -0.164709 sec
Aug 19 19:10:00 localhost ntpd[257]: ntpd 4.1.1@1.786 Fri Sep 12
18:30:03 PDT 2003 (1)
Aug 19 19:10:00 localhost ntpd[257]: precision = 6 usec
Aug 19 19:10:00 localhost automount[266]: automount version 57
Aug 19 19:10:00 localhost ConsoleMessage: Starting Apple File Service
Aug 19 19:10:00 localhost ConsoleMessage: Starting printing services
Aug 19 19:10:00 localhost /usr/sbin/AppleFileServer: Sent launch
request message to DirectoryService mach_init port
Aug 19 19:10:00 localhost DirectoryService[284]: Launched version 1.8
(v256.6)
Aug 19 19:10:00 localhost automount[289]: automount version 57
Aug 19 19:10:01 localhost configd[86]: AppleTalk startup complete
Aug 19 19:10:01 localhost set-hostname[303]: setting hostname to
trg-admin.sweetwater.com
Aug 19 19:10:01 localhost ConsoleMessage: Loading IP Firewall extension
Aug 19 19:10:02 localhost automount[266]: logout notification received.
Aug 19 19:10:02 localhost automount[266]: requesting logout processing.
Aug 19 19:10:02 localhost automount[266]: handle_deferred_requests:
user logged out.
Aug 19 19:10:02 localhost automount[289]: logout notification received.
Aug 19 19:10:02 localhost automount[289]: requesting logout processing.
Aug 19 19:10:02 localhost automount[289]: handle_deferred_requests:
user logged out.
Aug 19 19:10:03 localhost kernel: IP packet filtering initialized,
divert enabled, rule-based forwarding enabled, default to accept,
logging disabled
Aug 19 19:10:03 localhost kernel: IPv6 packet filtering initialized,
default to accept, logging disabled
Aug 19 19:10:03 localhost kernel: IP firewall loaded
Aug 19 19:10:03 localhost ConsoleMessage: Starting internet services
Aug 19 19:10:03 localhost xinetd[329]: xinetd Version 2.3.11 started
with libwrap options compiled in.
Aug 19 19:10:03 localhost xinetd[329]: Started working: 2 available
services
Aug 19 19:10:05 localhost SystemStarter: swu (132) did not complete
successfully.
Aug 19 19:10:05 localhost SystemStarter: The following StartupItems
failed to properly start:
Aug 19 19:10:05 localhost SystemStarter:
/Library/StartupItems/swu
Aug 19 19:10:05 localhost SystemStarter: - execution of Startup script
failed
Aug 19 19:10:05 localhost SystemStarter:
Aug 19 19:10:05 localhost SystemStarter: Startup complete.
>> Here is /Library/StartupItems/swu/swu...
>>
>> #!/bin/sh
>>
>> . /etc/rc.common
>>
>> StartService ()
>> {
>> ConsoleMessage "Starting Rails App from script"
>> cd /Users/salestraining/rails/swu/
>> ruby script/server -d -e production > log/startupitem.log
>> }
>>
>> RunService "$1"
>>
>>
>>
>> Here is /Library/StartupItems/swu/StartupParameters.plist...
>>
>> {
>> Description = "swu";
>> Provides = ("swu");
>> OrderPreference = "Last";
>> Messages >> {
>> start = "Starting SWU Rails App";
>> stop = "Stopping SWU Rails App";
>> };
>> }
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails