aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mdevd/mdevd.initd
blob: a9feeea154391aba29a17b55fd3aa32dd357e40f (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
#!/sbin/openrc-run

extra_started_commands="reload"
description="A netlink-listening device manager similar to mdev"
description_reload="Reload the configuration file"

: ${cfgfile:="/etc/mdev.conf"}
: ${logfile:="/var/log/$RC_SVCNAME.log"}

pidfile="/run/$RC_SVCNAME.pid"
required_files="$cfgfile"

command="/bin/mdevd"
command_args="-f $cfgfile ${command_args:-}"
command_background="yes"
start_stop_daemon_args="--stdout $logfile --stderr $logfile"

depend() {
	provide dev
	need sysfs dev-mount
	before checkfs fsck
	keyword -containers -lxc -vserver
}

start_pre() {
	mkdir -p /dev
}

reload() {
	ebegin "Reloading $name configuration"
	start-stop-daemon --signal HUP --pidfile "$pidfile"
	eend $?
}