3

What's the Debian Equivalent for chkconfig?

On CentOS 6 I can run this to see the services that load with the system:

chkconfig --list

And i can set a service to start on boot like this:

chkconfig <service_name> on

Is there a similar binary that can do this for Debian?

To clarify I am using Kali rolling but from what I am told this is very similar to Debian

[kali@kali:~/labs/discovery]$ lsb_release -da
No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:    2020.1
Codename:   kali-rolling

[kali@kali:~/labs/discovery]$ hostnamectl
   Static hostname: kali
         Icon name: computer-vm
           Chassis: vm
        Machine ID: d74933508486479e9b07e83b9a036776
           Boot ID: ece90367d8454f7fb795b9f2f1787091
    Virtualization: vmware
  Operating System: Kali GNU/Linux Rolling
            Kernel: Linux 5.4.0-kali4-amd64
      Architecture: x86-64
brakertech
  • 1,385
  • 2
  • 11
  • 12

1 Answers1

6

Assuming your Debian system is running systemd, to check all enabled services equivalent to chkconfig --list:

systemctl list-unit-files --type=service --state=enabled

(As you can see from What's the equivalent of chkconfig --list for systemctl?, on CentOS 7 the chkconfig command has been updated to actually tell you this and anther systemd equivalent when it is run.)

To set a service to start on boot equivalent to chkconfig <service_name> on:

systemctl enable <service_name>
JdeBP
  • 66,967
  • 12
  • 159
  • 343
GMaster
  • 5,992
  • 3
  • 28
  • 32
  • Always prefixing `sudo` is a bad habit in general, and is outright unnecessary in an answer like this one, given what `systemctl` does when invoked by a non-superuser. – JdeBP May 01 '20 at 05:23
  • Updated my answer. Thanks – GMaster May 01 '20 at 05:32