Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > Applications & Development > iPhone Developer Exchange

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2009, 04:37 AM
fubaya
Status: Offline
Junior Member
 
Join Date: Oct 2009
Posts: 12
Rep Power: 0
fubaya is on a distinguished road
Default launchd kills scripts ran from a SB icon. plist problem?

I have a few bash shell scripts running from SpringBoard icons. A couple just move files around on the phone and work fine, but 3 require a network connection and only 1 works properly (a simple "wget the last line copied"). I think launchd is killing the other two mid-execution.

This is the plist I use on both. The names are different, of course, but the format is the same. I assume this has something to do with the plist.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>nail.sh</string>
	<key>CFBundleIdentifier</key>
	<string>com.foo.nail</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>Nail</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
</dict>
</plist>
I have both scripts in /Applications/their.app/their.sh with all the files needed to run them from a SpringBoard icon. If I open MobileTerminal and type /Applications/their.app/their.sh, they both run fine, but both crash when running from a SB icon.

The first is a script using nail (a.k.a. mailx) to send mail through my gmail address with a simple:
#! /bin/sh
echo "some text" | mail "user@address.com"

I have mail set up correctly. Running from Terminal, it sends the mail. Running from an icon, it runs but dumps the mail into /var/mobile/dead.letter (typical mailx failure) and I get an error in syslog. Here are two examples from running it twice, same error except the hex changes every time:

Nov 2 02:48:16 30 com.apple.launchd[1] (UIKitApplication:com.foo.nail[0xc671]): (UIKitApplication:com.foo.nail[0xc671]) Throttling respawn: Will start in 2147483647 seconds

Nov 2 02:50:00 30 com.apple.launchd[1] (UIKitApplication:com.foo.nail[0x5cd1]): (UIKitApplication:com.foo.nail[0x5cd1]) Throttling respawn: Will start in 2147483647 seconds

The other script uses wget in a function to download a list of about a dozen webpages which are then processed, but it never gets through all the wgets. It should take about 1 second per page, so around 12-15 seconds to run to the end. It runs for several seconds and downloads most of the pages before dying, and it's not a problem with wgetting the pages. Taking out different pages, moving the order around, pinging the site before the wget... nothing helps. It keeps dying on the 7-8th page. This is in syslog:

Code:
Nov  2 03:31:47 30 SpringBoard[958]: com.foo.bigwget failed to launch in time \nelapsed total CPU time (seconds): 5.890 (user 1.710, system 4.180), 29% CPU \nelapsed application CPU time (seconds): 0.320, 2% CPU
Nov  2 03:31:47 30 SpringBoard[958]: Forcing crash report of com.foo.bigwget...
Nov  2 03:31:48 30 SpringBoard[958]: Finished crash reporting.
Nov  2 03:31:48 30 com.apple.launchd[1] (UIKitApplication:com.foo.bigwget[0x6d92][1235]): (UIKitApplication:com.foo.bigwget[0x6d92]) Exited: Killed
Nov  2 03:31:48 30 com.apple.launchd[1] (UIKitApplication:com.foo.bigwget[0x6d92]): (UIKitApplication:com.foo.bigwget[0x6d92]) Throttling respawn: Will start in 2147483627 seconds
Nov  2 03:31:48 30 SpringBoard[958]: Application 'ibigwget' exited abnormally with signal 9: Killed
Nov  2 03:31:48 30 SpringBoard[958]: Setting springboard visible = 1
Nov  2 03:31:48 30 ReportCrash[1294]: Could not save crash report to disk!
Nov  2 03:31:48 30 ReportCrash[1294]: Incident Identifier: 478E9F75-6944-4815-B4A7-D329B4594F55
Nov  2 03:31:48 30 ReportCrash[1294]: CrashReporter Key:   582c70f125b8660f26110882f4236298aff6c003
Nov  2 03:31:48 30 ReportCrash[1294]: Process:         sh [1235]
Nov  2 03:31:48 30 ReportCrash[1294]: Path:            /bin/sh
Nov  2 03:31:48 30 ReportCrash[1294]: Identifier:      sh
Nov  2 03:31:48 30 ReportCrash[1294]: Version:         ??? (???)
Nov  2 03:31:48 30 ReportCrash[1294]: Code Type:       ARM (Native)
Nov  2 03:31:48 30 ReportCrash[1294]: Parent Process:  launchd [1]
Nov  2 03:31:48 30 ReportCrash[1294]:  
Nov  2 03:31:48 30 ReportCrash[1294]: Date/Time:       2009-11-02 03:31:47.583 -0500
Nov  2 03:31:48 30 ReportCrash[1294]: OS Version:      iPhone OS 3.0.1 (7A400)
Nov  2 03:31:48 30 ReportCrash[1294]: Report Version:  104
Nov  2 03:31:48 30 ReportCrash[1294]:  
Nov  2 03:31:48 30 ReportCrash[1294]: Exception Type:  00000020
Nov  2 03:31:48 30 ReportCrash[1294]: Exception Codes: 0x8badf00d
Nov  2 03:31:48 30 ReportCrash[1294]: Highlighted Thread:  0
Nov  2 03:31:48 30 ReportCrash[1294]:  
Nov  2 03:31:48 30 ReportCrash[1294]: Application Specific Information:
Nov  2 03:31:48 30 ReportCrash[1294]: com.foo.bigwget failed to launch in time 
Nov  2 03:31:48 30 ReportCrash[1294]: elapsed total CPU time (seconds): 5.890 (user 1.710, system 4.180), 29% CPU 
Nov  2 03:31:48 30 ReportCrash[1294]: elapsed application CPU time (seconds): 0.320, 2% CPU
So, from what I can figure, they just aren't being launched the way launchd wants, and the SOB is killing them. I've tried reading through launchd and plist docs but for a Linux guy, this stuffs all greek and all seems to be geared around using launchd/launchctl as cron, but I just want these to run at the tap of an icon and not die. Is there a "CFBundlePleaseDontKillMeLaunchd" I should set to "true" in the plist?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
icon problem emer_cvt General 0 02-16-2008 04:08 PM
(1.0.2) Problem - No iPod Icon on Springboard ! Intex1 Older Software Unlock Solution 3 02-14-2008 11:18 PM
ziphone problem, apple icon when booting g0tcha Older Software Unlock Solution 1 02-11-2008 11:10 PM
Icon unsolved problem megladon General 0 01-28-2008 10:05 PM
Odd problem with summerboard theme ( weather icon not changing with theme ) kubi General 4 12-20-2007 12:01 PM



All times are GMT +2. The time now is 07:17 AM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105