LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Starting my DHCP server at bootup (https://www.linuxquestions.org/questions/linux-newbie-8/starting-my-dhcp-server-at-bootup-530/)

nine 01-03-2001 01:55 AM

I have just managed to get DHCPD working on my machine but I have to manually run it to get it started. What I want to do is have it startup automatically when Linux boots, much like if I added an entry to an autoexec.bat file. I have tried putting an entry into .bash_profile for root but this will only run when I log in as root.

Any assistance would be very much appreciated.


jeremy 01-06-2001 11:24 AM

You need to use a startup script for this. What distro are you running?

nine 01-06-2001 08:17 PM

Distro
 
I'm using Mandrake 7.1

Any help is welcome.

pk

Jasutinsama 01-09-2001 05:04 PM

Good old linuxconf
 
You should be able to use the good ol' linuxconf in X to set the DHCP to run at boot. If not you may ave to edit one of the config files manually like net.config(or something(don't laugh at me)).

You might even be able to upgrade to Mandrake to 7.2 which has a nifty little cheater GUI that lets you setup DHCP. I connect using DHCP for my DSL and this took me about 2 minutes to setup and get online after install of 7.2.

___________
Jasutinsama<--dont listen to him he is just a newbie:)

jeremy 01-16-2001 08:41 AM

Create a file /etc/rc.d/init.d/dhcpd with the following content then make symlinks in the rcx.d dirs that you would like dhcpd to start in.

Quote:



#!/bin/sh
#
# dhcpd This shell script takes care of starting and stopping
# dhcpd.
#
# chkconfig: - 65 35
# description: dhcpd provide access to Dynamic Host Control Protocol.

# 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/sbin/dhcpd ] || exit 0
[ -f /etc/dhcpd.conf ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting dhcpd: "
daemon /usr/sbin/dhcpd eth1
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
;;
stop)
# Stop daemons.
echo -n "Shutting down dhcpd: "
killproc dhcpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcpd
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
status)
status dhcpd
RETVAL=$?
;;
*)
echo "Usage: dhcpd {start|stop|restart|status}"
exit 1
esac

exit $RETVAL


All times are GMT -5. The time now is 04:40 PM.