Baby's first Rust with extra steps (XPC, launchd, and FFI)!

During an ongoing argument in a chatroom between some folks about how “zomg systemd is ruining everything”, I decided to look at some init system history. I learned a cool tidbit of information from a HN comment1: apparently systemd’s design was inspired by Apple’s launchd. Embarassingly, I knew little to nothing about launchd, even as a lifelong Mac user. I began to play with launchctl on my local machine. Turns out that launchd does some pretty cool things: the *.plist describing a job can do more than just specify its arguments. For example, the QueueDirectories key lets you spawn jobs when files are added to a directory (how useful!). I was oblivious to this having interacted with launchd the past years mostly via brew services. With the help of soma-zone’s LaunchControl and launchd.info companion site, I was able to fiddle and figure out what various plist keys did.