Thread: Startup Script
-
05-24-2008, 09:19 AM #1
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?
-
07-19-2008, 03:38 AM #2
Bump
-
07-24-2008, 11:28 AM #3
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!
-
07-24-2008, 11:48 AM #4
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 ...
-
12-31-2008, 11:43 AM #5
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
I have an example of a DynDNS updater script on my website that uses this method.Code:launchctl load /Library/LaunchDaemons/tld.domain.subdomain.plist
-Egeste
-
07-23-2009, 11:16 AM #6
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]
-
07-23-2009, 12:15 PM #7
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
-
The Following User Says Thank You to Egeste For This Useful Post:
michaelwithe21 (07-23-2009)
-
07-23-2009, 12:24 PM #8
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 snapshotLast edited by michaelwithe21; 07-23-2009 at 12:33 PM.
-
07-23-2009, 12:37 PM #9
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.
-
The Following User Says Thank You to Egeste For This Useful Post:
michaelwithe21 (07-23-2009)
-
07-23-2009, 12:40 PM #10

-
07-23-2009, 12:47 PM #11
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"
-
The Following User Says Thank You to Egeste For This Useful Post:
michaelwithe21 (07-23-2009)
-
07-23-2009, 12:54 PM #12
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



LinkBack URL
About LinkBacks
Reply With Quote
