Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 1 | # Go on OpenBSD |
| 2 | |
Constantine A. Murenin | 1beb25b | 2015-02-25 20:26:18 +0000 | [diff] [blame] | 3 | 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. |
Constantine A. Murenin | c2964ab | 2015-02-25 20:04:31 +0000 | [diff] [blame] | 4 | |
| 5 | | **OpenBSD release** | **golang in ports** | |
| 6 | |:--------------------|:--------------------| |
Dimitri Sokolyuk | 6502da8 | 2015-10-19 17:15:00 +0200 | [diff] [blame] | 7 | | 5.8 (Oct 18, 2015) | go-1.4.2 | |
Jack Peirce | 67c8815 | 2015-05-07 20:20:37 -0600 | [diff] [blame] | 8 | | 5.7 (May 1, 2015) | go-1.4.1 | |
Constantine A. Murenin | 1beb25b | 2015-02-25 20:26:18 +0000 | [diff] [blame] | 9 | | 5.6 (Nov 1, 2014) | go-1.3p0 | |
Constantine A. Murenin | c2964ab | 2015-02-25 20:04:31 +0000 | [diff] [blame] | 10 | |
| 11 | ## Building from source. |
| 12 | |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 13 | Required: |
| 14 | |
Mikio Hara | 7968915 | 2015-01-16 13:22:07 +0900 | [diff] [blame] | 15 | * OpenBSD amd64, 386: 5.5 and above |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 16 | * 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 Day | 682cb02 | 2014-12-10 15:32:04 +1100 | [diff] [blame] | 19 | |:-------------------|:-----------------|:----------------| |
Mikio Hara | ae27bc2 | 2016-01-14 10:41:30 +0900 | [diff] [blame] | 20 | | 5.8 | go1.4.1 | go1.6 | |
| 21 | | 5.7 | go1.4.1 | go1.6 | |
| 22 | | 5.6 | go1.4.1 | go1.6 | |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 23 | |
| 24 | * ulimits (` /etc/login.conf `) |
| 25 | |
Michael McConville | 8ccc317 | 2016-01-13 23:39:29 -0500 | [diff] [blame] | 26 | Edit `/etc/login.conf` so that the staff class has the proper |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 27 | settings. The following is a working example of the staff class: |
| 28 | ``` |
| 29 | staff:\ |
| 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 McConville | eee069b | 2016-01-13 23:36:43 -0500 | [diff] [blame] | 41 | If the database file `/etc/login.conf.db` exists, you need to rebuild it with: |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 42 | ``` |
| 43 | # cap_mkdb /etc/login.conf |
| 44 | ``` |
| 45 | |
Michael McConville | 1abb122 | 2016-01-13 23:41:10 -0500 | [diff] [blame^] | 46 | Ensure that the user you intend to build Go with is in the `staff` login class: |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 47 | ``` |
Michael McConville | 1abb122 | 2016-01-13 23:41:10 -0500 | [diff] [blame^] | 48 | # usermod -L staff your_username_here |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 49 | ``` |
| 50 | |
| 51 | Look for the 5th element which is the login class, this is blank by |
| 52 | users added by useradd. In the following example the user operator |
| 53 | would be added to the staff class |
| 54 | ``` |
| 55 | ## Before |
| 56 | operator:*:2:5::0:0:System &:/operator:/sbin/nologin |
| 57 | |
| 58 | ## After |
| 59 | operator:*:2:5:staff:0:0:System &:/operator:/sbin/nologin |
Michael McConville | 9d08e0a | 2016-01-13 23:17:38 -0500 | [diff] [blame] | 60 | ``` |