Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

DHCP Server problems, Webmin & Ubuntu Server 7.10

  • 11-12-2007 6:49pm
    #1
    Closed Accounts Posts: 13,874 ✭✭✭✭


    Hi all,

    Firstly, I'm only 2 months using linux, so would stil consider myself a n00b. Be easy on me :D

    I've got my server setup using this guide. All went well except that MySQL Database server wouldn't start automatically after a reboot, so i added this command:
    mysql1vc7.th.png

    Now i need to use the server to handle dhcp, but i cant for the life of me figure out why it wont startup. The server ip is 192.168.10.1 on eth1(lan). I'm trying to add 192.168.10.10 to 10.20 to the dhcp address range. These following pics are my settings.
    dhcp1no2.th.png
    dhcp2tp5.th.png
    dhcp3yu2.th.png

    This is the what my config file looks like:
    dhcpconfigsf3.th.png

    This is what i get when i try to start dhcp:
    dhcp4qe4.th.png

    Sorry for the long post, but this problem has me tearing my hair out.

    Thanks in advance

    Pog


Comments

  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    Start it from the command line instead , it should show you why its unhappy.
    maybe

    /etc/init.d/dhcp3-server start

    or similar


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    I get this response:
    colm@l33t-str33t-s3rv3r:~$ /etc/init.d/dhcp3-server start
    -bash: /etc/init.d/dhcp3-server: No such file or directory
    colm@l33t-str33t-s3rv3r:~$

    and this is what i get when i try to re-install it:
    colm@l33t-str33t-s3rv3r:~$ sudo apt-get install dhcp3-server
    E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
    colm@l33t-str33t-s3rv3r:~$


  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    Webmin probably trying to do something , shut down Webmin and see.
    It only allows one thing at a time to install stuff , saves agony

    Go

    ps -ef | more


    and you can see whats running


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    The dhcp folder is empty but there's another called "dhcp3-server.dkpg-new" which has this inside it, honestly i've no idea what is happening:
    #!/bin/sh
    #
    # $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
    #

    ### BEGIN INIT INFO
    # Provides: dhcp3-server
    # Required-Start: $network
    # Required-Stop: $network
    # Should-Start: $local_fs
    # Should-Stop: $local_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: DHCP server
    # Description: Dynamic Host Configuration Protocol Server
    ### END INIT INFO

    PATH=/sbin:/bin:/usr/sbin:/usr/bin

    test -f /usr/sbin/dhcpd3 || exit 0

    . /lib/lsb/init-functions

    # It is not safe to start if we don't have a default configuration...
    if [ ! -f /etc/default/dhcp3-server ]; then
    usplash_write "QUIT"

    log_failure_msg "/etc/default/dhcp3-server does not exist! - Aborting..."
    log_failure_msg "Run 'dpkg-reconfigure dhcp3-server' to fix the problem."
    exit 0
    fi

    # Default config file
    CONFIG_FILE=/etc/dhcp3/dhcpd.conf

    # Allow ltsp to override
    if [ -f /etc/ltsp/dhcpd.conf ]; then
    CONFIG_FILE=/etc/ltsp/dhcpd.conf
    fi

    # Read init script configuration (so far only interfaces the daemon
    # should listen on.)
    . /etc/default/dhcp3-server

    NAME=dhcpd3
    DESC="DHCP server"
    DHCPDPID=/var/run/dhcp3-server/dhcpd.pid

    test_config()
    {
    if ! /usr/sbin/dhcpd3 -t -cf $CONFIG_FILE > /dev/null 2>&1; then
    echo "dhcpd self-test failed. Please fix the config file."
    echo "The error was: "
    /usr/sbin/dhcpd3 -t -cf $CONFIG_FILE 2>&1| sed '1,4d'
    exit 1
    fi
    }

    # single arg is -v for messages, -q for none
    check_status()
    {
    if [ ! -r "$DHCPDPID" ]; then
    test "$1" != -v || echo "$NAME is not running."
    return 3
    fi
    if read pid < "$DHCPDPID" && ps -p "$pid" > /dev/null 2>&1; then
    test "$1" != -v || echo "$NAME is running."
    return 0
    else
    test "$1" != -v || echo "$NAME is not running but $DHCPDPID exists."
    return 1
    fi
    }

    case "$1" in
    start)
    test_config

    # allow dhcp server to write lease and pid file
    mkdir -p /var/run/dhcp3-server
    chown dhcpd:dhcpd /var/run/dhcp3-server
    [ -e /var/lib/dhcp3/dhcpd.leases ] || touch /var/lib/dhcp3/dhcpd.leases
    chown dhcpd:dhcpd /var/lib/dhcp3 /var/lib/dhcp3/dhcpd.leases
    if [ -e /var/lib/dhcp3/dhcpd.leases~ ]; then
    chown dhcpd:dhcpd /var/lib/dhcp3/dhcpd.leases~
    fi

    log_daemon_msg "Starting $DESC" "$NAME"
    start-stop-daemon --start --quiet --pidfile $DHCPDPID \
    --exec /usr/sbin/dhcpd3 -- -q $INTERFACES -pf $DHCPDPID -cf $CONFIG_FILE
    sleep 2

    if check_status -q; then
    log_end_msg 0
    else
    log_end_msg 1
    exit 1
    fi
    ;;
    stop)
    log_daemon_msg "Stopping $DESC" "$NAME"
    start-stop-daemon --stop --quiet --pidfile $DHCPDPID
    log_end_msg $?
    rm -f "$DHCPDPID"
    ;;
    restart | force-reload)
    test_config
    $0 stop
    sleep 2
    $0 start
    if [ "$?" != "0" ]; then
    exit 1
    fi
    ;;
    status)
    echo -n "Status of $DESC: "
    check_status -v
    exit "$?"
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|force-reload|status}"
    exit 1
    esac

    exit 0


  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    PogMoThoin wrote: »
    I get this response:
    colm@l33t-str33t-s3rv3r:~$ sudo apt-get install dhcp3-server
    E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
    colm@l33t-str33t-s3rv3r:~$

    and this is what i get when i try to re-install it:

    I've seen the above error message when trying to run apt-get from the command line while running something like Synaptic at the same time. Although this may not apply to your situation if you're using Webmin. The ps command should tell you if some other process is using the /var/lib/dpkg directory. I can't remember the correct switches to use off the top of my head at the moment and I'm off to the pub soon.

    *bushy got there before me....see his post for the correct ps command.


  • Advertisement
  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    That long file you quoted above just checks the config file makes sense and kickstarts it into life when you go " start" ,
    have a VERY quick read through it and you'll see where it check for where the config file lives and so on .

    Anyway reinstall it and try again ,

    apt-get remove --purge dhcpd3-server

    ( if it still complains .... go

    ps -ef | more again and see if apt-get , or aptitude is running)

    apt-get install dhcp3-server



    Copy /etc/dhcp3/dhcp.conf to something like /etc/dhcp3/dhcp.conf.orig

    then stick the stuff below into /etc/dhcp3/dhcp.conf ( comment out the rest of it for now until you want to do fancier tricks )


    subnet 192.168.10.0 netmask 255.255.255.0 {
    option host-name "l333t-server";
    option domain-name-servers 192.168.10.1;
    option broadcast-address 192.168.10.255;
    option subnet-mask 255.255.255.0;
    option routers 192.168.10.1;
    range 192.168.10.10 192.168.10.20;
    }


  • Closed Accounts Posts: 1,506 ✭✭✭Jackz


    To speed up looking for the process:

    ps -ef | grep apt


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    Did all that m8, made no difference, still wont start, still get
    Failed to start dhcpd :


    There is no folder in /etc/dhcp3 called dhcp.conf, I've got dhcpd.conf & dhcpd.conf.dpkg-new

    I'm not using webmin now, i'm using ssh. Webmin is buggy @ installing packages from what i've seen

    Got another annoying problem now, I'm trying to mount a new hd thats already formatted to ext3 before i took it out of my main rig, i've made a directory in /home/public for it, taken control of it & set access mode for the folder. But "fdisk -l" gives me absolutely no output at all. How can i mount this hd without knowing what its named as?


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    ok, been messin around tryin 2 get it to start
    colm@l33t-str33t-s3rv3r:~$ sudo /etc/init.d/dhcpd-server start
    sudo: /etc/init.d/dhcpd-server: command not found
    colm@l33t-str33t-s3rv3r:~$ sudo /etc/init.d/dhcp3-server start
    sudo: /etc/init.d/dhcp3-server: command not found
    colm@l33t-str33t-s3rv3r:~$

    then i tried to install it again & got this:
    colm@l33t-str33t-s3rv3r:~$ sudo apt-get install dhcp3-server
    E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
    colm@l33t-str33t-s3rv3r:~$ dpkg --configure -a
    dpkg: requested operation requires superuser privilege
    colm@l33t-str33t-s3rv3r:~$ sudo dpkg --configure -a
    Setting up dhcp3-server (3.0.5-3ubuntu4) ...

    Configuration file `/etc/dhcp3/dhcpd.conf'
    ==> File on system created by you or by a script.
    ==> File also in package provided by package maintainer.
    What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
    D : show the differences between the versions
    Z : background this process to examine the situation
    The default action is to keep your current version.
    *** dhcpd.conf (Y/I/N/O/D/Z) [default=N] ? I
    Installing new version of config file /etc/dhcp3/dhcpd.conf ...
    Generating /etc/default/dhcp3-server...
    * Starting DHCP server dhcpd3 [fail]
    invoke-rc.d: initscript dhcp3-server, action "start" failed.

    colm@l33t-str33t-s3rv3r:~$


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    Ok, update, after a bit of messin about i got this:
    colm@l33t-str33t-s3rv3r:~$ sudo /etc/init.d/dhcp3-server restart
    * Stopping DHCP server dhcpd3 [ OK ]
    * Starting DHCP server dhcpd3 [ OK ]
    colm@l33t-str33t-s3rv3r:~$

    Yippee, my only problem now it that the system & server status in webmin doesn't have dhcp3 server, only dhcp server and this shows as not running but i'll live with that. Anyone know how to add it? its not in the list of monitors.

    Anyone have an answer to my hd problem, gonna start another thread i think

    Thanks to bushy... and all who posted here


  • Advertisement
  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
    D : show the differences between the versions
    Z : background this process to examine the situation
    The default action is to keep your current version.
    *** dhcpd.conf (Y/I/N/O/D/Z) [default=N] ? I
    

    When you answered " I" it put in the default config file again , you probably need to edit it , then restart the dhcp server.


    box:$ sudo ps -ef | grep dhcpd
    root 5706 1 0 22:30 ? 00:00:00 /usr/sbin/dhcpd3 -q
    root 5710 4305 0 22:30 pts/1 00:00:00 grep dhcpd <<< IGNORE

    box:$sudo kill 5706 <<<<<<< number from above (different for you)

    box:$ sudo ps -ef | grep dhcpd
    root 5712 4305 0 22:30 pts/1 00:00:00 grep dhcpd


  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    PogMoThoin wrote: »
    Got another annoying problem now, I'm trying to mount a new hd thats already formatted to ext3 before i took it out of my main rig, i've made a directory in /home/public for it, taken control of it & set access mode for the folder. But "fdisk -l" gives me absolutely no output at all. How can i mount this hd without knowing what its named as?

    Go
    colm@l33t-str33t-s3rv3r:~$dmesg | more   
    
    or 
    
    colm@l33t-str33t-s3rv3r:~$dmesg | grep hd
    

    and see if its mentioned there


  • Closed Accounts Posts: 13,874 ✭✭✭✭PogMoThoin


    Think its ata4, as its 160Gb & one i installed on originally is ata3 which is 120Gb:
    [ 29.849400] ata3: SATA max UDMA/133 cmd 0x0001fe00 ctl 0x0001fe12 bmdma 0x000
    1fea0 irq 22
    [ 29.849406] ata4: SATA max UDMA/133 cmd 0x0001fe20 ctl 0x0001fe32 bmdma 0x000
    1fea8 irq 22
    [ 30.066982] ata3.00: ATA-7: ST3120813AS, 3.AAE, max UDMA/133
    [ 30.066986] ata3.00: 234441648 sectors, multi 8: LBA48 NCQ (depth 0/32)
    [ 30.150228] ata3.00: configured for UDMA/133
    [ 30.329242] ata4.00: ATA-6: ST3160023AS, 8.12, max UDMA/133
    [ 30.329245] ata4.00: 312500000 sectors, multi 8: LBA48 NCQ (depth 0/32)
    [ 30.369245] ata4.00: configured for UDMA/133


Advertisement