[RISOLTO] Bind9 e modulo Capability

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Vic Steele
Linux 3.x
Linux 3.x
Messaggi: 534
Iscritto il: dom 27 apr 2008, 13:46
Nome Cognome: Luigi Caiazza
Slackware: current x86_64
Kernel: 3.0.0
Desktop: Fluxbox / KDE 4.7.0
Distribuzione: Fedora 15
Località: Potenza
Contatta:

Re: Bind9 e modulo Capability

Messaggio da Vic Steele »

Ho in esecuzione il 2.6.26.5 ricompilato da me in questo momento, non il generic. Ho sbagliato a dirti prima che usavo quello, scusami.

Da una prima prova:

Codice: Seleziona tutto

bash-3.1# sh /etc/rc.d/rc.bind.new start
Starting BIND:  /usr/sbin/named
WARNING:  named did not start.
Attempting to start named again:  /usr/sbin/named
FAILED:  Sorry, a second attempt to start named has also failed.
There may be a configuration error that needs fixing.  Good luck!
Perchè?

Avatar utente
conraid
Staff
Staff
Messaggi: 13631
Iscritto il: gio 14 lug 2005, 0:00
Nome Cognome: Corrado Franco
Slackware: current64
Desktop: kde
Località: Livorno
Contatta:

Re: Bind9 e modulo Capability

Messaggio da conraid »

Vic Steele ha scritto: Perchè?
Come ti dice il file stesso
There may be a configuration error that needs fixing. Good luck!
Sistema tutta la dir rc.d prima e poi pensa a bind

Come è adesso il tuo file di configurazione di bind?

Vic Steele
Linux 3.x
Linux 3.x
Messaggi: 534
Iscritto il: dom 27 apr 2008, 13:46
Nome Cognome: Luigi Caiazza
Slackware: current x86_64
Kernel: 3.0.0
Desktop: Fluxbox / KDE 4.7.0
Distribuzione: Fedora 15
Località: Potenza
Contatta:

Re: Bind9 e modulo Capability

Messaggio da Vic Steele »

Codice: Seleziona tutto

bash-3.1# cat /etc/rc.d/rc.bind.new
#!/bin/sh
# Start/stop/restart the BIND name server daemon (named).

# Start bind.  In the past it was more secure to run BIND
# as a non-root user (for example, with '-u daemon'), but
# the modern version of BIND knows how to use the kernel's
# capability mechanism to drop all root privileges except
# the ability to bind() to a privileged port and set process
# resource limits, so -u should not be needed.  If you wish
# to use it anyway, chown the /var/run/named directory to
# the non-root user.
#

# You might also consider running BIND in a "chroot jail",
# a discussion of which may be found in
# /usr/doc/Linux-HOWTOs/Chroot-BIND-HOWTO.
 
# One last note:  rndc has a lot of other nice features that
# it is not within the scope of this start/stop/restart script
# to support.  For more details, see "man rndc" or just type
# "rndc" to see the options.


# Sanity check.  If either /usr/sbin/named or /etc/named.conf
# aren't ready, it doesn't make much sense to try to run this
# script:
if [ ! -x /usr/sbin/named ]; then
  echo "/etc/rc.d/rc.bind:  no /usr/sbin/named found (or not executable); cannot start."
  exit 1
elif [ ! -f /etc/named.conf ]; then
  echo "/etc/rc.d/rc.bind:  no /etc/named.conf found; cannot start /usr/sbin/named."
  exit 1
fi

# Start BIND.  As many times as you like.  ;-)
# Seriously, don't run "rc.bind start" if BIND is already
# running or you'll get more than one copy running.
bind_start() {
  if [ -x /usr/sbin/named ]; then
    echo "Starting BIND:  /usr/sbin/named"
    /usr/sbin/named
    sleep 1
  fi
  if ! ps axc | grep -q named ; then
    echo "WARNING:  named did not start."
    echo "Attempting to start named again:  /usr/sbin/named"
    /usr/sbin/named
    sleep 1
    if ps axc | grep -q named ; then
      echo "SUCCESS:  named started."
    else
      echo "FAILED:  Sorry, a second attempt to start named has also failed."
      echo "There may be a configuration error that needs fixing.  Good luck!"
    fi
  fi
}

# Stop all running copies of BIND (/usr/sbin/named):
bind_stop() {
  echo "Stopping BIND:  /usr/sbin/rndc stop"
  /usr/sbin/rndc stop
  # A problem with using "/usr/sbin/rndc stop" is that if you
  # managed to get multiple copies of named running it will
  # only stop one of them and then can't stop the others even
  # if you run it again.  So, after doing things the nice way
  # we'll do them the old-fashioned way.  If you don't like
  # it you can comment it out, but unless you have a lot of
  # other programs you run called "named" this is unlikely
  # to have any ill effects:
  sleep 1
  if ps axc | grep -q named ; then
    echo "Using "killall named" on additional BIND processes..."
    /bin/killall named 2> /dev/null
  fi
}

# Reload BIND:
bind_reload() {
  /usr/sbin/rndc reload
}

# Restart BIND:
bind_restart() {
  bind_stop
  bind_start
}

# Get BIND status:
bind_status() {
  /usr/sbin/rndc status
}

case "$1" in
'start')
  bind_start
  ;;
'stop')
  bind_stop
  ;;
'reload')
  bind_reload
  ;;
'restart')
  bind_restart
  ;;
'status')
  bind_status
  ;;
*)
  echo "usage $0 start|stop|reload|restart|status"
esac
A parte rinominare rc.bind.new in rc.bind, cos'altro devo sistemare?

Avatar utente
conraid
Staff
Staff
Messaggi: 13631
Iscritto il: gio 14 lug 2005, 0:00
Nome Cognome: Corrado Franco
Slackware: current64
Desktop: kde
Località: Livorno
Contatta:

Re: Bind9 e modulo Capability

Messaggio da conraid »

Vic Steele ha scritto: A parte rinominare rc.bind.new in rc.bind, cos'altro devo sistemare?
ehm... ma non avevi letto la guida?

il file di configurazione è /etc/named.conf non quello che hai postato tu.
E magari anche li hai un .new

Devi sistemare *tutti* i file .new

Leggi qualche guida, altrimenti ti ritroverai sempre nei casini

Quando vedi un file .new se prima non avevi modificato il vecchio file (per esempio rc.bind) allora semplicemente cancelli il vecchio e lo sostituisci con quello nuovo.
Se invece lo avevi modificato devi scegliere se mettere le tue modifiche in quello nuovo, o le modifiche di Pat in quello vecchio modificato.

naturalmente *non* toccare mai i file group, shadow, passwd

Leggi Slack4Dummies ed i miei documenti "come aggiornare dalla 12 alla 12.1" o "current for dummies" che trovi qui nel wiki, c'è una parte proprio sui file .new
Tra l'altro c'è anche nei documenti che trovi nel DVD/CD/FTP della Slackware stessa

Vic Steele
Linux 3.x
Linux 3.x
Messaggi: 534
Iscritto il: dom 27 apr 2008, 13:46
Nome Cognome: Luigi Caiazza
Slackware: current x86_64
Kernel: 3.0.0
Desktop: Fluxbox / KDE 4.7.0
Distribuzione: Fedora 15
Località: Potenza
Contatta:

Re: Bind9 e modulo Capability

Messaggio da Vic Steele »

Sei un grande.
Mi è bastato rinominare /etc/named.conf.new in /etc/named.conf e Bind è partito, con i DNS in locale.
Non avevo capito che ti riferissi a quel file.
Insomma, tutto questo casino per rinominare questi due file .new. Secondo me dovreste aggiungerlo nel Wiki.

Insomma, ti ringrazio ancora per la disponibilità e per la pazienza che hai avuto nei miei confronti.

Avatar utente
conraid
Staff
Staff
Messaggi: 13631
Iscritto il: gio 14 lug 2005, 0:00
Nome Cognome: Corrado Franco
Slackware: current64
Desktop: kde
Località: Livorno
Contatta:

Re: Bind9 e modulo Capability

Messaggio da conraid »

Vic Steele ha scritto: Insomma, tutto questo casino per rinominare questi due file .new. Secondo me dovreste aggiungerlo nel Wiki.
Fa parte dell'ABC dello slackwerista questo :-)

Vic Steele
Linux 3.x
Linux 3.x
Messaggi: 534
Iscritto il: dom 27 apr 2008, 13:46
Nome Cognome: Luigi Caiazza
Slackware: current x86_64
Kernel: 3.0.0
Desktop: Fluxbox / KDE 4.7.0
Distribuzione: Fedora 15
Località: Potenza
Contatta:

Re: [RISOLTO] Bind9 e modulo Capability

Messaggio da Vic Steele »

Eh vabbè, allora ho ancora molto da imparare :lol: .

Grazie ancora!

Rispondi