| # Go on OpenBSD |
| |
| Go 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. |
| |
| | **OpenBSD release** | **golang in ports** | |
| |:--------------------|:--------------------| |
| | 5.8 (Oct 18, 2015) | go-1.4.2 | |
| | 5.7 (May 1, 2015) | go-1.4.1 | |
| | 5.6 (Nov 1, 2014) | go-1.3p0 | |
| |
| ## Building from source. |
| |
| Required: |
| |
| * OpenBSD amd64, 386: 5.5 and above |
| * If you want to run go1.3 or 1.4 on OpenBSD 5.6, see http://golang.org/issue/9102 |
| |
| | **Kernel version** | **Min. version** | **Max. version**| |
| |:-------------------|:-----------------|:----------------| |
| | 5.8 | go1.4.1 | go1.6 | |
| | 5.7 | go1.4.1 | go1.6 | |
| | 5.6 | go1.4.1 | go1.6 | |
| |
| * ulimits (` /etc/login.conf `) |
| |
| Edit `/etc/login.conf` so that the staff class has the proper |
| settings. The following is a working example of the staff class: |
| ``` |
| staff:\ |
| :datasize-cur=infinity:\ |
| :datasize-max=infinity:\ |
| :datasize=infinity:\ |
| :openfiles-cur=4096:\ |
| :maxproc-max=512:\ |
| :maxproc-cur=512:\ |
| :ignorenologin:\ |
| :requirehome@:\ |
| :tc=default: |
| ``` |
| |
| If the database file `/etc/login.conf.db` exists, you need to rebuild it with: |
| ``` |
| # cap_mkdb /etc/login.conf |
| ``` |
| |
| Add the login class to the user you would like to have build go |
| ``` |
| # vipw |
| ``` |
| |
| Look for the 5th element which is the login class, this is blank by |
| users added by useradd. In the following example the user operator |
| would be added to the staff class |
| ``` |
| ## Before |
| operator:*:2:5::0:0:System &:/operator:/sbin/nologin |
| |
| ## After |
| operator:*:2:5:staff:0:0:System &:/operator:/sbin/nologin |
| ``` |