My linux distro comes with a program called agetty. It allows you to bypass login and specify which program to run (as a replacement for /bin/login). So
causes /path/to/program to run on ttyname (it runs as root since no login was prompted for). I don't know if agetty is available for OpenBSD, but if not there may be something with similar functionality.