# DHCP Daemon problems (NOT CLIENT DAEMON) - RUNSCRIPT.SH

## Scott Frappier

evangelion init.d # ./dhcp stop

/sbin/runscript.sh: dhcp: command not found

 * Stopping dhcpd...                                                      [ ok ]

Why am i constantly getting this error message?   I'm horrible @ scripting, and when I go into 'runscript.sh' I cannot where it is getting this 'dhcp' variable.

Is there an easy way to follow scripts and input commands?  I work in a CSIDE enviroment that allows me to 'step' through the code...is there such a think for the bash scripts that exist?

If anyone can point me out how to get rid of that annoying message, please feel free to tell me  :Smile:  !

Thanks much everyone, and I have to say it, Gentoo made me switch from Slackware, and now I am never going back  :Smile: ...Now I just wish VMWare worked in FreeBSD  :Smile: .

Scott Frappier

----------

## carpman

try looking here, i had runscript.sh problem and thise cured it

https://forums.gentoo.org/viewtopic.php?t=5722

----------

## klieber

 *Scott Frappier wrote:*   

> evangelion init.d # ./dhcp stop
> 
> /sbin/runscript.sh: dhcp: command not found
> 
>  * Stopping dhcpd...                                                      [ ok ]
> ...

 

Try issuing the following command instead:

```
/etc/init.d/dhcpd stop
```

note the 'd' at the end of dhcp.

As for where the variable comes from, it's coming from /etc/init.d/dhcp (or dhcpd, which I think is the right name of the command)

--kurt

----------

## Scott Frappier

klieber wrote:

 *Quote:*   

> Try issuing the following command instead: 
> 
> ```
>  /etc/init.d/dhcpd stop 
> ```
> ...

 

It looks like there is no dhcpd in my init.d directory.  There is of course the daemon in /sbin.

Upon futher examination, it looks like the dhcp-3.0-r2 package itself has a mislabeled init.d script.  Here is the information from the CONTENTS file:

```
 obj /etc/init.d/dhcp b3e4e6d39bd41d9900733b87380b0fbb 1024447908 
```

Shouldn't that be dhcpd?  If I change it to dhcpd, my problem is solved, and I no longer recieve errors.

So in the end, is renaming the file the 'correct' solution...I know it works now, but I want to know if this is by design, or by a typo  :Smile: .

Thanks for the reply klieber  :Smile: 

Scott Frappier

----------

## klieber

Eh...I don't use dhcp all that much, so I may have mislead you.  I just looked at the one box that I do have dhcpd installed on -- the "correct" path is /etc/init.d/dhcp  (no 'd').

I'm not sure why you're getting the runscript error, but it does look like it's still working (stopping dhcpd, etc.)  Check your /etc/init.d/dhcp file and make sure it looks similar to this one:

```
#!/sbin/runscript

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# /space/gentoo/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.rc7,v 1.1 2002/06/17 04:07:11 lostlogic Exp

#configuration is done in /etc/conf.d/dhcp

depend() {

    need net

}

checkconfig() {

    if [ ! -e /etc/dhcp/dhcpd.conf ] ; then

        eerror "You need an /etc/dhcp/dhcpd.conf file to run dhcpd"

        eerror "There is a sample conf file in /usr/share/doc/dhcp"

        return 1

    fi

}

start() {

    checkconfig || return 1

    ebegin "Starting dhcpd"

    start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd -- ${IFACE}

    eend $?

}

stop() {

    ebegin "Stopping dhcpd"

    start-stop-daemon --stop --quiet --exec /usr/sbin/dhcpd

    eend $?

}

```

--kurt

----------

