Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa stopiranjem named-a

[es] :: Linux aplikacije :: Problem sa stopiranjem named-a

[ Pregleda: 2076 | Odgovora: 7 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Elza

Član broj: 14016
Poruke: 391
*.tel.net.ba.



Profil

icon Problem sa stopiranjem named-a12.05.2009. u 12:07 - pre 148 meseci
Imam bind-9.5.1 na RHEL5 i problem je što ga ne mogu oborit sa skriptom za restartanje:

#!/bin/sh
#
# 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: true

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/local/sbin/named ] || exit 0

[ -f /chroot/named/etc/named.conf ] || exit 0

# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting named: "
daemon /usr/local/sbin/named -u named -t /chroot/named -c
/etc/named.conf
echo
touch /var/lock/subsys/named
;;
stop)
# Stop daemons.
echo -n "Shutting down named: "
killproc named
rm -f /var/lock/subsys/named
echo
;;
status)
status named
exit $?
;;
restart)
$0 stop
$0 start
exit $?
;;
reload)
/usr/local/sbin/rndc reload
exit $?
;;
probe)
# named knows how to reload intelligently; we don't want linuxconf
# to offer to restart every time
/usr/local/sbin/rndc reload >/dev/null 2>&1 || echo start
exit 0
;;

*)
echo "Usage: named {start|stop|status|restart|reload}"
exit 1
esac

exit 0


Kad se named digne sa /etc/init.d/named start u direktoriju /var/lock/subsys formira se fajl named i on je kao dignut,postoji i named.pid ispod /chroot/named/var/run

ali kad idem /etc/init.d/named status imam sljedeće
named dead but subsys locked

Kad obaram named sa /etc/init.d/named stop rezultat je failed , a u direktoriju /var/lock/subsys nestane ovaj fajl named
ali named.pid ostaje netaknut,
očito ovaj killproc ne zna gdje je named.pid??
rndc reload inače bez problema radi



 
Odgovor na temu

Elza

Član broj: 14016
Poruke: 391
*.tel.net.ba.



Profil

icon Re: Problem sa stopiranjem named-a12.05.2009. u 12:26 - pre 148 meseci
Problem riješen tako što sam u skriptu za restartanje named-a natjerala killproc da makne named.pid

Sada ovako izgleda skriptica named

#!/bin/sh
#
# 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: true

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/local/sbin/named ] || exit 0

[ -f /chroot/named/etc/named.conf ] || exit 0

# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting named: "
daemon /usr/local/sbin/named -u named -t /chroot/named -c /etc/named.conf
echo
touch /var/lock/subsys/named
;;
stop)
# Stop daemons.
echo -n "Shutting down named: "
killproc -p /chroot/named/var/run/named.pid named
rm -f /var/lock/subsys/named
echo
;;
status)
status named
exit $?
;;
restart)
$0 stop
$0 start
exit $?
;;
reload)
/usr/local/sbin/rndc reload
exit $?
;;
probe)
# named knows how to reload intelligently; we don't want linuxconf
# to offer to restart every time
/usr/local/sbin/rndc reload >/dev/null 2>&1 || echo start
exit 0
;;

*)
echo "Usage: named {start|stop|status|restart|reload}"
exit 1
esac

exit 0


Dakle, umjesto killproc named stavila sam killproc -p /chroot/named/var/run/named.pid named

Bez problema ide /etc/init.d/named stop i /etc/init.d/named start

ali još /etc/init.d/named status ostaje named dead but subsys locked , mada u procesima ne vidim nikakovu grešku.


 
Odgovor na temu

nemysis

Član broj: 2273
Poruke: 729
*.blutmagie.de.

Jabber: nemysis)ata(deshalbfrei)dota(org
Sajt: https://duckduckgo.com


+4 Profil

icon Re: Problem sa stopiranjem named-a12.05.2009. u 20:33 - pre 148 meseci
Probaj da grubo prekineš proces sa

killall--verbose named

Pa javi kako ti izgleda posle.
 
Odgovor na temu

Elza

Član broj: 14016
Poruke: 391
*.tel.net.ba.



Profil

icon Re: Problem sa stopiranjem named-a13.05.2009. u 07:07 - pre 148 meseci
Evo uradila sam

killall--verbose named

/etc/init.d/named start --digne se ok ali
/etc/init.d/named status
named dead but subsys locked

umjesto da javlja
named (pid brojpida) is running...

e sad znači problem je da općenito u ovoj skrpiti named ne radi status i ne radi killproc dok se ne navede prava putanja za pid, znači problem je kao da se ne zna za ovo okružje chroot

Čak sam u /etc/sysconfig/named stavila ROOTDIR=/chroot/named ali ništa

Možda to ima veze s RHEL5, jer nisam imala prije RHEL5 ali ni ovakav problem :-(
 
Odgovor na temu

nemysis

Član broj: 2273
Poruke: 729
*.com.

Jabber: nemysis)ata(deshalbfrei)dota(org
Sajt: https://duckduckgo.com


+4 Profil

icon Re: Problem sa stopiranjem named-a13.05.2009. u 12:08 - pre 148 meseci
Probaj da ponovo instališeš taj paket named, ali prvo obnovi bazu paketa.

Kako to ide u RHEL ne znam, jer ga nikad nisam probao.

Verovatno kao što kažeš ta skripta ne valja.


Probaj ovo posle to ti kazuje šta sve taj program treba da bi radio.

ldd /gde-se-nalazi/traženi_program

Izvršna fajla tog programa

Pokazaće Vam šta je od potrebnih biblioteka instalisano i šta nedostaje.

Ono što nedostaje instališite ili linkujte kako se traži i onda ćete moći traženi program koristiti.


Pokušaj i ovo to je isto dobro da se nađu greške.

Ako hoćete da znate zašto se neki program ne može koristiti i gde je greška, probajte

gdb /usr/bin/neki-program

(gdb) start

Tu ćete očitati koja je greška.


Pošto ti radiš u chroot-u moraš sve što ti javlja "ldd" da kopiraš u chroot,
na odgovarajuće mesto, isto kao i da je u normalnom okruženju, da bi named našao svoje fajle.

 
Odgovor na temu

Elza

Član broj: 14016
Poruke: 391
*.tel.net.ba.



Profil

icon Re: Problem sa stopiranjem named-a13.05.2009. u 13:08 - pre 148 meseci
Ovako, prije sam imala RHEL3 i bind -9.5.1
ldd izbacuje



ldd /usr/local/sbin/named
libcap.so.1 => /lib/libcap.so.1 (0x00734000)
libnsl.so.1 => /lib/libnsl.so.1 (0x002d8000)
libc.so.6 => /lib/tls/libc.so.6 (0x00858000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00d09000)

Ista je verzija bind-9.5.1 i skripta named je ista i radi bez ikakvih problema


Na ovom stroju sa RHEL5 i isti bind-9.5.1
ldd /usr/local/sbin/named
libcap.so.1 => /lib64/libcap.so.1 (0x000000320ac00000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003209400000)
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x000000320cc00000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003207000000)
libm.so.6 => /lib64/libm.so.6 (0x0000003206400000)
libc.so.6 => /lib64/libc.so.6 (0x0000003206000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003206800000)
/lib64/ld-linux-x86-64.so.2 (0x0000003205c00000)

Što znači oaj zadnji redak /lib64/ld-linux-x86-64.so.2 (0x0000003205c00000) jel ovo nedostaje ili??

 
Odgovor na temu

Elza

Član broj: 14016
Poruke: 391
*.tel.net.ba.



Profil

icon Re: Problem sa stopiranjem named-a13.05.2009. u 13:23 - pre 148 meseci
E sad pokrenula sam

gdb /etc/init.d/named
GNU gdb Fedora (6.8-27.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
"/etc/rc.d/init.d/named": not in executable format: File format not recognized
(gdb) start
No symbol table loaded. Use the "file" command.

Ne znam jesam li trebala pokrenuti ovu skriptu za dizanje ili


gdb /usr/local/sbin/named
 
Odgovor na temu

nemysis

Član broj: 2273
Poruke: 729
*.propsychology.cz.

Jabber: nemysis)ata(deshalbfrei)dota(org
Sajt: https://duckduckgo.com


+4 Profil

icon Re: Problem sa stopiranjem named-a13.05.2009. u 14:58 - pre 148 meseci
gdb se koristi samo za izvršne programe to jest koji koriste biblioteke.

Trebala si da koristiš, tačno si primetila

gdb /usr/local/sbin/named


Vidim da si ručno napravila named pošto je u /usr/local/sbin.

Dakle sve što ti ldd javlja i konfiguracije prekopiraj u chrot

/usr/local/sbin/named
libcap.so.1 => /lib64/libcap.so.1 (0x000000320ac00000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003209400000)
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x000000320cc00000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003207000000)
libm.so.6 => /lib64/libm.so.6 (0x0000003206400000)
libc.so.6 => /lib64/libc.so.6 (0x0000003206000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003206800000)
/lib64/ld-linux-x86-64.so.2 (0x0000003205c00000)

da bude pre svega /chroot ispred, na primer u RHEL5

/chroot/usr/local/sbin/named
/chroot/lib64/libcap.so.1
/chroot/lib64/libnsl.so.1
/chroot/usr/lib64/libxml2.so.2
/chroot/usr/lib64/libz.so.1
/chroot/lib64/libm.so.6
/chroot/lib64/libc.so.6
/chroot/lib64/libdl.so.2
/chroot/lib64/ld-linux-x86-64.so.2

Koliko ja znam sve što ti dotični program treba da bi radio u Chroot-u,
je da on vidi sve svoje fajle, pošto je Chroot odvojen od normalnog Linux-a,
većinom zbog sigurnosti.

Kad to uradiš onda probaj u Chroot-u

ldd /chroot/usr/local/sbin/named

i vidi gde su sad njegove fajle, to jest da li ih uopšte vidi.

Koliko vidim ti na RHEL 3 imaš 32 bitni sistem a na RHEL 5 64 bitni sistem,
zato je verovatno ta razlika da na RHEL 3 nemaš /lib64/ld-linux-x86-64.so.2.

Na RHEL 3 radi a na RHEL 5 ne radi a sve je isto, to mi je malo čudno.

Izvini ali to meni liči na tipičan RedHat problem, zato ga ja nikad nisam ni koristio.

 
Odgovor na temu

[es] :: Linux aplikacije :: Problem sa stopiranjem named-a

[ Pregleda: 2076 | Odgovora: 7 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.