Hopm-Arthur

Pre-requisites

  1. It is assumed you have doas configured properly. If you do not have this configured properly and are interfacing with your server as root, you are asking for trouble!
  2. It is assumed you have ran adduser before. If not, you can run it and the majority of the defaults are fine.
  3. It is **also** assumed you have your own favourite text editor. If you **do not have** a favourite text editor, I recommend installing nano via doas pkg_add nano. You must know how to use your favourite text editor as I won't cover you on how to use it.

Installation

Create hopm as its own user.

$ doas adduser
Use option ``-silent'' if you don't want to see all warnings and questions.

Reading /etc/shells
Check /etc/master.passwd
Check /etc/group

Ok, let's go.
Don't worry about mistakes. There will be a chance later to correct any input.
Enter username []: hopm
Enter full name []: hopm
Enter shell bash csh jk_chrootsh ksh nologin sh [ksh]: nologin
Uid [1002]: 65532
Login group hopm [hopm]:  
Login group is ``hopm''. Invite hopm into other groups: guest no 
[no]: 
Login class authpf bgpd daemon default pbuild staff unbound znc 
[default]: daemon
Enter password []: 
Disable password logins for the user? (y/n) [n]: y

Name:        hopm
Password:    ****
Fullname:    hopm
Uid:         65532
Gid:         65532 (hopm)
Groups:      hopm 
Login Class: daemon
HOME:        /home/hopm
Shell:       /sbin/nologin
OK? (y/n) [y]: 
Added user ``hopm''
Copy files from /etc/skel to /home/hopm
Add another user? (y/n) [y]: n
Goodbye!

Install the necessary wget package which is required for pulling files. gmake is required for compiling and installing.

$ doas pkg_add wget gmake

Grab the latest hopm. As of writing, 1.1.6 is the latest.

$ doas -u hopm wget "https://github.com/ircd-hybrid/hopm/archive/1.1.6.tar.gz" -O "/home/hopm/hopm-1.1.6.tar.gz"

Decompress the downloaded tarball, after you navigate into its own home directory.

$ cd /home/hopm
$ doas -u hopm tar zxf hopm-1.1.6.tar.gz

Navigate into the extracted path and run configure within it.

$ cd hopm-1.1.6
$ doas -u hopm ./configure

Run gmake as per instructed. Then gmake install which will install into its $HOME/hopm by default.

$ doas -u hopm gmake
$ doas -u hopm gmake install

Copy hopm/etc/reference.conf as hopm/etc/hopm.conf and edit with **your own favourite text editor**. In my case I use vim.

$ cd ../hopm/etc
$ doas -u hopm cp reference.conf hopm.conf
$ doas -u hopm vim hopm.conf

Make necessary adjustments within the hopm.conf to suit your server/network configuration. Save and exit out of **your own favourite text editor**. In the first few running instances, I would enable debug mode to see if there were any issues with the configuration.

$ cd ../bin
$ doas -u hopm hopm -dd

Troubleshooting

Getting hopm configured right can be tricky. So, here are some few hints and tips.

  1. Ideally, for the initial testing/trialling phase, you do not want hopm to be running in the background. This is especially true if you aren't familiar with UNIX. To workaround this, you can run hopm with -d, e.g.
$ ./hopm -d

You can specify the -d however many times needed but its usefulness typically stops after the second "d",

$ ./hopm -dd

Also see here

If you see this error:

[2021-01-23T09:59:14-0600] IRC -> connect(): error connecting to username.coconut.ircnow.org: Connection refused                                                                 
[2021-01-23T09:59:14-0600] IRC -> Connection to (username.coconut.ircnow.org) failed, reconnecting.                                                                              
[2021-01-23T09:59:14-0600] IRC -> connect(): error connecting to username.coconut.ircnow.org: Connection refused

This may be due to a configuration issue with ngircd. In particular, if the hostname has an AAAA record, hopm may be trying to connect via IPv6 but ngircd does not listen to IPv6 connections.

Run Hopm as System Daemon

Create a file at /etc/rc.d/hopm

Add the following lines to it:

#!/bin/ksh
daemon="/home/hopm/hopm/bin/hopm"
. /etc/rc.d/rc.subr
rc_cmd $1

Run these commands to start hopm immediately and have it started on every boot:

doas chmod +x /etc/rc.d/hopm
doas rcctl start hopm
doas rcctl enable hopm

Additional details can be found on this page https://ircnow.org/kb/doku.php?id=openbsd:rc.d

Syntax errors when hopm is running in foreground: this is either the result of missing brackets where needed in config file, or that the file has DOS encodings. See https://github.com/ircd-hybrid/hopm/issues/22#issuecomment-301276082 here. The missing brackets where it was needed may come from the previous section, compared to the line/s where it is indicated by hopm when executed.