Tag Archives: error

Fix bug: Fedora 17 does not shutdown. Kernel Panic.

If you upgraded from Fedora 16 to Fedora 17, you may get an error when shutting down the system.

This happens because the kernel is the same, and grub2.cfg does not get the Fedora 17 kernel, but it is installed, although not recognized.

To fix this just run the following command:

# grub2-mkconfig > /etc/grub2.cfg && grub2-install /dev/sda

Notice that you should change /dev/sda for your partition

This will generate a new grub2.cfg with the new Fedora 17 kernel.

Configuring BIND9 Master / Slave on Ubuntu.

I know it is strange to set up this type of configuration on an Ubuntu Desktop, but we had to do it for Internet Services class, and it gave problems to me and most of my class.

I am going to use two virtual machines, both running Ubuntu Desktop. First step is installing bind9.

# apt -get install bind9

The test domain will be “etg.local”

  • Master dns:
    • IP:  192.168.7.1
    • name: dns1
  • Slave dns:
    • IP: 192.168.7.2
    • name: pc02 (with dns2 CNAME)

Be careful with using underscore on names.

MASTER

We are going to start by editing /etc/bind/named.conf.local, to define our zone. I am going to define just one zone. You may want to define also a reverse zone.

named.conf.local

named.conf.local

Notice that the “type” of this host is master, that is important. We also can see that I used absolute path to the file, because I did not specified any directory on the options.

Allow-transfer, allow-update and also-notify are allowing our slave dns to transfer the zone(s) file(s).

This is my zone file:

Zone file

Zone file

 

We must pay attention to thenames to be fully qualified if they include domain name, and both servers must be declared with NS register.

Finally we configure our DNS, this is my configuration file /etc/resolv.conf

/etc/resolv.con

/etc/resolv.conf

SLAVE

Here comes the tricky part, at least with Ubuntu Desktop.

First, we configure /etc/resolv.conf to be equally as in master. Search parameter must be “etg.local” and nameserver “127.0.0.1″

Now, we declare our zone, pay attention:

Zone declaration on slave

Zone declaration on slave

As you may see, we declared the type of this server as slave, and we set who is its master(s).

Now it should replicate our zone from master server, but it won’t until we do a couple more of steps to avoid errors of writing permission.

We have to edit the file /etc/apparmor.d/usr.sbin.named

Default usr.sbin.named

Default usr.sbin.named

We have to find the line highlighted in red.

r stands for read, read permission. So we can deduce that it does not have permission to write the zone, that is the because it gives us permission errors.

We change that line to this:

Modified usr.sbin.named

Modified usr.sbin.named

And the last step is giving all permissions to the the bind group in the bind folder:

# chmod -R 775 /etc/bind

Now we restart first the bind server of the master and then the slave with:

# /etc/init.d/bind9 restart

Then if we want to check the log file to see if everything went fine (slave):

# tail -f /var/log/syslog
Syslog

Syslog

I highlighted some important messages. It tells us that the zone transfer went fine. Now we finally take a look to our recently replicated zone file.

Note: In the next screenshot you will se that the serial is 2. You can transfer with serial, I just added another register (see www) to show you that it really works

Replicated zone

Replicated zone

 

And that’s all, it should work now.

Encontrar fallos e inconsistencias en los ficheros passwd y shadow

Con el comando pwck podremos verificar que la información existente en /etc/passwd y en /etc/shadow  es correcta. Para poder ejecutarlo debemos ser root.

Este comando verifica la integridad de los usuarios y la información de autenticación. Comprueba que todas las entradas en /etc/passwd y /etc/shadow tengan el formato apropiado y los datos sean válidos. Se preguntará al usuario si desea borrar las entradas que tienen un formato incorrecto o las que tengan errores incorregibles.

Comprueba que cada entrada tenga:

    • El número correcto de campos
    • Un nombre de usuario válido y único
    • Identificador de grupo único y válido
    • Un grupo primario único
    • Un directorio home válido
    • Una shell válida

Con respecto a /etc/shadow las comprobaciones son las siguientes:

    • Cada entrada en /etc/passwd tiene su correspondiente en /etc/shadow, y viceversa
    • Las contraseñas están especificadas en el archivo
    • Tienen el número correcto de campos
    • Son únicas
Tiene los siguientes parámetros:
    • -q: Reportar sólo errores. No se mostrarán los warning.
    • -s: Ordenar por UID.

Nos dirigimos a la terminal y ejecutamos el comando:

# pwck

La salida en mi caso es esta:

user 'lp': directory '/var/spool/lpd' does not exist
user 'news': directory '/var/spool/news' does not exist
user 'uucp': directory '/var/spool/uucp' does not exist
user 'list': directory '/var/list' does not exist
user 'irc': directory '/var/run/ircd' does not exist
user 'gnats': directory '/var/lib/gnats' does not exist
user 'nobody': directory '/nonexistent' does not exist
user 'syslog': directory '/home/syslog' does not exist
user 'usbmux': directory '/home/usbmux' does not exist
user 'speech-dispatcher': directory '/var/run/speech-dispatcher' does not exist
user 'pulse': directory '/var/run/pulse' does not exist
user 'hplip': directory '/var/run/hplip' does not exist
user 'saned': directory '/home/saned' does not exist
user 'haldaemon': directory '/var/run/hald' does not exist
user 'mysql': directory '/nonexistent' does not exist
pwck: no changes

Via | rm-rf.es

PHP Deprecated: Comments starting with ‘#’ are deprecated

Si estáis tratando de ejecutar algún script php desde la terminal de linux o crontab, y os sale algún error como este:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0

Debemos ir al archivo o archivos (en algunos foros los usuarios comentaban que podían ser varios) y hacer los siguientes cambios:

Contenido de ming.ini inicial:

# configuration for php MING module
extension=ming.so

Como vemos, el comentario se hace con “#”, lo que ya está en desuso, pues la solución es tan simple como cambiar ‘#’ por ‘//’ que es como se hacen los comentarios en php.

//configuration for php MING module
extension=ming.so

Una vez hecho esto, debería funcionar correctamente.

Programa devuelve “Error en el bus”

A mi me ha pasado, que tras un reinicio forzado, al ejecutar de nuevo Pidgin, rhythmbox y el Centro de Software, no se me ejecutaban

El motivo era porque al iniciarse, daban un error en el bus. Esto puede deberse a que algunas librerías hayan quedado corruptas.

Para solucionarlo podemos utilizar debsums:

sudo apt-get install debsums

Chequeamos las librerías así:

sudo debsums -s &> /tmp/debsums.txt

Ahora para no tener que estar instalando todas las librerías una a una, generamos un archivo con las librerías dañadas:

sudo cat /tmp/debsums.txt | grep “mismatch”  | cut -d ” ” -f4 | uniq  > debsums_reinstall.txt

Y finalmente:

apt-get install –reinstall `(cat debsums_reinstall.txt)`

Vía: Glug.es

Grub: Invalid Signature. Error arrancando Windows

Hoy he vuelto a instalar Windows en una pequeña partición. Como siempre que tienes instalado Linux antes, Windows machaca el grub. Así que hice el proceso de recuperación del grub.

Pero a mi sorpresa el grub al arrancar Windows me daba un error que nunca antes me había dado: Invalid Signature.

Así que decidido, fui a editar /boot/grub/menu.lst y tachán! No está. No recordaba que Ubuntu 9.10 utiliza Grub2 y ese archivo ya no existe, ahora en su lugar nos encontramos con /boot/grub/grub.cfg. Lo que hace “especial” a este archivo esque es exclusivamente de lectura, y bajo ningún concepto se puede editar, ni siquiera desde un Live CD.

Yo tengo los SS.OO en el segundo disco duro (/dev/sdb), así que comprobé el siguiente archivo: /boot/grub/device.map

Y aquí estaba el error en mi caso. El archivo apuntaba a /dev/sda, así que lo edité por /dev/sdb y guardé los cambios y después actualicé el grub:

sudo os-prober

sudo update-grub

sudo reboot

Con eso conseguí arreglarlo todo y ahora funciona perfectamente, de momento ;) .