#!/bin/sh # $FreeBSD: branches/2020Q4/www/searx/files/searx.in 463944 2018-03-09 08:34:57Z yuri $ # PROVIDE: searx # REQUIRE: DAEMON NETWORKING # BEFORE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable searx: # searx_enable="YES" # # searx_enable (bool): Set to YES to enable searx # Default: NO # searx_conf (str): searx configuration file # Default: ${PREFIX}/etc/searx.conf # searx_user (str): searx daemon user # Default: searx # searx_group (str): searx daemon group # Default: searx # searx_flags (str): Extra flags passed to searx . /etc/rc.subr name="searx" rcvar=searx_enable : ${searx_enable:="NO"} : ${searx_user:="www"} : ${searx_group:="www"} : ${searx_flags:=""} export SEARX_SETTINGS_FILE="/usr/local/etc/searx-settings.yml" # daemon pidfile="/var/run/${name}.pid" python="/usr/local/bin/python3.7" script_py="/usr/local/lib/python3.7/site-packages/${name}/webapp.py" command=/usr/sbin/daemon procname="daemon" command_args=" -c -f -P ${pidfile} ${python} ${script_py}" start_precmd="searx_precmd" searx_precmd() { install -o ${searx_user} /dev/null ${pidfile} } load_rc_config $name run_rc_command "$1"