4 ms·
> When was the last time you read a manpage about launchd or one of its helpers? Every time I had to write a lauchdaemon to implement the equivalent of what wo
by zdw 12y ago
> When was the last time you read a manpage about launchd or one of its helpers?
Every time I had to write a lauchdaemon to implement the equivalent of what would be done in cron or inetd.
But I do a lot of Mac sysadmin work.
- fit2rule 12y agoAs a homebrew user I absolutely abhor having to keep around a list of instructions that I've only barely just caught during an install .. things like: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.rethinkdb.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.rethinkdb.plist cassandra To have launchd start cassandra at login: ln -sfv /usr/local/opt/cassandra/*.plist ~/Library/LaunchAgents Then to load cassandra now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist To have launchd start redis at login: ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents Then to load redis now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist Or, if you don't want/need launchctl, you can just run: redis-server /usr/local/etc/redis.conf .. and so on and on it goes .. seems like the more things 'improve', the more they stay the same.
- bazzargh 12y agoI prefer to use lunchy to do the launchctl stuff: https://github.com/eddiezane/lunchy https://github.com/eddiezane/lunchy 'gem install lunchy' to install it. Your commands would have been eg 'lunchy stop rethinkdb', 'lunchy start rethinkdb' - it matches on substrings. The ln step is handled slightly differently - it doesn't work with lists of files, and installs to two different places, but this is roughly equivalent: for f in /usr/local/opt/cassandra/*.plist; do lunchy install -s $f; done (here the -s flag is symlink rather than copy)
- fit2rule 12y agoI have much disdain for this solution - even though it is a solution - because its a non-builtin tool and has dependencies outside the OSX sphere in order to run. I wish there were some sort of Guild of OS Developers that could be relied on to enforce the inclusion of standardized tools in all OS's released by its members. It seems that a lack of an organizing body to enforce these standards - or in Apples' case, any way for the public to influence the standards they dictate - is a real problem with OS development today. Nevertheless, good to know about lunchy. I will try to remember to check it out some time.
- oesmith 12y agoPro-tip: you can use "brew info [package-name]" to lookup the post-install info that flashes up after a homebrew install. $ brew info cassandra cassandra: stable 2.1.2 http://cassandra.apache.org Not installed From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cassandra.rb ==> Caveats If you plan to use the CQL shell (cqlsh), you will need the Python CQL library installed. Since Homebrew prefers using pip for Python packages, you can install that using: pip install cql To have launchd start cassandra at login: ln -sfv /usr/local/opt/cassandra/*.plist ~/Library/LaunchAgents Then to load cassandra now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist
- deong 12y agoMy iMac's automated backup has been broken since Yosemite because Apple removed the ability to set environment variables that all processes started from launchd could use. It appears that "run a python program as root on a schedule regardless of if anyone is logged in" is no longer possible on a Mac. Or rather, me and my CS PhD aren't capable of figuring out how to do it. I just keep a terminal window open at all times as a reminder to occasionally manually run the script.
- protomyth 12y agoIf I am having a problem with OpenBSD, I read the man pages. If I am having a problem with OS X, I search the web for a result. I just don't quite trust the OS X man pages anymore.