Author Topic: Unable to start DHCP  (Read 3349 times)

RedEagle

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Unable to start DHCP
« on: April 08, 2009, 12:48:41 am »
Hello everyone,

I manage a server which as been runing the DHCP module without any problems for quite some time now. Unfornatelly last weekend I had a problem with the server and was forced to restart it "by force". What happens is that since the restart of the server that I am unable to run the DHCP module.
On the ebox.log file I noticed that the DHCP module was trying to restart himself. Furthermore the process named "90manageEBoxLog" was using almost half the system memory, making the system quite slow. Being so I disabled the Event logging but this process is still running like hell.
Does someone know why I'm unable to start the DHCP module or how to make the "90manageEBoxLog" lighter instead of just killing it, which I don't now if it's even a safe thing to do?
The message I'm getting on the log is the following:

2009/04/07 22:55:12 INFO> Module.pm:135 EBox::Module::restartService - Restarting service for module: dhcp
2009/04/07 22:55:12 ERROR> Module.pm:233 EBox::Module::_lock - Could not get lock for module: dhcp
2009/04/07 22:56:13 ERROR> Sudo.pm:185 EBox::Sudo::_rootError - root command /usr/bin/test -f '/var/lib/ebox/conf/dhcp/eth0/firmware' failed.
Error output:
Command output: .
Exit value: 1
2009/04/07 22:56:15 ERROR> Sudo.pm:185 EBox::Sudo::_rootError - root command /usr/bin/test -f '/var/lib/ebox/conf/dhcp/vmnet8/firmware' failed.
Error output:
Command output: .
Exit value: 1
2009/04/07 22:56:23 ERROR> Module.pm:140 EBox::Module::__ANON__ - Error restarting service: Cannot convert a single value to a hash for '%info' parameter
Stack:
  [/usr/share/ebox/stubs/dhcp/subnet.mas:6]
  [/usr/share/ebox/stubs/dhcp/shared-network.mas:15]
  [(eval 198):84]
2009/04/07 22:56:27 ERROR> Base.pm:343 EBox::CGI::Base::__ANON__ - Connection reset by peer at /usr/share/perl5/HTML/Mason/Request.pm line 125.

Stack:
  [/usr/share/perl5/HTML/Mason/Request.pm:125]
  [/usr/share/perl5/HTML/Mason/Request.pm:507]
2009/04/07 23:19:52 INFO> Module.pm:135 EBox::Module::restartService - Restarting service for module: events
2009/04/07 23:20:16 DEBUG> LogFiltering.pm:70 EBox::Events::Model::Watcher::LogFiltering::new - Missing argument: tableInfo
2009/04/07 23:20:16 WARN> Events.pm:572 EBox::Events::__ANON__ - model EBox::Events::Model::Watcher::LogFiltering cannot be instantiated
2009/04/07 23:20:18 WARN> Events.pm:428 EBox::Events::_adminDumbness - No event dispatchers have been enabled


Thank you!

javi

  • Zen Hero
  • *****
  • Posts: 1042
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #1 on: April 08, 2009, 01:10:12 am »
What's your eBox version? apt-cache policy ebox

Can you try from the console:

Code: [Select]
/etc/init.d/ebox dhcp restart

You can disable the logs module and move away the file /etc/cron.hourly/90manageEBoxLogs


RedEagle

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #2 on: April 08, 2009, 11:01:32 am »
Hi Javi,

Thanks for replying so quicly. I'm starting to like this forum  ;)

My EBox version is:

ebox:
  Installed: 1.0-0ubuntu1~ppa1~hardy1
  Candidate: 1.0-0ubuntu1~ppa1~hardy1
  Version table:
 *** 1.0-0ubuntu1~ppa1~hardy1 0
        500 http://ppa.launchpad.net hardy/main Packages
        100 /var/lib/dpkg/status
     0.11.99-0ubuntu11 0
        500 http://pt.archive.ubuntu.com hardy/universe Packages


When I try to start it manually I get:

Use of uninitialized value in string ne at /usr/share/perl5/EBox/DHCP.pm line 1458.
Use of uninitialized value in string ne at /usr/share/perl5/EBox/DHCP.pm line 1458.
 * Restarting eBox module: dhcp                                          [fail]


The function which line 1458 (in red) belongs to is:

sub _thinClientOption # (option, iface)
{

    my ($self, $option, $iface) = @_;

    my $thinClientModel = $self->_getModel('thinClientModel', $iface);

    if ( $option eq 'filename' ) {
        my $fileType = $thinClientModel->row()->{valueHash}->{filename};
        if ( $fileType->exist() ) {
            # Write down the one stored in tftpd
            return EBox::DHCP->TftpdRootDir() . $iface . '_firmware';
        } else {
            my $file = $thinClientModel->row()->{valueHash}->{remoteFilename}->value();
            if( $file ne '' ) {
                return $file;
            } else {
                return undef;
            }
        }
    } else {
        return $thinClientModel->nextServer();
    }

}


Any ideas on what might be happening?

Thank you!

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Unable to start DHCP
« Reply #3 on: April 08, 2009, 11:53:15 am »
Hi RedEagle,

I'm afraid to tell you that your configuration is corrupt. So a complete reconfiguration is required for dhcp module or restore a backup configuration is another option. Check this link [1] to know how to restore only dhcp module.

[1] http://trac.ebox-platform.com/wiki/Document/HowTo/WhatToDoWhenRestoringABackupFails
My secret is my silence...

RedEagle

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #4 on: April 08, 2009, 12:33:56 pm »
That's a sad thing to know  :-\

Before I do it there are some doubts I would like someone to clarify. After this problem occured during the weekend, I removed the DHCP module and when I tryed to install again it I got a message telling me that there were some missing files on the ebox-dhcp package and that I should run "apt-get update". After I did this I was able to install the DHCP module but the ebox interface was different. For example intead of the "Sumary" option I had a "Dashbord" option...
My doubts are:

  • If I run "apt-get upgrade" will my configurations be maintained?
  • If I only retore the DHCP module will the new (updated) DHCP module give any trouble?

Thanks
« Last Edit: April 08, 2009, 12:44:22 pm by RedEagle »

javi

  • Zen Hero
  • *****
  • Posts: 1042
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #5 on: April 09, 2009, 12:36:06 pm »
Quote
Before I do it there are some doubts I would like someone to clarify. After this problem occured during the weekend, I removed the DHCP module and when I tryed to install again it I got a message telling me that there were some missing files on the ebox-dhcp package and that I should run "apt-get update". After I did this I was able to install the DHCP module but the ebox interface was different. For example intead of the "Sumary" option I had a "Dashbord" option...

You have basically upgraded to the latest stable version. That's why you see a dashboard option.
If your dhcp config got corrupted during the shutdown. You can do this:

Code: [Select]
apt-get remove --purge ebox-dhcp
apt-get install ebox-dhcp

That will purge your dhcp configuration and install ebox-dhcp again. If you have a configuration backup you can easily restore only the dhcp configuration with /usr/share/ebox/ebox-restore-backup. If you dont have a backup, I'm afraid you will have to set your dhcp conf again.

Good luck and don't hesitate to ask again :)


RedEagle

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #6 on: April 10, 2009, 07:42:05 pm »
Oh ok, thanks Javi!

I was under the impression that ebox only was actualliy update if I ran "apt-get upgrade", and that "apt-get update" (not upgrade) only downloaded the new package wothout upgrading it  ::)
I did what you recomended and it worked!  :D

Thanks once again!!!

javi

  • Zen Hero
  • *****
  • Posts: 1042
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #7 on: April 12, 2009, 06:25:23 pm »
Quote
I was under the impression that ebox only was actualliy update if I ran "apt-get upgrade", and that "apt-get update" (not upgrade) only downloaded the new package wothout upgrading it
I did what you recomended and it worked!

Cool, so that confirms what sixtone said about the dhcp configuration getting corrupted during the "incident".


gilles.bellavance

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Unable to start DHCP
« Reply #8 on: April 13, 2009, 11:39:13 am »
about dhcp I hope this can help some people.
I had a strange problem with some pc acquiring leases and some other not acquiring any leases. In fact 2 Ubuntu based pc where doing ok and 2 SuSE pc where not acquiring any leases. I tought it had some strange meaning. I found out that the "authoritative" statement was not declare in the dhcpd.conf server config file and this as the following effect :  If this is not set this means that if a client requests an address that the server knows nothing about and the address is incorrect for that network segment, the server will _not_ send a DHCPNAK (which tells the client it should stop using the address.) We don't want this so we set authoritative.
And of course my machines where on another lan before. Sinci this might often be the case I think this verb should be added. I did so in "/usr/share/ebox/stubs/dhcp/dhcpd.conf.mas".

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Unable to start DHCP
« Reply #9 on: April 13, 2009, 01:24:32 pm »
Thanks very much Gilles for pointing out this issue.

I've already patch in our development branch and we've released in next version.

Best,

My secret is my silence...