by lobster_johnson · 10y ago · 0 comments
Launchd is solid and full-featured:
* Good process management (failure retries with backoff)
* Supports watching folders
* Decent command-line client for when you want to script or work fast in the shell
* Supports starting daemons on login
* Can start/stop based on whether certain things (network, paths, mounts, etc.) are up/down
* Supports calendar-based scheduling (replaces cron)
* Can redirect logging
* Can enforce resource limits (RAM, CPU, I/O, number of processes etc.) + nice level
I run all my daemons (Homebrew apps as well as personal development stuff) under Launchd, and I would love a convenient menu-bar GUI like this.
No, it's a train wreck of bad design, lack of backwards compatibility and sharp edges:
* Tracks PIDs only, so make sure that your process doesn't double fork (as many unix daemons do by default) or it'll lose track of them.
* No real documentation from Apple (man page is useless). The best resource is http://launchd.info.
* No feedback to commands: launchctl doesn't give any useful output about whether a command worked or not.
* Even something as simple as disabling a daemon may require manually editing one of the many `overrides.plist` XML files somewhere on the system.. though check your OS version because this changed between 10.9 and 10.10 without notice.
* ...I could go on.
Due to the chronic lack of documentation, many operations are totally trial and error. In fact, it is so bad that there's a market for a GUI tool (LaunchControl) which, to its credit, does manage to make launchd less painful than a trip to the dentist.
The only feature it adds that sysv didn't have is socket activation, and it doesn't do anything that xinetd didn't.
Makes it easy to set up your own launchd entries and manage existing ones, both user and system. I set up an rsync script to sync my photos with my NAS when I'm on my home wifi automatically.
I like it so much I bought it. There is no registration or serials or copy protection (IOW paying is optional) but after using it for a few weeks I felt like the asking price of $10 was more than justified for the utility I received from this utility.
I understand why some people may prefer a simpler tool.
2. I love lunchy [1] (now ported to Go [2]), it's a simple launchctl wrapper that you can install with brew cask.
Having Marathono popup function as a proxy for Homebrew-managed services would give me a single dashboard for my development daemons, including infrastructure and my own app codes.
Consider using Docker/Docker Compose for this. It then becomes as easy as defining the image name and version, pulling it, and then starting the container. No brew, no version conflicts, it just works.
In defence of the team, the Docker value prop on macOS is fundamentally undermined by the broken shared volumes. Folders that are shared with the hosts are still unusably slow for larger projects, so we can't use them (docker-sync makes it better, but adds another layer of complexity). Further, a lot of tooling and IDEs still expect local files and a local interpreter for step-debugging. So if the files are on the host, and so is node/php, then docker adds no dev value for app-level work. CI, yes, local dev - not so much. From there, it's a slippery slope - if I already have app stuff on the host, might as well install infrastructure stuff too because it doesn't really change so why should I deal with another virtualisation layer. It'll be an uphill battle until Docker volumes work at native speeds on mac out of the box.