launchctl do not respawn

Discussion in 'Mac Programming' started by justdan0227, Mar 12, 2011.

  1. justdan0227 macrumors newbie

    Joined:
    Apr 10, 2010
    #1
    How do you control a launchctl plist to not respawn on an error. I want to download a file from my server if it exists once a day. If the file is not there I do not want the plist to respawn.

    I have tried KeepAlive and SucessfulExit and can't keep the program from respawnning if the ftp fails.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Post the command you're executing, exactly as it appears in your plist. Better yet, post the entire plist contents.

    The solution may be as simple as wrapping the ftp command in a shell command that always returns success.
     
  3. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #3
    Have you tried: RunAtLoad and LaunchOnlyOnce?
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    The OP said "once a day". It took that to mean the plist is intended to run at a once-daily scheduled time using StartCalendarInterval.
     
  5. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #5
    As opposed to: keepAlive which will make sure it's restarted and keeps running.
    These can co-exist, a calendar interval or a start interval combined with keep alive will keep the process running.
     

Share This Page