#!/bin/sh # PROVIDE: %%PORTNAME%% # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # go_cve_dictionary_enable (bool): Set to NO by default # Set it to YES to enable the CVE server # go_cve_dictionary_user (string): Set user to run go_cve_dictionary # Default is "%%USERS%%" # go_cve_dictionary_group (string): Set group to run go_cve_dictionary # Default is "%%GROUPS%%" # go_cve_dictionary_db_path (string): Set database path # Default is "/var/db/vuls/cve.sqlite3" # go_cve_dictionary_db_type (string): Set database type # Default is "sqlite3" # go_cve_dictionary_log_file (string): Set file that go_cve_dictionary will log to # Default is "/var/log/vuls/go_cve_dictionary.log" # go_cve_dictionary_args (string): Set additional command line arguments # Default is "" . /etc/rc.subr name=go_cve_dictionary rcvar=go_cve_dictionary_enable load_rc_config $name : ${go_cve_dictionary_enable:="NO"} : ${go_cve_dictionary_user:="%%USERS%%"} : ${go_cve_dictionary_group:="%%GROUPS%%"} : ${go_cve_dictionary_db_path:="/var/db/vuls/cve.sqlite3"} : ${go_cve_dictionary_db_type:="sqlite3"} : ${go_cve_dictionary_log_file:="/var/log/vuls/go_cve_dictionary.log"} : ${go_cve_dictionary_args:=""} pidfile=/var/run/go_cve_dictionary.pid command="/usr/sbin/daemon" procname="%%PREFIX%%/bin/%%PORTNAME%%" command_args="-p ${pidfile} /usr/bin/env ${procname} server \ -dbpath=${go_cve_dictionary_db_path} \ -dbtype=${go_cve_dictionary_db_type} \ ${go_cve_dictionary_args} >> ${go_cve_dictionary_log_file} 2>&1" start_precmd=go_cve_dictionary_startprecmd go_cve_dictionary_startprecmd() { if [ ! -e ${pidfile} ]; then install -o ${go_cve_dictionary_user} -g ${go_cve_dictionary_group} \ -m 640 /dev/null ${pidfile}; fi if [ ! -f "${go_cve_dictionary_log_file}" ]; then install -o ${go_cve_dictionary_user} -g ${go_cve_dictionary_group} \ -m 640 /dev/null ${go_cve_dictionary_log_file}; fi } load_rc_config $name run_rc_command "$1"