From 14359727fdba009a8e28c723d9a29629fac035f8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Mar 2015 09:24:56 +0000 Subject: [PATCH] add standard rc script for configd (/usr/local/etc/rc.d/configd) --- src/etc/rc.d/configd | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 src/etc/rc.d/configd diff --git a/src/etc/rc.d/configd b/src/etc/rc.d/configd new file mode 100755 index 000000000..26f69d53d --- /dev/null +++ b/src/etc/rc.d/configd @@ -0,0 +1,49 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: configd +# REQUIRE: LOGIN +# KEYWORD: shutdown +# + +# load standard rc +. /etc/rc.subr + +name=configd + +stop_precmd=configd_prestop +stop_postcmd=configd_poststop + +configd_load_rc_config() +{ + required_args="" + required_dirs="/usr/local/opnsense/service/" + required_files="" + command_args="${required_args}" + command=/usr/local/opnsense/service/configd.py + command_interpreter=/usr/local/bin/python2.7 +} + + +# kill configd +configd_prestop() +{ + kill -15 ${rc_pid} +} + +# cleanup after stopping configd +configd_poststop() +{ + if [ -f /var/run/configd.pid ]; then + rm /var/run/configd.pid + fi + if [ -f /var/run/configd.socket ]; then + rm /var/run/configd.socket + fi +} + + +load_rc_config $name +configd_load_rc_config +run_rc_command $1