isc-dhcp-server disabling and configuring

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?


Solution 1:

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

Solution 2:

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.