FreeBSD godoc server rc.d script

173 views
Skip to first unread message

Maxim Khitrov

unread,
May 2, 2012, 2:47:34 PM5/2/12
to golan...@googlegroups.com
For anyone interested in running a local godoc server on FreeBSD:

The attached rc.d script starts godoc as an unprivileged user, and
arranges for it to listen on 127.0.0.1:6060 and log to
/var/log/godoc.log. You can change all of these settings in rc.conf.

I run the server behind nginx and it's been working very well. The one
thing I couldn't figure out is if there is some simple way to specify
a root path for the URLs. The generated links are always absolute, so
serving the documentation from http://myserver/godoc/... doesn't work.
If someone has a solution for this, please let me know.

- Max
godoc

Johan Henselmans

unread,
Jun 21, 2013, 6:26:46 PM6/21/13
to golan...@googlegroups.com
Uhh, where is the attachment? I am just looking for a simple FreeBSD startup
script, but I could not see the attachment.

Maxim Khitrov

unread,
Jun 21, 2013, 10:38:55 PM6/21/13
to Johan Henselmans, golan...@googlegroups.com
Hm... I guess the server stripped it. Playground to the rescue:

http://play.golang.org/p/0gFv1qckoR
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Starfish

unread,
Jun 22, 2013, 6:18:40 PM6/22/13
to golan...@googlegroups.com
Oh my... Is there no simpler way?


On Wednesday, May 2, 2012 8:47:34 PM UTC+2, Maxim Khitrov wrote:

Johan Henselmans

unread,
Jun 25, 2013, 2:44:43 AM6/25/13
to golan...@googlegroups.com
Sure:

=================================
#!/bin/bash

export GOPATH=/home/golang/pkgs
export PATH=/home/golang/pkgs/bin:$PATH

gotour
=================================

But then you'd miss a lot of the nice things that the rc structure gives you, like possibility to stop, restart and reload in a coherent way.
Reply all
Reply to author
Forward
0 new messages