Results 1 to 2 of 2
Discuss launchd kills scripts ran from a SB icon. plist problem? at the iPhone Developer Exchange - Hackint0sh.org; I have a few bash shell scripts running from SpringBoard icons. A couple just move ...
  1. #1
    Rookie Array

    Join Date
    Oct 2009
    Posts
    13
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    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?



  2. #2
    Newbie Array

    Join Date
    Apr 2009
    Posts
    2
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Wow ! I found someone that has the SAME problem I have !

    I also use programs on the Sprinboard that simply (but efficently ) execute shell scripts to simplify things that would usually take minutes to hours if done manually.

    See this thread I made some while ago: Thread

 

 

Similar Threads

  1. Replies: 10
    Last Post: 02-20-2010, 02:24 AM
  2. 2G 2.1 .plist for icon order???
    By lyndwode in forum General
    Replies: 0
    Last Post: 11-05-2008, 02:48 PM
  3. 2G 2.1 .plist for icon order???
    By lyndwode in forum Quickpwn
    Replies: 0
    Last Post: 10-17-2008, 05:23 PM
  4. cannot login after upgrade to 10.5.5 launchd[1] failed
    By karimbase in forum Genuine Mac Support
    Replies: 0
    Last Post: 09-24-2008, 01:24 PM
  5. [1.1.4]Where is icon order plist located?
    By gobias101 in forum General
    Replies: 1
    Last Post: 03-20-2008, 08:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 06:05 PM.
twitter, follow us!