blob: 14bbcd674e15aaa57ca4b6aeee1c47487c68dc57 (
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
|
#!/bin/sh
#
# $NetBSD: iscsid,v 1.3 2020/09/08 12:52:18 martin Exp $
#
# PROVIDE: iscsid
# REQUIRE: NETWORKING CRITLOCALMOUNTED
# BEFORE: securelevel mountcritremote
$_rc_subr_loaded . /etc/rc.subr
name="iscsid"
rcvar=$name
command="/sbin/${name}"
pidfile="/var/run/${name}.pid"
start_precmd="iscsid_precmd"
find_module()
{
local module rest
/sbin/modstat $1 | while read module rest; do
if [ "$module" = "$1" ]; then
echo found
break
fi
done
}
iscsid_precmd()
{
if [ "$(find_module iscsi)" != "found" ]; then
/sbin/modload iscsi
fi
}
load_rc_config $name
run_rc_command "$1"
|