2

I have a launchd plist that uses StartCalendarInterval to start my python script at the desired time and day of the week.

Now I want to create a launchd plist that both starts and terminates a different python script at selected times. Where is the "KillCalender" command or equivalent?

Essentially, I want the program the controls my Christmas lights come on at 1800 and go off at 2200.

I suppose I could write the main loop in my python program so it terminates at 2200 but I was hoping launchd could do this for me.

  • Does python need to run whilst the lights are on or just to turn them on and off – Mark Dec 10 '14 at 11:28
  • Yes, python would be running the whole time to blink things, switch colors etc. – rblove Dec 11 '14 at 2:56
  • I would write an app to message your app - launchd would run the new app at 2200 – Mark Dec 11 '14 at 12:35
2

I would look into the ExitTimeOut value for launchd.plist:

TimeOut

The recommended idle time out (in seconds) to pass to the job. If no value is specified, a default time out will be supplied by launchd for use by the job at check in time.

ExitTimeOut

The amount of time launchd waits before sending a SIGKILL signal. The default value is 20 seconds. The value zero is interpreted as infinity.

  • FWIW, the man page description of TimeOut now includes the note "This key never did anything interesting and is no longer implemented". – Tom Harrington Dec 2 '15 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .