Mageia Bugzilla – Attachment 248 Details for
Bug 871
service named start fails with "initializing DST: openssl failure".
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
named init script
named (text/plain), 3.39 KB, created by
Dave Hodgins
on 2011-04-19 19:24:54 CEST
(
hide
)
Description:
named init script
Filename:
MIME Type:
Creator:
Dave Hodgins
Created:
2011-04-19 19:24:54 CEST
Size:
3.39 KB
patch
obsolete
>#!/bin/bash ># ># named This shell script takes care of starting and stopping ># named (BIND DNS server). ># ># chkconfig: 345 55 45 ># description: named (BIND) is a Domain Name Server (DNS) \ ># that is used to resolve host names to IP addresses. ># probe: false > ># Comments to support LSB init script conventions >### BEGIN INIT INFO ># Provides: $named ># Required-Start: $network ># Required-Stop: $network ># Should-Start: mysqld postgresql ldap ># Should-Stop: mysqld postgresql ldap ># Default-Start: 3 4 5 ># Default-Stop: 0 1 6 ># Short-Description: start and stop BIND ># Description: named (BIND) is a Domain Name Server (DNS). >### END INIT INFO > ># Source function library. >. /etc/rc.d/init.d/functions > ># Source networking configuration. >[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network > >RETVAL=0 >prog="named" > ># Check that networking is up. >[ "${NETWORKING}" = "no" ] && exit 0 > >[ -f /etc/sysconfig/named ] && . /etc/sysconfig/named > >[ -f /usr/sbin/named ] || exit 0 > >[ -f /var/lib/named/etc/named.conf ] || exit 0 > >start() { > # Start daemons. > if [ -n "`/sbin/pidof named`" ]; then > gprintf "$prog: already running" > echo > return 1 > fi > gprintf "Starting %s: " $prog > > # prepare the chroot if needed > [ -e /var/lib/named/dev/null ] || mknod -m 0666 /var/lib/named/dev/null c 1 3 > [ -e /var/lib/named/dev/random ] || mknod -m 0666 /var/lib/named/dev/random c 1 8 > [ -e /var/lib/named/dev/urandom ] || mknod -m 0666 /var/lib/named/dev/urandom c 1 8 > > # better always copy localtime so it respects the system's timezone > install -m 0644 -o root -g root /etc/localtime /var/lib/named/etc/ > > # libgost.so needs to be in the chroot, so copy it there > for LIBGOST in /usr/lib*/openssl*/engines/libgost.so ; do > # copy everytime as we need to make sure everything is in sync > cp -f --parents "$LIBGOST" /var/lib/named/ > done > > > [ -d /var/lib/named/proc ] || mkdir -p /var/lib/named/proc > if ! egrep -q '^/proc[[:space:]]+'/var/lib/named'/proc' /proc/mounts; then > mount --bind /proc /var/lib/named/proc -o ro >/dev/null 2>&1 > fi > > daemon named -u named -t /var/lib/named ${OPTIONS} > RETVAL=$? > [ $RETVAL -eq 0 ] && touch /var/lock/subsys/named > echo > return $RETVAL >} >stop() { > # Stop daemons. > gprintf "Stopping %s: " $prog > /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf stop "$1" > RETVAL=$? > [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named || { > killproc named > RETVAL=$? > [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named > echo > return $RETVAL > } > > if egrep -q '^/proc[[:space:]]+'/var/lib/named'/proc' /proc/mounts; then > umount /var/lib/named/proc >/dev/null 2>&1 > fi > > success > echo > return $RETVAL >} >status() { > /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf status > return $? >} >restart() { > stop > # wait a couple of seconds for the named to finish closing down > sleep 2 > start >} >reload() { > /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf reload "$1" >/dev/null 2>&1 || /usr/bin/killall -HUP named > return $? >} > ># See how we were called. >case "$1" in > start) > start > ;; > stop) > stop "$2" > ;; > status) > status > ;; > restart) > restart > ;; > condrestart) > [ -f /var/lock/subsys/named ] && restart > ;; > reload) > reload "$2" > ;; > *) > gprintf "Usage: %s {start|stop|status|restart|condrestart|reload|probe}\n" $0 > exit 1 >esac
#!/bin/bash # # named This shell script takes care of starting and stopping # named (BIND DNS server). # # chkconfig: 345 55 45 # description: named (BIND) is a Domain Name Server (DNS) \ # that is used to resolve host names to IP addresses. # probe: false # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: $named # Required-Start: $network # Required-Stop: $network # Should-Start: mysqld postgresql ldap # Should-Stop: mysqld postgresql ldap # Default-Start: 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop BIND # Description: named (BIND) is a Domain Name Server (DNS). ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network RETVAL=0 prog="named" # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /etc/sysconfig/named ] && . /etc/sysconfig/named [ -f /usr/sbin/named ] || exit 0 [ -f /var/lib/named/etc/named.conf ] || exit 0 start() { # Start daemons. if [ -n "`/sbin/pidof named`" ]; then gprintf "$prog: already running" echo return 1 fi gprintf "Starting %s: " $prog # prepare the chroot if needed [ -e /var/lib/named/dev/null ] || mknod -m 0666 /var/lib/named/dev/null c 1 3 [ -e /var/lib/named/dev/random ] || mknod -m 0666 /var/lib/named/dev/random c 1 8 [ -e /var/lib/named/dev/urandom ] || mknod -m 0666 /var/lib/named/dev/urandom c 1 8 # better always copy localtime so it respects the system's timezone install -m 0644 -o root -g root /etc/localtime /var/lib/named/etc/ # libgost.so needs to be in the chroot, so copy it there for LIBGOST in /usr/lib*/openssl*/engines/libgost.so ; do # copy everytime as we need to make sure everything is in sync cp -f --parents "$LIBGOST" /var/lib/named/ done [ -d /var/lib/named/proc ] || mkdir -p /var/lib/named/proc if ! egrep -q '^/proc[[:space:]]+'/var/lib/named'/proc' /proc/mounts; then mount --bind /proc /var/lib/named/proc -o ro >/dev/null 2>&1 fi daemon named -u named -t /var/lib/named ${OPTIONS} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/named echo return $RETVAL } stop() { # Stop daemons. gprintf "Stopping %s: " $prog /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf stop "$1" RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named || { killproc named RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named echo return $RETVAL } if egrep -q '^/proc[[:space:]]+'/var/lib/named'/proc' /proc/mounts; then umount /var/lib/named/proc >/dev/null 2>&1 fi success echo return $RETVAL } status() { /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf status return $? } restart() { stop # wait a couple of seconds for the named to finish closing down sleep 2 start } reload() { /usr/sbin/rndc -c /var/lib/named/etc/rndc.conf reload "$1" >/dev/null 2>&1 || /usr/bin/killall -HUP named return $? } # See how we were called. case "$1" in start) start ;; stop) stop "$2" ;; status) status ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/named ] && restart ;; reload) reload "$2" ;; *) gprintf "Usage: %s {start|stop|status|restart|condrestart|reload|probe}\n" $0 exit 1 esac
View Attachment As Raw
Actions:
View
Attachments on
bug 871
:
242
| 248 |
256
|
257
|
258
|
259
|
260
|
303
|
326