How to run Godoc under Launchd on OS X

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

How to run Godoc under Launchd on OS X

Godoc is an amazing reference utility. I use the launchd to keep it running for me.

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist Version= "1.0" ><dict> <key>Label</key> <string>org.golang.godoc</string> <key& Gt      Programarguments</key> <array> <!--Ensure this was the absolute path to your Godoc install-- <string>/Users/dave/go/bin/godoc</string> <string>-http=127.0.0.1:6060</string> </arr ay> <key>Sockets</key> <dict> <key>Listeners</key> <dict> < ;key>sockservicename</key> <string>6060</string> </dict> </dict> <key >RunAtLoad</key> <false/> </dict></plist> 

Place this file in and ~/Library/LaunchAgents/org.golang.godoc.plist edit the absolute path to your Godoc binary. Then issue the command

$ launchctl load ~/Library/LaunchAgents/org.golang.godoc.plist

You can then browse to http://127.0.0.1:6060 to view the current documentation for your Go installation.

To stop Godoc just issue a killall Godoc and Launchd would restart it when necessary. You can use the same command after updating to the latest release to ensure your ' re viewing the most up to date Documentati On.

--– I'm a split line ——— –

Launchctl is not particularly friendly, load the plist file with load, will only report an error, but will not tell you what error, today toss for a long time, only to find the format problem, missing a number.

The original does not seem to mention using start start, in this case, the start Godoc need to use the start command:
launchctl start org.golang.godoc

Do not know why to start Godoc also configure Socketservice, see others Configure Redis also not specified, the results of the Redis configuration, has not started, fortunately, someone wrote a ready-made. Look for a chance to see the detailed format of plist to go.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.