4

I've installed isc-dhcp-server just for a one-time task. So basically, after task is completed I dont't need it anymore: should I just uninstall it? Or it possible to disable it completely?

The command sudo service isc-dhcp-server stop seems don't prevent restarting isc-dhcp service in background, after PC rebooted.

Also, there was a lot of modifications in dhcpd.conf, also was assigned static IP to /etc/network/interfaces config: should edit changes back in interfaces config, as don't need it anymore, or this changes are not persistent? Also, I forgot to backup the dhcpd.conf: how to get unchanged one?

6

It seems that you want to prevent running DHCP server after reboot. to do this action, you must update init scripts by update-rc.d:

sudo update-rc.d -f isc-dhcp-server remove

Upgrade

If you want to add DHCP Server to startup again, enter this command:

sudo update-rc.d isc-dhcp-server defaults

| improve this answer | |
  • So it removes DHCP from system startup. If in the future I will need ISC-DHCP server again, how I can enable it? Regarding static IP that was set in /etc/network/interfaces: should I change config back? – minto Jan 22 '17 at 18:08
  • @minto your change to /etc/network/interfaces must be reverted back because when you reboot your system, it's uses /etc/network/interfaces to bring up your interfaces. – Ghasem Pahlavan Jan 23 '17 at 9:29
3

for ubuntu 16.04 and 14.04 this command :

sudo update-rc.d -f isc-dhcp-server remove

will not stop the service to start at boot time. How to check that ?

sudo service isc-dhcp-server status
● isc-dhcp-server.service - ISC DHCP IPv4 server
  Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: inactive (dead)
 Docs: man:dhcpd(8)

Despite the fact that the start and stop links on all rc.d levels are removed the service will still be started at boot time. It is still enable and start script in /etc/default/isc-dhcp-server will be run at boot time starting the service. To stop service loading at boot time use command:

sudo systemctl disable isc-dhcp-server.service

Now You can check the status :

sudo service isc-dhcp-server status
● isc-dhcp-server.service - ISC DHCP IPv4 server
 Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; disabled; vendor  preset: enabled)
   Active: inactive (dead)
 Docs: man:dhcpd(8)

Now you see the service is disabled at boot time.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.