#!/bin/sh

# $FreeBSD: branches/2018Q4/x11-wm/cde/files/dtspc.in 442032 2017-05-29 20:05:21Z crees $
#
# PROVIDE: dtspc
# REQUIRE: rpcbind
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable dtspc:
#
# dtspc_enable=YES

. /etc/rc.subr

name=dtspc
rcvar=dtspc_enable
desc="CDE Subprocess Control Service"
start_precmd="force_depend rpcbind || exit 1"

load_rc_config $name

: ${dtspc_enable:=NO}

command=/usr/sbin/daemon
pidfile=/var/run/dtspc.pid
command_args="-P $pidfile /usr/local/dt/bin/dtspcd"
start_precmd="ln -sf /usr/local/dt /usr/dt && ln -sf /usr/local/etc/dt /etc/dt"
stop_postcmd="[ -L /usr/dt -a -L /etc/dt ] && rm /usr/dt /etc/dt"

run_rc_command $1
