blob: c2a96bf2eb68e4d9a08911492f44ae0dad469a95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
#
#
# PROVIDE: msconvd
# REQUIRE: DAEMON FILESYSTEMS
# KEYWORD: nojail shutdown
. /etc/rc.subr
name="msconvd"
desc="Mouse protocol conversion daemon"
command="/usr/sbin/${name}"
start_cmd="msconvd_start"
pidprefix="/var/run/msconvd"
load_rc_config $name
: ${msconvd_enable="NO"}
: ${msconvd_type="auto"}
# doesn't make sense to run in a svcj: nojail keyword
# XXX: How does msconvd communiacte with the kernel?
# XXX: Does the kernel prevent this communcation in jails?
msconvd_svcj="NO"
# Set the pid file and variable name. The second argument, if it exists, is
# expected to be the mouse device.
#
if [ -n "$2" ]; then
eval msconvd_$2_enable=\${msconvd_$2_enable-${msconvd_enable}}
rcvar="msconvd_$2_enable"
pidfile="${pidprefix}.$2.pid"
else
for ms in ${msconvd_ports}; do
/etc/rc.d/msconvd $1 ${ms}
done
exit 0
fi
msconvd_start()
{
local ms myflags myport mytype
# Set the mouse device and get any related variables. If
# a msconvd device has been specified on the commandline, then
# rc.conf(5) variables defined for that device take precedence
# over the generic msconvd_* variables. The only exception is
# the msconvd_port variable, which if not defined sets it to
# the passed in device name.
#
ms=$1
eval myflags=\${msconvd_${ms}_flags-$msconvd_flags}
eval myport=\${msconvd_${ms}_port-/dev/${ms}}
eval mytype=\${msconvd_${ms}_type-$msconvd_type}
startmsg -n "Starting ${ms} ${name}"
${command} ${myflags} -p ${myport} -t ${mytype} -I ${pidfile}
startmsg '.'
}
run_rc_command $*
|