Job for isc dhcp server service failed because the control process exited with error code

name: Bug report about: DHCP Server...
name: Bug report
about: DHCP Server fails to control subservices after upgrade

Describe the bug

log from apt upgrade:

Setting up isc-dhcp-server (4.3.5-3+deb9u2) ...
Job 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.
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
* isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2021-06-06 10:34:25 CEST; 82ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 20278 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/isc-dhcp-server.service
           `-1457 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf

Jun 06 10:34:24 derdapp003 systemd[1]: Starting LSB: DHCP server...
Jun 06 10:34:24 derdapp003 isc-dhcp-server[20278]: Launching both IPv4 and IPv6 servers (please configure INTERFACES in /etc/default/isc-dhcp-serve…he other).
Jun 06 10:34:25 derdapp003 isc-dhcp-server[20278]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid curr….. failed!
Jun 06 10:34:25 derdapp003 systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Jun 06 10:34:25 derdapp003 systemd[1]: Failed to start LSB: DHCP server.
Jun 06 10:34:25 derdapp003 systemd[1]: isc-dhcp-server.service: Unit entered failed state.
Jun 06 10:34:25 derdapp003 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
root@derdapp003:~# ps -ef|grep dhcp
root      1457     1  0 Apr20 ?        00:03:24 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf
root     20508 19428  0 10:37 pts/0    00:00:00 grep dhcp

Cause:
I have only IPv4 configured and up and running. On the upgrade isc seems to want IPv6 to be configured and fails with unspecific reason «exit-code».
First issue: the subprocess for dhcpd ipv4 is not stopped or not stopped in a correct manner.
Killing it manualy results in a pid file remaining, that also needs to be removed:

Jun  6 10:45:50 localhost isc-dhcp-server[20975]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!
Jun  6 10:45:50 localhost systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Jun  6 10:45:50 localhost systemd[1]: Failed to start LSB: DHCP server.

Even doing so, the ics-dhcp-server fails on the next start with the same error in sequence.

After configuring nano /etc/default/isc-dhcp-server
with

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0.200 eth0.300 eth0.400"
INTERFACESv6=""

the server starts w/o any errors.

claims:

  1. if no ipv6 interface is configured, the server should not fail to start, but just drop the ipv6 sequence
  2. if the ics-dhcp-server fails to start for any reason, it should take care about subprocesses to be stopped in a correct way not leaving ghosts or pidfiles.

Systeminformation:

Linux derdapp003 4.19.59-sunxi #5.91 SMP Mon Jul 15 14:09:32 CEST 2019 armv7l GNU/Linux
    description: ARMv7 Processor rev 4 (v7l)
    product: LeMaker Banana Pro

~# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.13 (stretch)
Release:	9.13
Codename:	stretch

~# dpkg -l|grep dhcp
ii  isc-dhcp-client                     4.3.5-3+deb9u2                    armhf        DHCP client for automatically obtaining an IP address
ii  isc-dhcp-common                     4.3.5-3+deb9u2                    armhf        common manpages relevant to all of the isc-dhcp packages
ii  isc-dhcp-server                     4.3.5-3+deb9u2                    armhf        ISC DHCP server for automatic IP address assignment

PLEASE HELP!

I’ve been trying to launch dhcp-server but only this error come back:

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!

This is what systemctl status isc-dhcp-server.service says:

● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
   Active: failed (Result: exit-code) since Sat 2019-09-07 04:59:48 EDT; 2min 1s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4092 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

Sep 07 04:59:48 kali systemd[1]: Starting LSB: DHCP server...
Sep 07 04:59:48 kali isc-dhcp-server[4092]: Launching both IPv4 and IPv6 servers (please configure INTERFACES in /etc/default/isc-dhcp-server if you only want one or the other).
Sep 07 04:59:48 kali isc-dhcp-server[4092]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!
Sep 07 04:59:48 kali systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Sep 07 04:59:48 kali systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Sep 07 04:59:48 kali systemd[1]: Failed to start LSB: DHCP server.

And this is what journalctl -xe says:

-- A start job for unit isc-dhcp-server.service has begun execution.
-- 
-- The job identifier is 2181.
Sep 07 04:59:48 kali isc-dhcp-server[4092]: Launching both IPv4 and IPv6 servers (please configure INTERFACES in /etc/default/isc-dhcp-server if you only want one or the other).
Sep 07 04:59:48 kali isc-dhcp-server[4092]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!
Sep 07 04:59:48 kali systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit isc-dhcp-server.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Sep 07 04:59:48 kali systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'.
Sep 07 04:59:48 kali systemd[1]: Failed to start LSB: DHCP server.
-- Subject: A start job for unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit isc-dhcp-server.service has finished with a failure.
-- 
-- The job identifier is 2181 and the job result is failed.
Sep 07 05:02:20 kali NetworkManager[577]: <info>  [1567846940.5971] dhcp4 (eth0): state changed bound -> bound
Sep 07 05:02:20 kali dbus-daemon[566]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.3' (uid=0 pid=577 comm="/us
Sep 07 05:02:20 kali systemd[1]: Starting Network Manager Script Dispatcher Service...
-- Subject: A start job for unit NetworkManager-dispatcher.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit NetworkManager-dispatcher.service has begun execution.
-- 
-- The job identifier is 2245.
Sep 07 05:02:20 kali dbus-daemon[566]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Sep 07 05:02:20 kali systemd[1]: Started Network Manager Script Dispatcher Service.
-- Subject: A start job for unit NetworkManager-dispatcher.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit NetworkManager-dispatcher.service has finished successfully.
-- 
-- The job identifier is 2245.
Sep 07 05:02:30 kali systemd[1]: NetworkManager-dispatcher.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit NetworkManager-dispatcher.service has successfully entered the 'dead' state.

This is my dhcpd.conf file at /etc/dhcpd.conf :

authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name "freewifi";
option domain-name-servers 192.168.1.1;
range 192.168.1.2 192.168.1.40;
}

Здравствуйте! Короче говоря, нашёл я в инете стетейку о том, как сделать PXE-сервер на Linux. Но когда дошла очередь до DHCP-сервера (который есть его частью), процесс зашёл в тупик. Сколько не пытаюсь запустить, выдаёт ошибку:

Код

Job 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.

Вот вырезка из «# journalctl -xe»:

Кликните здесь для просмотра всего текста

Код

-- The job identifier is 1684.
лип 01 09:47:12 VM isc-dhcp-server[3513]: Launching both IPv4 and IPv6 servers (please configure INTERFACES in /etc/default/isc-dhcp-s
лип 01 09:47:12 VM dhcpd[3523]: Internet Systems Consortium DHCP Server 4.4.1
лип 01 09:47:12 VM dhcpd[3523]: Copyright 2004-2018 Internet Systems Consortium.
лип 01 09:47:12 VM dhcpd[3523]: All rights reserved.
лип 01 09:47:12 VM dhcpd[3523]: For info, please visit https://www.isc.org/software/dhcp/
лип 01 09:47:12 VM isc-dhcp-server[3513]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid 
лип 01 09:47:12 VM systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit isc-dhcp-server.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
лип 01 09:47:12 VM systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'.
лип 01 09:47:12 VM systemd[1]: Failed to start LSB: DHCP server.
-- Subject: A start job for unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit isc-dhcp-server.service has finished with a failure.
-- 
-- The job identifier is 1684 and the job result is failed.
лип 01 09:47:12 VM sudo[3507]: pam_unix(sudo:session): session closed for user root
лип 01 09:47:23 VM sudo[3526]:     user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/journalctl -xe
лип 01 09:47:23 VM sudo[3526]: pam_unix(sudo:session): session opened for user root by (uid=0)

Вот файл /etc/dhcp/dhcpd.conf

Кликните здесь для просмотра всего текста

Код

option domain-name-servers 8.8.8.8, 8.8.4.4;
option ip-forwarding on;
default-lease-time 60;
min-lease-time 120;
max-lease-time 300;
authoritative;
ddns-update-style interim;
log-facility local7;
shared-network PXE-Netwotk {
  subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.3 192.168.1.10;
  option routers 192.168.1.2;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  filename "pxelinux.0";
  next-server 192.168.1.2;
  option root-path "192.168.1.2:/srv/tftp/";
  }
}

Конфигурация сети:

Кликните здесь для просмотра всего текста

192.168.1.1 — роутер нижней ветки сети (т.е., связан непосредственно с машиной)
192.168.1.2 — собственно, машина

В чём проблема — не пойму, но ещё важнее — как её решать?..

Добавлено через 3 часа 5 минут
Решение найдено! Привёл файл /etc/dhcp/dhcpd.conf до вида описанного в https://wiki.debian.org/PXEBootInstall, а файл /etc/default/isc-dhcp-server до вида

Код

DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
DHCPDv4_PID=/var/run/dhcpd.pid
INTERFACESv4="eth0"

Где eth0 — используемый шлюз в сеть. Посмотреть список всех доступных шлюзов можно командой

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

Hi,

Premise:

Just for learning purpose, I created two Linux VMs in my Wmware workstation and installed debian 10.4 on them. The first one should work as a server, the second one as a simple client.

I setup two network adapters for the first machine (the server); the first in NAT mode as its wan and a VMNET2 for the second adapter which should work as its LAN. I then setup the second VM’s adapter as host-only and assigned VMNET2 to it.

I installed the dhcp server on the debian server machine and setup a dhcp.conf file:

# dhcpd.conf

default-lease-time 86400;

max-lease-time 86400;

option subnet-mask 255.255.255.0;

option broadcast-address 10.10.10.255;

option domain-name "local.lan";

authoritative;

subnet 10.10.10.0 netmask 255.255.255.0 {

range 10.10.10.10 10.10.10.254;

option routers 10.10.10.1;

option domain-name-servers 10.10.10.1;

}

I then run:

systemctl restart isc-dhcp-server

and got this:

Job 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.

then 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 Tue 2020-06-30 11:56:35 CEST; 1min 15s ago

Docs: man:systemd-sysv-generator(8)

Process: 1294 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAIL

giu 30 11:56:33 debianser dhcpd[1307]: bugs on either our web page at www.isc.org or in

giu 30 11:56:33 debianser dhcpd[1307]: before submitting a bug. These pages explain th

giu 30 11:56:33 debianser dhcpd[1307]: process and the information we find helpful for

giu 30 11:56:33 debianser dhcpd[1307]:

giu 30 11:56:33 debianser dhcpd[1307]: exiting.

giu 30 11:56:35 debianser isc-dhcp-server[1294]: Starting ISC DHCPv4 server: dhcpdcheck

giu 30 11:56:35 debianser isc-dhcp-server[1294]: failed!

giu 30 11:56:35 debianser systemd[1]: isc-dhcp-server.service: Control process exited,

giu 30 11:56:35 debianser systemd[1]: isc-dhcp-server.service: Failed with result 'exit

giu 30 11:56:35 debianser systemd[1]: Failed to start LSB: DHCP server.

What is the matter? Could you please help fix this problem?

Thanks

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Official Flavours Support
  • Networking & Wireless
  • [SOLVED] Unable to restart isc-dhcp-server

  1. Unable to restart isc-dhcp-server

    I am trying to restart my isc-dhcp-server and i get the following error. Please suggest a solution

    Code:

    pi@JsDHCPPi:~$ sudo service isc-dhcp-server restart
    Job 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.

    Code:

    pi@JsDHCPPi:~$ systemctl status isc-dhcp-server.service
    ● isc-dhcp-server.service - LSB: DHCP server
       Loaded: loaded (/etc/init.d/isc-dhcp-server; enabled; vendor preset: enabled)
       Active: activating (auto-restart) (Result: exit-code) since Thu 2019-05-23 23:14:17 +03; 2s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 1318 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
    
    May 23 23:14:17 JsDHCPPi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
    May 23 23:14:17 JsDHCPPi systemd[1]: Failed to start LSB: DHCP server.
    May 23 23:14:17 JsDHCPPi systemd[1]: isc-dhcp-server.service: Unit entered failed state.
    May 23 23:14:17 JsDHCPPi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.



    Code:

    
    pi@JsDHCPPi:~$ journalctl -xe
    May 23 23:14:17 JsDHCPPi dhcpd[1329]: 
    May 23 23:14:17 JsDHCPPi dhcpd[1329]: exiting.
    May 23 23:14:22 JsDHCPPi systemd[1]: isc-dhcp-server.service: Service hold-off time over, scheduling restart.
    May 23 23:14:22 JsDHCPPi systemd[1]: Stopped LSB: DHCP server.
    -- Subject: Unit isc-dhcp-server.service has finished shutting down
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    -- 
    -- Unit isc-dhcp-server.service has finished shutting down.
    May 23 23:14:22 JsDHCPPi systemd[1]: Starting LSB: DHCP server...
    -- Subject: Unit isc-dhcp-server.service has begun start-up
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    -- 
    -- Unit isc-dhcp-server.service has begun starting up.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: Launching IPv4 server only.
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: /etc/dhcp/dhcpd.conf line 0: expecting a parameter or declaration
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: 
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: ^
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: Configuration file errors encountered -- exiting
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: 
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: If you think you have received this message due to a bug rather
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: than a configuration issue please read the section on submitting
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: bugs on either our web page at www.isc.org or in the README file
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: The error was:
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: before submitting a bug.  These pages explain the proper
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: process and the information we find helpful for debugging..
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: 
    May 23 23:14:22 JsDHCPPi dhcpd[1343]: exiting.
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: Internet Systems Consortium DHCP Server 4.3.5
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: Internet Systems Consortium DHCP Server 4.3.5
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: Copyright 2004-2016 Internet Systems Consortium.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: All rights reserved.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: For info, please visit https://www.isc.org/software/dhcp/
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: Copyright 2004-2016 Internet Systems Consortium.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: /etc/dhcp/dhcpd.conf line 0: expecting a parameter or declaration
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: ^
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: All rights reserved.
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: Configuration file errors encountered -- exiting
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: If you think you have received this message due to a bug rather
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: than a configuration issue please read the section on submitting
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: bugs on either our web page at www.isc.org or in the README file
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: before submitting a bug.  These pages explain the proper
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: process and the information we find helpful for debugging..
    May 23 23:14:22 JsDHCPPi isc-dhcp-server[1333]: exiting.
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: For info, please visit https://www.isc.org/software/dhcp/
    May 23 23:14:22 JsDHCPPi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: /etc/dhcp/dhcpd.conf line 0: expecting a parameter or declaration
    May 23 23:14:22 JsDHCPPi systemd[1]: Failed to start LSB: DHCP server.
    -- Subject: Unit isc-dhcp-server.service has failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    -- 
    -- Unit isc-dhcp-server.service has failed.
    -- 
    -- The result is failed.
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: 
    May 23 23:14:22 JsDHCPPi systemd[1]: isc-dhcp-server.service: Unit entered failed state.
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: ^
    May 23 23:14:22 JsDHCPPi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: Configuration file errors encountered -- exiting
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: 
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: If you think you have received this message due to a bug rather
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: than a configuration issue please read the section on submitting
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: bugs on either our web page at www.isc.org or in the README file
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: before submitting a bug.  These pages explain the proper
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: process and the information we find helpful for debugging..
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: 
    May 23 23:14:22 JsDHCPPi dhcpd[1344]: exiting.


  2. Re: Unable to restart isc-dhcp-server

    What’s this file look like? May 23 23:14:22 JsDHCPPi dhcpd[1343]: /etc/dhcp/dhcpd.conf line 0: expecting a parameter or declaration


  3. Re: Unable to restart isc-dhcp-server

    The issue was found as a time stamp that popped by at the beginning of the dhcpd.conf file


Tags for this Thread

Bookmarks

Bookmarks


Posting Permissions

mtylerb

Posts: 42
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

[SOLVED] DHCP Server Issues

Hey folks,

I’m new to RPi. I’ve setup my RPi 3 B+ as a DNS/DHCP/Web/File/Printer server. It works great. What I’m a little confused by is that I’m getting errors when restarting the DHCP server. It almost looks like it’s trying to start twice, claiming that it’s already running. Or at least that’s how I’m reading it. I’m no Linux expert, by any means, but I’m making a push right now to try and change how things work in the house. So, here’s the output from a couple commands:

Code: Select all

pi@raspberrypi:~ $ sudo service isc-dhcp-server stop


pi@raspberrypi:~ $ sudo service isc-dhcp-server start


Job 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.


pi@raspberrypi:~ $ sudo journalctl -xe

Apr 06 21:06:25 raspberrypi sudo[27415]: pam_unix(sudo:session): session opened for user root by (uid=0)

Apr 06 21:06:25 raspberrypi systemd[1]: Starting LSB: DHCP server...
-- Subject: Unit isc-dhcp-server.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit isc-dhcp-server.service has begun starting up.

Apr 06 21:06:25 raspberrypi isc-dhcp-server[27445]: Launching IPv4 server only.

Apr 06 21:06:26 raspberrypi isc-dhcp-server[27445]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1

Apr 06 21:06:26 raspberrypi systemd[1]: Failed to start LSB: DHCP server.
-- Subject: Unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit isc-dhcp-server.service has failed.
-- 
-- The result is failed.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Unit entered failed state.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.

Apr 06 21:06:26 raspberrypi sudo[27415]: pam_unix(sudo:session): session closed for user root

Apr 06 21:06:28 raspberrypi sudo[27460]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe

Apr 06 21:06:28 raspberrypi sudo[27460]: pam_unix(sudo:session): session opened for user root by (uid=0)


pi@raspberrypi:~ $ sudo systemctl status isc-dhcp-server

● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-04-06 21:06:26 MDT; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 27445 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/isc-dhcp-server.service
           └─653 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf eth0


Apr 06 21:06:25 raspberrypi systemd[1]: Starting LSB: DHCP server...

Apr 06 21:06:25 raspberrypi isc-dhcp-server[27445]: Launching IPv4 server only.

Apr 06 21:06:26 raspberrypi isc-dhcp-server[27445]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Apr 06 21:06:26 raspberrypi systemd[1]: Failed to start LSB: DHCP server.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Unit entered failed state.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.


pi@raspberrypi:~ $ 

Any ideas? The server itself works great, it’s distributing addresses like it’s supposed to, but I’m just trying to clear up this last error. I have no idea where to look to see if it’s running the command to start twice.

Thanks for the help.

Tyler

Last edited by mtylerb on Sat Apr 14, 2018 2:39 am, edited 1 time in total.




mtylerb

Posts: 42
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

Re: DHCP Server Issues

Fri Apr 13, 2018 11:10 pm

Alright, so after doing some digging, and some invaluable help from a friend that has way more experience with Linux than I, there were a couple issues…

Showed me 3 processes running, one was the dhcpcd client, which wasn’t even needed, so I killed that and removed it from my boot up list. Another showed dhcpd running, but I wasn’t able to affect it with service or systemctl commands. So ran a kill on the affected pid. #3 was just the grep command being run, so that was a non-issue.

Next problem was IPv6. I don’t have IPv6 at my house yet, so I didn’t fill in the configuration file. However, it was still trying to listen and was inevitably failing. I commented out the 3 lines in /etc/default/isc-dhcp-server6.

Third issue was there was a pid file for dhcpd in /run. So after verifying that isc-dhcp-server was stopped, and seeing as the processes in step 1 we did just that, I ran

.

After doing these, running

Code: Select all

$sudo service isc-dhcp-server start

started without issue.

Hopefully this helps someone in the future.


Gaius Baltar

Posts: 1
Joined: Thu Jun 14, 2018 6:16 am
Location: Paris, France

Re: [SOLVED] DHCP Server Issues

Thu Jun 14, 2018 6:29 am

Hi Mtylerb!

«Hopefully this helps someone in the future»

It did! Your post really helped me today. I had the same kind of issue today and thanks to you, I understood that my problem was related to IPV6.

I have it disabled at home. After some research and reading your post, I looked to /etc/default/isc-dhcp-server and commented the last line.

Code: Select all

     
     # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="wlan1"
#INTERFACESv6=""
 

After that, it worked!

So I registered because I have to say «thank you!».


WillBerriss

Posts: 8
Joined: Tue Jan 06, 2015 4:34 pm

Re: [SOLVED] DHCP Server Issues

Tue Feb 26, 2019 6:52 pm

Thank you so much, this fixed it for me too! :-)
Btw, my pid file was here though: /var/run/dhcpd.pid (or maybe you just forgot to type the leading /var?)


ejcadmin

Posts: 1
Joined: Wed May 01, 2019 12:15 pm

Re: [SOLVED] DHCP Server Issues

Wed May 01, 2019 12:45 pm

Just a heads up. I’m trying to solve a similar problem (isc-dhcp-server throws an error on bootup or restart but seems to start and run OK anyway), and found a possible complication here. One of the suggestions is to disable the dhcpcd client service because it’s not needed in a server with a static IP address. However, in the current Raspbian version (stretch), a static IP address is set via the dhcpcd client configuration file (/etc/dhcpcd.conf), so if you disable the dhcpcd client (sudo systemctl disable dhcpcd), you don’t get an address on the next boot. Apparently dhcpcd needs to run at bootup, although it doesn’t seem to cause a problem if you stop it later.


navoneel1

Posts: 2
Joined: Fri Jun 21, 2019 7:12 pm

Re: [SOLVED] DHCP Server Issues

Fri Jun 21, 2019 7:23 pm

I’ve faced the same issue today. Found a debian bug report on it. — which exists in version isc-dhcp/4.3.5-3 ( Raspbian stretch is running isc-dhcp-server is 4.3.5-3+deb9u1 armhf )

https://bugs.debian.org/cgi-bin/bugrepo … bug=867362

It says fixed in v4.4.1-1 , which will come in a future release. Until then, I guess, we’ll have to remove pid file /var/run/dhcpd.pid manually


navoneel1

Posts: 2
Joined: Fri Jun 21, 2019 7:12 pm

Re: [SOLVED] DHCP Server Issues

Sat Jun 22, 2019 3:02 pm

Update:
After removing /var/run/dhcpd.pid file, I bumped into another error where the DHCP server complained of having no subnet6 declaration in /etc/dhcp/dhcpd.conf.
Following Gaius’s reply, I saw had a INTERFACESv6=»wlan1″ in /etc/default/isc-dhcp-serverm which I changed to INTERFACESv6=»», that helped. (I had put in INTERFACESv6=»wlan1″ manually, long before upgrading from Jessie to Stretch — I don’t exactly recall why. It was working fine with Jessie though)

Everything looks to be working now.

Gaius Baltar wrote: ↑

Thu Jun 14, 2018 6:29 am


Hi Mtylerb!

«Hopefully this helps someone in the future»

It did! Your post really helped me today. I had the same kind of issue today and thanks to you, I understood that my problem was related to IPV6.

I have it disabled at home. After some research and reading your post, I looked to /etc/default/isc-dhcp-server and commented the last line.

Code: Select all

     
     # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="wlan1"
#INTERFACESv6=""
 

After that, it worked!

So I registered because I have to say «thank you!».


frtoledo

Posts: 1
Joined: Tue Jan 12, 2021 11:47 pm

Re: [SOLVED] DHCP Server Issues

Tue Jan 12, 2021 11:55 pm

I am using raspberry pi 4 and had the same issue.
I tried all of the solutions listed and they didn’t work.
I discovered the solution for my issue because I am using webmin, but you don’t have to.
I clicked on Edit Network Interface at DHCP server on webmin, selected «eth0» from the list, and saved.
What it did:
-changed (yes, changed, removed all the commented lines) the file /etc/default/isc-dhcp-server to:
INTERFACES=eth0
INTERFACESv4=eth0
That’s it, it started working.
The way it is, without ampersands («).

As the DHCP server was not starting after a reboot, I solved this issue by following the instructions at:
https://raspberrypi.stackexchange.com/q … ter-reboot:
1. sudo cp /run/systemd/generator.late/isc-dhcp-server.service /etc/systemd/system
2. sudo nano /etc/systemd/system/isc-dhcp-server.service
3. Edit the [Service] section:
-set Restart=on-failure,
-add RestartSec=5 to instruct systemd to wait 5 seconds before restarting a failed service.
-Add the [Install] section which is missing, and add the follow line to it:
-WantedBy=multi-user.target
4. sudo systemctl daemon-reload
5. sudo systemctl disable isc-dhcp-server
6. sudo systemctl enable isc-dhcp-server


Return to “Raspberry Pi OS”

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Job for dnsmasq service failed because the control process exited with error code
  • Joomla error invalid login обновление joomla
  • Joomla error failed to start application failed to start the session
  • Joomla error failed to start application error starting the session
  • Job for auditd service failed because the control process exited with error code

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии