James-TR / powerdns.overlay-abadoned-use-layman-jamestr

Gentoo PowerDNS Overlay
1 stars 0 forks source link

pdnscontrol ebuilds #1

Open piwats opened 10 years ago

piwats commented 10 years ago

Hello James,

would it be possible to create ebuilds for pdnscontrol? https://github.com/PowerDNS/pdnscontrol

As far as I can see, some init scripts provided for debian need to be rewritten for openrc, maybe systemd....

I would also like to contribute to this as I am trying to get pdnscontrol running under gentoo right now.

Thanks, -Paul

James-TR commented 10 years ago

Would be lovely :) :+1: Looking at getting this overlay moved to the powerdns github org, then getting it added to layman

piwats commented 10 years ago

At the moment, I have problems getting pdnscontrol running under gentoo. The documentation of pdnscontrol is a bit "sparse".

I have made some init scripts for pdnsmgr and pdns2graphite (I used the unbound init script as a starting point), at least I think so - I am unfortunately no developer - more an advanced user.

At least I am very willing to test this, having my own 3 dns servers to play with.

James-TR commented 10 years ago

Let me know when you have something working and I'll be happy to merge it. Just updated the pdns ebuild to 3.4.1, too.

piwats commented 10 years ago

This is what I have so far:

/etc/ini.d/pdns2graphite

#!/sbin/runscript

name="pdns2graphite daemon"
description="PowerDNS pdnscontrol pdns2graphite daemon"

PDNS2GRAPHITE_BINARY=${PDNS2GRAPHITE_BINARY:-/usr/sbin/pdnsmgrd}
PDNS2GRAPHITE_CONFFILE=${PDNS2GRAPHITE_CONFFILE:-/etc/powerdns/${SVCNAME}.conf}
PDNS2GRAPHITE_CONFDIR=${PDNS2GRAPHITE_CONFDIR:-/etc/powerdns}

depend() {
    need carbon-cache
    #use logger
    after pdns
}

start() {
    ebegin "Starting ${SVCNAME}"
    start-stop-daemon --start --pidfile "${PDNS2GRAPHITE_PIDFILE}" \
        --exec "${PDNS2GRAPHITE_BINARY}" -- "${PDNS2GRAPHITE_CONFFILE}"
    eend $?
}

stop() {
    ebegin "Stopping ${SVCNAME}"
    start-stop-daemon --stop --pidfile "${PDNS2GRAPHITE_PIDFILE}"
    eend $?
}

/etc/init.d/pdnsmgrd:

#!/sbin/runscript

name="pdnsmgrd daemon"
description="PowerDNS pdnscontrol pdnsmgrd daemon"

PDNSMGRD_BINARY=${PDNSMGRD_BINARY:-/usr/sbin/pdnsmgrd}
PDNSMGRD_CONFFILE=${PDNSMGRD_CONFFILE:-/etc/powerdns/${SVCNAME}.conf}
PDNSMGRD_CONFDIR=${PDNSMGRD_CONFDIR:-/etc/powerdns}

depend() {
    need net
    #use logger
    after pdns
}

start() {
    ebegin "Starting ${SVCNAME}"
    start-stop-daemon --start --pidfile "${PDNSMGRD_PIDFILE}" \
        --exec "${PDNSMGRD_BINARY}" -- --config-dir "${PDNSMGRD_CONFDIR}"
    eend $?
}

stop() {
    ebegin "Stopping ${SVCNAME}"
    start-stop-daemon --stop --pidfile "${PDNSMGRD_PIDFILE}"
    eend $?
}

As you can see, they are much the same. But they get the programs running....

piwats commented 9 years ago

Hey ;)

I've managed to get pdnsmgrd running on gentoo. This init script should do it:

#!/sbin/runscript

name="pdnsmgrd daemon"
description="PowerDNS pdnscontrol pdnsmgrd daemon"

PDNSMGRD_BINARY=${PDNSMGRD_BINARY:-/usr/sbin/pdnsmgrd}
PDNSMGRD_CONFFILE=${PDNSMGRD_CONFFILE:-/etc/powerdns/${SVCNAME}.conf}
PDNSMGRD_CONFDIR=${PDNSMGRD_CONFDIR:-/etc/powerdns}
PDNSMGRD_PIDFILE=${PDNSMGRD_PIDFILE:-/run/pdnsmgrd.pid}

depend() {
        need net
        use logger
        after pdns
}

start() {
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --background --make-pidfile --pidfile "${PDNSMGRD_PIDFILE}" \
                --exec "${PDNSMGRD_BINARY}" -- --config-dir "${PDNSMGRD_CONFDIR}"
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --pidfile "${PDNSMGRD_PIDFILE}"
        eend $?
}

At least I get pdnsmgrd to run...

-Paul

James-TR commented 9 years ago

Thanks! I'll get a working ebuild put together :)

piwats commented 9 years ago

Hey, thanks :)

Unfortunately pdnscontrol won't work, if its a pdns-3.4.1 because pdnscontrol does not yet support the new apikey.

James-TR commented 9 years ago

PowerDNS/pdnscontrol@0c04f54f0781a2e3fc937b11d1e938b0c284e0f2 should do what we want.

Just need to proxy via pdnsmgrd