summaryrefslogtreecommitdiff
path: root/system/mdevd/mdevd.initd
blob: 28c34b7968a3170ed5a3850cf30c4d54ecfe7ccb (plain) (blame)
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
#!/sbin/openrc-run
# Copyright 2019-2021 Adélie Linux

description="mdevd manages device permissions and symbolic links in /dev"
extra_started_commands="reload"
description_reload="Reload the mdevd configuration file"

depend()
{
	use modloop
	need sysfs dev-mount
	before checkfs fsck
	keyword -lxc -systemd-nspawn -vserver
	provide dev
}

stop()
{
	ebegin "Stopping mdevd"
	touch /run/service/mdevd/down
	s6-svc -d /run/service/mdevd
	eend $?
}

start()
{
	ebegin "Starting mdevd"
	rm -f /run/service/mdevd/down
	s6-svc -uwU /run/service/mdevd
	eend $?
	ebegin "Coldplugging devices"
	mdevd-coldplug
	eend $?
}

reload()
{
	ebegin "Reloading mdevd config file"
	s6-svc -h /run/service/mdevd
	eend $?
}