+ Reply
Results 1 to 12 of 12

Thread: Startup Script

  1. #1
    What's Jailbreak?
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Startup Script

    Hey all,
    I am not all that familiar with the launch process of OS X, and namely the iPhone. I am trying to get a script, or alternatively a command, executed ONLY at startup. Here is the problem I am solving:

    SpringBoard crashes on me after boot where the touchpad I/O stops working inside any application. The solution to my problem is to SSH in, run a `ps -A`, and kill -9 <process of SpringBoard> So I wrote a script to do the same thing (or a simple `killall SpringBoard` that runs *once* at boot is also sufficient). Cron jobs are not sufficent because if I need to restart my phone at any time of day, well cron jobs are useless and I don't want springboard restarting every 2 min, for example.

    So, I am trying to figure out how to use launchd or launchctl to do this (I'm assuming this is my best bet). Any ideas?

  2. #2
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Bump

  3. #3
    What's Jailbreak?
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face touch boot

    One thing I found interesting was that the boot scripts of the iPhone and Touch are identical, and thus when starting a Touch in verbose you notice several iPhone-only processes starting and subsequently failing because they require iPhone-only software. :-) sorry I couldnt be of more help!

  4. #4
    Livin the iPhone Life
    Join Date
    Dec 2007
    Posts
    1,460
    Thanks
    15
    Thanked 197 Times in 184 Posts

    well, I looked it up once and the startup scripts are in some way related to /System/Library/LaunchDaemon/ ... the .plist files in there represent an application to be executed at startup. I tried adding an application by myself once but although I thought I did everything right it never worked. But you have to look there ...

  5. #5
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Quote Originally Posted by BlackWolf View Post
    well, I looked it up once and the startup scripts are in some way related to /System/Library/LaunchDaemon/ ... the .plist files in there represent an application to be executed at startup. I tried adding an application by myself once but although I thought I did everything right it never worked. But you have to look there ...
    There is a solution to this - take a look at this article.

    So basically, you write the script, create a launchd plist config file, add the file to /Library/LaunchDaemons and then load the file using

    Code:
    launchctl load /Library/LaunchDaemons/tld.domain.subdomain.plist
    I have an example of a DynDNS updater script on my website that uses this method.

    -Egeste

  6. #6
    Green Apple
    Join Date
    Jul 2009
    Posts
    30
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default i need help!!

    i just need to add a command/script to iphone's startup, please, i have read through your links, and they all seem to be too in-depth for me implement such a simple command (terminal or not)...

    HELP!!! here are the links describing how to control your iPhone no matter where it goes.. all i need is to add it to startup!!!

    http://www.modmyi.com/forums/iphone-...ml#post4787221

    [ame=http://forums.macrumors.com/showthread.php?p=8041054#post8041054]Control your iPhone from ANYWHERE it goes - Mac Forums[/ame]

  7. #7
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Quote Originally Posted by michaelwithe21 View Post
    i just need to add a command/script to iphone's startup, please, i have read through your links, and they all seem to be too in-depth for me implement such a simple command (terminal or not)...

    HELP!!! here are the links describing how to control your iPhone no matter where it goes.. all i need is to add it to startup!!!

    http://www.modmyi.com/forums/iphone-...ml#post4787221

    Control your iPhone from ANYWHERE it goes - Mac Forums
    michaelwithe21,
    launchd is well documented on the net as it is an open source project developed by Apple, and you can find a plethora of information by google-ing launchd tutorial or similar.

    That being said, i think you will find this link particularly useful.

    Also, check out the manpage for launchd and launchctl

    -Egeste

  8. The Following User Says Thank You to Egeste For This Useful Post:

    michaelwithe21 (07-23-2009)

  9. #8
    Green Apple
    Join Date
    Jul 2009
    Posts
    30
    Thanks
    8
    Thanked 3 Times in 3 Posts

    thanks man, the only reason I dont want to read-through all of this junk is because Im sure that someone els has already added a terminal command to launchd... im sure its really easy to figure out.. but I really dont have the know-how to figure it out...

    so any help for a lazy guy with a GREAT idea to be able to control your iphone no matter what network it goes onto... this could be made into an app if stable... so please, if you know of any specific tutorials that would show me what script to edit and where to add the command, i would greatly appreciate it!

    Update:

    hey, just found this junk:

    http://ask.metafilter.com/78590/How-...art-up-in-OS-X

    which led me to this app which can create deamon/launchd files... still have no clue how to use it.. im not familiar enough with it... im stupid

    http://tuppis.com/lingon/

    above is where u can download it, its called Lingon

    im gunna keep going through it and post a snapshot
    Last edited by michaelwithe21; 07-23-2009 at 12:33 PM.

  10. #9
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Quote Originally Posted by michaelwithe21 View Post
    thanks man, the only reason I dont want to read-through all of this junk is because Im sure that someone els has already added a terminal command to launchd... im sure its really easy to figure out.. but I really dont have the know-how to figure it out...

    so any help for a lazy guy with a GREAT idea to be able to control your iphone no matter what network it goes onto... this could be made into an app if stable... so please, if you know of any specific tutorials that would show me what script to edit and where to add the command, i would greatly appreciate it!

    Update:

    hey, just found this junk:

    How do I execute this command at start up in OS X? | Ask Metafilter

    which led me to this app which can create deamon/launchd files... still have no clue how to use it.. im not familiar enough with it... im stupid

    Tuppis - Lingon by Peter Borg

    above is where u can download it, its called Lingon

    im gunna keep going through it and post a snapshot
    You're not stupid, you're just inexperienced. Once you figure out how launchd works you'll find yourself answering questions from people just like you who are simply inexperienced

    Don't be lazy though, and don't be afraid to RTFManpage. The developers wrote those for you.

  11. The Following User Says Thank You to Egeste For This Useful Post:

    michaelwithe21 (07-23-2009)

  12. #10
    Green Apple
    Join Date
    Jul 2009
    Posts
    30
    Thanks
    8
    Thanked 3 Times in 3 Posts




  13. #11
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Apple supplies a plist editor as part of their xcode suite (not sure if it's included in macos by default) but it is located at "/Developer/Applications/Utilities/Property List Editor.app"

  14. The Following User Says Thank You to Egeste For This Useful Post:

    michaelwithe21 (07-23-2009)

  15. #12
    Green Apple
    Join Date
    Jul 2009
    Posts
    30
    Thanks
    8
    Thanked 3 Times in 3 Posts

    lol, your words do not comfort me =P... i know very little about scripts in general... the most ive ever used is "do shell script" as can be seen on my "virus" or vulnerability that i wrote here:

    Just an Idea - TSF - Mac Security Forums

    but, hopefully your right, and i will do some digging within property list editor.app and launchd... but please, if you have any quick jump methods for me to just implicate a simple SSH/CLI/Terminal command, point me there =P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts