isc-dhcp-server - kali bug?!

Dactarom

New Member
Joined
Aug 16, 2018
Messages
5
Reaction score
7
Credits
0
First of all, hello to everyone.

I installed isc-dhcp-server on my Kali. The settings appear to be correct, but when I try to start it, I get the following error:

root @ kali: ~ # /etc/init.d/isc-dhcp-server start
[...] Starting isc-dhcp-server (via systemctl): isc-dhcp-server.serviceJob for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
failed
-----------------------------------------------------------------
systemctl status:

root@kali:~# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Thu 2018-08-16 15:20:46 -03; 20min ago
Docs: man:systemd-sysv-generator(8)
Process: 6508 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

ago 16 15:20:46 kali systemd[1]: Starting LSB: DHCP server...
ago 16 15:20:46 kali isc-dhcp-server[6508]: Launching IPv4 server only.
ago 16 15:20:46 kali isc-dhcp-server[6508]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ...failed!
ago 16 15:20:46 kali systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
ago 16 15:20:46 kali systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
ago 16 15:20:46 kali systemd[1]: Failed to start LSB: DHCP server.

-----------------------------------------------------------------
journalctl -xe:

ago 16 15:20:46 kali systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
ago 16 15:20:46 kali systemd[1]: Failed to start LSB: DHCP server.
-- Subject: A unidade isc-dhcp-server.service falhou
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A unidade isc-dhcp-server.service falhou.
--
-- O resultado é RESULT.
ago 16 15:22:45 kali NetworkManager[572]: <info> [1534443765.7112] policy: set 'VIVO-30A4' (wlan0) as default for IPv6 routing and DNS
ago 16 15:25:01 kali CRON[6554]: pam_unix(cron:session): session opened for user root by (uid=0)
ago 16 15:25:01 kali CRON[6555]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
ago 16 15:25:01 kali CRON[6554]: pam_unix(cron:session): session closed for user root
ago 16 15:30:14 kali dbus-daemon[564]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostna...
ago 16 15:30:14 kali systemd[1]: Starting Hostname Service...
-- Subject: Unidade systemd-hostnamed.service sendo iniciado
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A unidade systemd-hostnamed.service está sendo iniciada.
ago 16 15:30:14 kali dbus-daemon[564]: [system] Successfully activated service 'org.freedesktop.hostname1'
ago 16 15:30:14 kali systemd[1]: Started Hostname Service.
-- Subject: Unidade systemd-hostnamed.service concluiu a inicialização
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A unidade systemd-hostnamed.service concluiu a inicialização.
--
-- The start-up result is RESULT.
ago 16 15:35:01 kali CRON[6584]: pam_unix(cron:session): session opened for user root by (uid=0)
ago 16 15:35:01 kali CRON[6585]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
ago 16 15:35:01 kali CRON[6584]: pam_unix(cron:session): session closed for user root
ago 16 15:39:01 kali CRON[6590]: pam_unix(cron:session): session opened for user root by (uid=0)
ago 16 15:39:01 kali CRON[6591]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean...
ago 16 15:39:01 kali CRON[6590]: pam_unix(cron:session): session closed for user root

-------------------------------------------------------------------------


Has anyone seen anything like this? An instructor told me that it is a kali 2017.1 bug, but I did not find anything related.

Some help would be appreciated.

Thanks in advance,

Dac
 


An instructor told me that it is a kali 2017.1 bug, but I did not find anything related.
I am not a Kali user... it is beyond my skills to help you. But why not listen to your instructor? And then why not upgrade to 18.2 if there is concern of a bug that is affecting you?

Cheers
 
Hey, man, thanks for your reply.

Yep, that's the obvious thing to do and actually the first thing I did.
If the problem is this bug, then it has not been fixed.

This is frying my brain. I'm also not an expert, I'm starting on the linux journey.

thank you again

Dac
 
Is it absolutely necessary that you start your journey with Kali ??
 
I am a Mile2 Newborn Certified Penetration Testing Engineer. Of course kali has some headaches, but almost always has been my best friend.
 
Your answer is in what you posted (from what i can see)..

"Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ...failed!"

THere's already a process running - or atleast it thinks there is since the pid file exists. It sees the existence of the pidfile so it bails out.

First, look to see if it's already running:
'ps aux|grep dhcp'

if you don't see it running already, you can delete the pidfile.. perhaps it created it then died..
 
@atanere check it out, man! The instructor was rigth! LOL :rolleyes::)

the f$%% bug was there.

problem was actually in the /etc/init.d/isc-dhcp-server file

What did I do to solve it? I have another machine with kali 2.0, and I decided to see if the settings would work, and really worked, and after all the settings I made in my upgraded kali, the only error that the server still indicated was in the file /etc/init.d/ isc-dhcp-server, then I decided to take this kali 2.0 file and replace it in the upgraded one, and PROBLEM SOLVED.

Thanks for the help and attention, fellows.

and I hope that what I have spent these days will help those who go through it in the future.

Below is the content of the /etc/init.d/isc-dhcp-server file. Replace the f#$&ed one by this and voilá:

----------------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
#
#

### BEGIN INIT INFO
# Provides: isc-dhcp-server
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $remote_fs $network $syslog
# Should-Start: $local_fs slapd $named
# Should-Stop: $local_fs slapd
# 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/dhcpd || exit 0

DHCPD_DEFAULT="${DHCPD_DEFAULT:-/etc/default/isc-dhcp-server}"

# It is not safe to start if we don't have a default configuration...
if [ ! -f "$DHCPD_DEFAULT" ]; then
echo "$DHCPD_DEFAULT does not exist! - Aborting..."
if [ "$DHCPD_DEFAULT" = "/etc/default/isc-dhcp-server" ]; then
echo "Run 'dpkg-reconfigure isc-dhcp-server' to fix the problem."
fi
exit 0
fi

. /lib/lsb/init-functions

# Read init script configuration
[ -f "$DHCPD_DEFAULT" ] && . "$DHCPD_DEFAULT"

NAME=dhcpd
DESC="ISC DHCP server"
# fallback to default config file
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
# try to read pid file name from config file, with fallback to /var/run/dhcpd.pid
if [ -z "$DHCPD_PID" ]; then
DHCPD_PID=$(sed -n -e 's/^[ \t]*pid-file-name[ \t]*"(.*)"[ \t]*;.*$/\1/p' < "$DHCPD_CONF" 2>/dev/null | head -n 1)
fi
DHCPD_PID="${DHCPD_PID:-/var/run/dhcpd.pid}"

test_config()
{
if ! /usr/sbin/dhcpd -t $OPTIONS -q -cf "$DHCPD_CONF" > /dev/null 2>&1; then
echo "dhcpd self-test failed. Please fix $DHCPD_CONF."
echo "The error was: "
/usr/sbin/dhcpd -t $OPTIONS -cf "$DHCPD_CONF"
exit 1
fi
touch /var/lib/dhcp/dhcpd.leases
}

# single arg is -v for messages, -q for none
check_status()
{
if [ ! -r "$DHCPD_PID" ]; then
test "$1" != -v || echo "$NAME is not running."
return 3
fi
if read pid < "$DHCPD_PID" && 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 $DHCPD_PID exists."
return 1
fi
}

case "$1" in
start)
test_config
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --pidfile "$DHCPD_PID" \
--exec /usr/sbin/dhcpd -- \
-q $OPTIONS -cf "$DHCPD_CONF" -pf "$DHCPD_PID" $INTERFACES
sleep 2

if check_status -q; then
log_end_msg 0
else
log_failure_msg "check syslog for diagnostics."
log_end_msg 1
exit 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --pidfile "$DHCPD_PID"
log_end_msg $?
rm -f "$DHCPD_PID"
;;
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

----------------------------------------------------------------------------------------------------------------------------------
root@kali:~# /etc/init.d/isc-dhcp-server start
[ ok ] Starting isc-dhcp-server (via systemctl): isc-dhcp-server.service.
----------------------------------------------------------------------------------------------------------------------------------

C u, guys!
 
Way to go... nice work! This is a good example of why I'm not a Kali user... my head is still swimming! :eek::confused::D

It's also a good example of why we are usually quite discouraging for new Linux users to start with Kali, as Brian (@Condobloke) was hinting at above. But it is quite a different story when you have an instructor and some official training that set you on your path. It seems like we see far too many who want to use Kali but really have no idea of even the basics of Linux. :confused::rolleyes:

Cheers
 
my head is still swimming! :eek::confused::D

My head is always swimming, with the Death Goddess ... I have it on board, but just feed it with updates from time to time :eek::rolleyes:o_O

@Dactarom if you have not already come across it, Parrot Security OS may also be handy for you. It, too is Debian-based.

Thanks for sharing that solution with us, I will bookmark this Thread for Justin (Just IN case I get serious about Kali), and thanks to @Rob for the guide :D

Avagudweegend, all

Wizard
 

Members online


Latest posts

Top