summarylogtreecommitdiffstats
path: root/nldev.early
blob: b4bb26bb2d3cce748aa8a1ade920f6bf9e2248c6 (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
#!/bin/bash

# sourcing our current rc.conf requires this to be a bash script
. /usr/lib/rc/functions

case "$1" in
    start)
        stat_busy "Starting nldev daemon"
        nldev -k &
        echo $! > /run/nldev.pid
        # Note: This is only needed for initialization, nldev will
        #       be controlled by runit on stage 2.
        add_daemon nldev
        stat_done nldev
        ;;
    stop)
        stat_busy "Stopping nldev"
        # check whether nldev might still be running.
        ! pgrep -f "nldev" >/dev/null 2>&1 || killall nldev || stat_die nldev
        rm_daemon nldev
        stat_done nldev
        ;;
    *)
        echo "usage: $0 {start|stop}"
        exit 1
        ;;
esac