aboutsummaryrefslogblamecommitdiffstats
path: root/community/namecoin/namecoin.initd
blob: a347a84f764d0384849cec47aeeffd9ea651b7c0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                  









                                        
                               

























                                                                                               
#!/sbin/openrc-run

# Namecoin init.d file for Alpine Linux.

name=namecoind
daemon=/usr/bin/$name
config=/etc/namecoin.conf
user=namecoin
group=namecoin
## supercedes datadir set in $config ##
datadir=/var/lib/namecoin
pidfile=/run/namecoin/$name.pid

depend() {
        need net
        after logger firewall
}

start() {
        ebegin "Starting ${name}"
        # enforce permissions
	checkpath -q -d ${pidfile%/*} -o ${user}:${group}
        checkpath -q -d ${datadir} -m 0700 -o ${user}:${group}
        checkpath -q -f ${config} -m 0600 -o ${user}:${group}
	start-stop-daemon --start --quiet \
                        --pidfile ${pidfile} \
                        --user ${user}:${group} \
                        --exec ${daemon} -- -conf=${config} -datadir=${datadir} -pid=${pidfile}
        eend $?
}

stop() {
        ebegin "Stopping ${name}"
                start-stop-daemon --stop --quiet \
                        --pidfile ${pidfile} \
                        --exec ${daemon}
        eend $?
}