#!/bin/sh

# $FreeBSD: head/x11/cde/files/dtspc.in 526065 2020-02-13 20:42:45Z 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"

load_rc_config $name

: ${dtspc_enable:=NO}

start_precmd="force_depend rpcbind || exit 1 && 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"
pidfile=/var/run/dtspc.pid
command=/usr/sbin/daemon
command_args="-P $pidfile /usr/local/dt/bin/dtspcd"

run_rc_command $1
