[iphone-python] Script on startup
Gordon Child
gordon.child at gmail.com
Tue Sep 2 21:40:33 UTC 2008
Well, you'll need to chmod the script to allow execution. 755 would do it.
Also, I found that you need to either be in the
/System/Library/LaunchDaemons/ directory when you first issue the launchctl
command or reference the plist file using the full path.
IE: launchctl load -w
/System/Library/LaunchDaemons/com.something.program.plist
-Gordon
On Tue, Sep 2, 2008 at 3:20 PM, Charles-Axel Pauwels <capauwels at gmail.com>wrote:
> Do i have to put special permissions on my app and the plist file?
> Thanks again!
>
> Charles
>
> Le 02-sept.-08 à 22:56, Gordon Child a écrit :
>
> Charles,
> You can do this pretty easily using launchd/launchctl.
>
> Create your own launchctl plist file, then copy the file to
> /System/Library/LaunchDaemons/
> Then launch by issuing the command "launchctl load -w
> com.something.program" (or you can use Erica Sadin's UIctl gui application)
>
> I've placed a sample launchctl plist file on gordonchild.com/testapps/
> the file is com.gordonchild.massms.plist. It references /var/mobile/massms
> which is actually a python script with a #!/usr/bin/python shebang line.
> This one actually launches every 6 minutes.
>
> You can create a plist file that will constantly run your script and
> launchd will relaunch it if it ever crashes or gets terminated.
>
> More information on launchctl and launchd.plist files.
>
> http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/launchctl.1.html
>
> http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man5/launchd.plist.5.html
>
> -Gordon
>
> On Tue, Sep 2, 2008 at 2:39 PM, Charles-Axel Pauwels <capauwels at gmail.com>wrote:
>
>> Hello!
>>
>> I've written a python script for the iphone. It runs in the background
>> with an infinite loop. The script works perfectly, but i have to start
>> it manually in Terminal.app, with "python script.py".
>>
>> Is it possible to run the script when the iphone starts?
>>
>> If you know how to do this, please answer, because this script is
>> quite useful and i don't want to release it before this problem is
>> solved.
>>
>> PS: I have a problem when launching Cydia. It kills the script running
>> in Terminal.
>>
>> Thanks a lot,
>>
>> Charles
>>
>> iPhone software 2.0.0
>>
>> _______________________________________________
>> iPhone-Python mailing list
>> iPhone-Python at telesphoreo.org
>> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-python
>>
>
> _______________________________________________
> iPhone-Python mailing list
> iPhone-Python at telesphoreo.org
> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-python
>
>
>
> _______________________________________________
> iPhone-Python mailing list
> iPhone-Python at telesphoreo.org
> http://www.telesphoreo.org/cgi-bin/mailman/listinfo/iphone-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.telesphoreo.org/pipermail/iphone-python/attachments/20080902/3be01e64/attachment.htm
More information about the iPhone-Python
mailing list