blob: 756d3ec212a44b135d62339a64c571121b8bbfa9 [file] [log] [blame] [view]
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11001# Go on OpenBSD
2
Constantine A. Murenin1beb25b2015-02-25 20:26:18 +00003Go is available within the OpenBSD ports tree collection since OpenBSD 5.2. It is marked as i386- and amd64- only. See [`ports/lang/go`](http://ports.su/lang/go) for details.
Constantine A. Mureninc2964ab2015-02-25 20:04:31 +00004
5| **OpenBSD release** | **golang in ports** |
6|:--------------------|:--------------------|
Dimitri Sokolyuk6502da82015-10-19 17:15:00 +02007| 5.8 (Oct 18, 2015) | go-1.4.2 |
Jack Peirce67c88152015-05-07 20:20:37 -06008| 5.7 (May 1, 2015) | go-1.4.1 |
Constantine A. Murenin1beb25b2015-02-25 20:26:18 +00009| 5.6 (Nov 1, 2014) | go-1.3p0 |
Constantine A. Mureninc2964ab2015-02-25 20:04:31 +000010
11## Building from source.
12
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110013Required:
14
Mikio Hara79689152015-01-16 13:22:07 +090015 * OpenBSD amd64, 386: 5.5 and above
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110016 * If you want to run go1.3 or 1.4 on OpenBSD 5.6, see http://golang.org/issue/9102
17
18| **Kernel version** | **Min. version** | **Max. version**|
Dave Day682cb022014-12-10 15:32:04 +110019|:-------------------|:-----------------|:----------------|
Mikio Haraae27bc22016-01-14 10:41:30 +090020| 5.8 | go1.4.1 | go1.6 |
21| 5.7 | go1.4.1 | go1.6 |
22| 5.6 | go1.4.1 | go1.6 |
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110023
24 * ulimits (` /etc/login.conf `)
25
Michael McConville8ccc3172016-01-13 23:39:29 -050026Edit `/etc/login.conf` so that the staff class has the proper
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110027settings. The following is a working example of the staff class:
28```
29staff:\
30 :datasize-cur=infinity:\
31 :datasize-max=infinity:\
32 :datasize=infinity:\
33 :openfiles-cur=4096:\
34 :maxproc-max=512:\
35 :maxproc-cur=512:\
36 :ignorenologin:\
37 :requirehome@:\
38 :tc=default:
39```
40
Michael McConvilleeee069b2016-01-13 23:36:43 -050041If the database file `/etc/login.conf.db` exists, you need to rebuild it with:
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110042```
43# cap_mkdb /etc/login.conf
44```
45
Michael McConville1abb1222016-01-13 23:41:10 -050046Ensure that the user you intend to build Go with is in the `staff` login class:
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110047```
Michael McConville1abb1222016-01-13 23:41:10 -050048# usermod -L staff your_username_here
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110049```
50
51Look for the 5th element which is the login class, this is blank by
52users added by useradd. In the following example the user operator
53would be added to the staff class
54```
55## Before
56operator:*:2:5::0:0:System &:/operator:/sbin/nologin
57
58## After
59operator:*:2:5:staff:0:0:System &:/operator:/sbin/nologin
Michael McConville9d08e0a2016-01-13 23:17:38 -050060```