How do you have a unix script run every time you re-boot your device?

Discussion in 'iPod touch Firmware 2.X Jailbreak' started by jdawson, Jul 30, 2008.

  1. jdawson

    jdawson New Member

    Joined:
    Feb 1, 2008
    Messages:
    35
    Likes Received:
    0
    I want to have lighttpd start every time i reboot the device but don't know how.

    I always have to SSH in from my PC after the device crashes/reboots and then start it manually.

    I can't do this though if I am away from home and it reboots as I have no way to access the command line using just the ipod.
  2. crizh4x

    crizh4x Active Member

    Joined:
    Sep 19, 2007
    Messages:
    4,474
    Likes Received:
    17
    Device:
    2G iPod touch
    You would have to make a launch daemon for it, which will be interesting with code signatures. Saurik did it though

    Please Register or Log in to view images

  3. jdawson

    jdawson New Member

    Joined:
    Feb 1, 2008
    Messages:
    35
    Likes Received:
    0
    I am no Saurik... So any other options...

    Please Register or Log in to view images

  4. Tripa

    Tripa New Member

    Joined:
    Mar 7, 2008
    Messages:
    6
    Likes Received:
    0
    Device:
    iPhone
    Here is what i did (on a MAC)

    1. I created a text file with the following text

    #! /bin/sh

    lighttpd -f /private/etc/lighttpd.conf


    and save it with whatever name you want in /usr/bin (with no extensions like txt nor rtf)

    2. I then created another file with the folowing text:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.lighttpd.startup</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/"the name of your file"</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>


    and named it "com.lighttpd.startup" and copied it to /System/Library/LaunchDaemons

    3. Reboot and enjoy
  5. Van Helsing

    Van Helsing New Member

    Joined:
    Nov 27, 2007
    Messages:
    27
    Likes Received:
    1
    Device:
    iPhone 3GS (Black)
    I've followed this method to the letter, yet lighttpd will not start on boot. I still have to launch it through Terminal.

    Any ideas?

Share This Page