Skip to content

OSX's launchd communicator. (Communicate with launchd from python).

Notifications You must be signed in to change notification settings

alkeldi/launchdpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

launchdpy

OSX's launchd communicator. (Communicate with launchd from python).

Dependencies

  • Place launch.py in the same directory as launchdpy.py

Example 1: List a single job's info

import launchpy

job = launchpy.launchMsg({"GetJob": "com.apple.geod"}) #assuming com.apple.geod is our target job
print(job)

Example 2: Imitate launchctl

import launchpy

jobs = launchpy.launchMsg("GetJobs")
for label in jobs:
    PID = "?"
    LastExitStatus = "?"
    if "PID" in jobs[label]:
        PID = jobs[label]["PID"]
    if "LastExitStatus" in jobs[label]:
        LastExitStatus = jobs[label]["LastExitStatus"]
    print(PID, "\t", LastExitStatus, "\t", label)

Important Notes

  • "GetJob" and "GetJobs" are two of many values that can be used to comunicate with launchd. A full list of these values is found in launch.py

About

OSX's launchd communicator. (Communicate with launchd from python).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages