]> Pileus Git - ~andy/sunrise/blobdiff - net-dns/nsd/files/nsd.initd
media-video/ucview: fix metadata.xml
[~andy/sunrise] / net-dns / nsd / files / nsd.initd
index c9c687fb14de651edf47d4df81e9f63a5be04292..1325420aa7dc82871279ffa8380c2952cdf288a7 100644 (file)
@@ -6,6 +6,7 @@
 extra_commands="rebuild"
 extra_started_commands="reload"
 description="NSD is an authoritative only, high performance, open source name server"
+description_rebuild="Rebuild zone database"
 description_reload="Rebuild zone database and reload it"
 
 config_file=${config_file:-/etc/nsd/nsd.conf}
@@ -36,7 +37,7 @@ _checkdb() {
        local database=$(${my_nsd_checkconf} -o database ${config_file})
        if ! test -f $database; then
                eerror "You have no database file in ${database}, will try to rebuild"
-               _rebuild
+               rebuild
        fi
        return 0
 }
@@ -61,8 +62,12 @@ rebuild() {
 
 start() { 
        ebegin "Starting NSD"
+
+       local pidfile=$(${my_nsd_checkconf} -o pidfile ${config_file})
+       checkpath -d -o nsd:nsd $(dirname ${pidfile})
+
        _checkconf || return 1
-       _checkdb || rebuild || return 1
+       _checkdb || return 1
        ${my_nsdc} start
        ${my_nsdc} running
        eend $?