MSEARCHD(8) System Manager's Manual MSEARCHD(8)

msearchdFastCGI mail archive query server

msearchd [-dv] [-j n] [-p path] [-s socket] [-t tmpldir] [-u user] [db]

msearchd is a server which implements the FastCGI Protocol to provide search facilities for the mail archive.

It opens a socket at /var/www/run/msearchd.sock, owned by www:www with permissions 0660. It will then chroot(8) to /var/www and drop privileges to user “www”. Three child processes are ran to handle the incoming traffic on the FastCGI socket. Upon SIGHUP the database is closed and re-opened. The default database used is at /msearchd/mails.sqlite3 inside the chroot.

The options are as follows:

Do not daemonize. If this option is specified, msearchd will run in the foreground and log to standard error.
n
Run n child processes.
path
chroot(2) to path. A path of / effectively disables the chroot.
socket
Create an bind to the local socket at socket.
tmpldir
Path to a directory containing the template files. /etc/smarc by default.
user
Drop privileges to user instead of default user www and chroot(8) to their home directory.
Enable more verbose (debug) logging. Multiple -v options increase the verbosity.

/etc/smarc/foot.html
Template with the trailing part of the page.
/etc/smarc/head.html
Template with the first part of the page. TITLE is replaced with “Search”.
/etc/smarc/search-header.html
Template for the start of the search page.
/etc/smarc/search.html
Template for the search form. QUERY is replaced with the search query.
/var/www/msearchd/mails.sqlite3
Default database.
/var/www/run/msearchd.sock
UNIX-domain socket.

Example configuration for httpd.conf(5):

server "localhost" {
	listen on * port 80
	root "/smarc"
	gzip-static

	location "/search" {
		fastcgi socket "/run/msearchd.sock"
	}
}

httpd(8)

Omar Polo <op@openbsd.org>

April 4, 2023 OpenBSD 7.4