Main Menu

Search

Showing posts with label systemctl. Show all posts
Showing posts with label systemctl. Show all posts

LINUX: How To Display All Runtime Kernel Parameters In Linux? (sysctl command)

Below sysctl command can be used to display all runtime kernel parameters in Linux.
sysctl -a
Below is portion of "sysctl -a" command output for reference.
# sysctl -a
abi.vsyscall32 = 1
crypto.fips_enabled = 0
debug.exception-trace = 1
debug.kprobes-optimization = 1
dev.hpet.max-user-freq = 64
dev.mac_hid.mouse_button2_keycode = 97
dev.mac_hid.mouse_button3_keycode = 100
dev.mac_hid.mouse_button_emulation = 0



Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://linux.die.net/man/8/sysctl


LINUX: "systemctl" Command to Check if Infiniband PCI Devices Are Loaded On Linux Hosts (How To Doc)

Below is "systemctl" command to run.
systemctl | egrep -i pci

Below is sample output of above command.
# systemctl | egrep -i pci
  sys-devices-pci0000:00-0000:00:04.0-net-eth1288_2.318.device  loaded active plugged   MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
  sys-devices-pci0000:00-0000:00:04.0-net-eth648_1.318.device   loaded active plugged   MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
  sys-devices-pci0000:00-0000:00:04.0-net-ib0.device            loaded active plugged   MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
  sys-devices-pci0000:00-0000:00:04.0-net-ib1.device            loaded active plugged   MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]

Products to which Article Applies

All Linux machines using Infiniband

LINUX: How To Find Failed Services and Modules on Linux Machine? (systemctl command)

Below "systemctl" command can be used to find the failed services and modules on Linux machine.
systemctl | grep -i fail
Below is sample output of above command which shows one failed service.


● systemd-binfmt.service                                        loaded failed failed    Set Up Additional Binary Formats


Products to which Article Applies




LINUX: How To Check Which Services Are Enabled on Linux Machine? ("systemctl" command)

Below "systemctl" Command can be used to check all the services enabled on Linux machine.
systemctl list-unit-files 

Below is example snippet of above command.

UNIT FILE                                     STATE

tmp.mount                                     disabled
var-lib-nfs-rpc_pipefs.mount                  static
brandbot.path                                 enabled
systemd-ask-password-console.path             static
systemd-ask-password-wall.path                static
session-2.scope                               static
acpid.service                                 enabled


Products to which Article Applies


All Linux Operating Systems

Additional References


https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

LINUX: How To Enable Particular Service Using "systemctl" Command To Auto Start During Reboot?

Below "systemctl" Command can be used to enable particular Service.
systemctl enable <service name>

For example if you want to enable Docket service to start when Linux Machine reboots, your "systemctl" command will look as follows:



systemctl enable docker

Once the service is enable run below command to verify that the service is enabled.

systemctl list-unit-files | grep -i <service>

For e.g. if you enabled Docker service, you can run below command to verify whether the Docker service is enabled.
systemctl list-unit-files | grep -i docker.

Below is example output of above command.
# systemctl list-unit-files | grep -i docker
docker.service          enabled


Products to which Article Applies


All Linux Operating Systems

Additional References

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

LINUX: How to Enable Service On Linux Nodes Using Systemctl Command? (How To Doc)



On Linux 7 & above versions "chkconfig --list" command cannot be used for enabling the services.
We will have to use systemctl command to check and enable services on Linux 7 and above versions.

Follow below steps to enable the desired service on Linux OS using systemctl command.


1. Check the status of the service using below command.
systemctl list-unit-files | grep -i <service name>


Below is sample output which shows the status of docker as disabled.
# systemctl list-unit-files | grep -i docker
docker.service                                disabled
docker.socket                                 disabled


2. Enable the desired service using below command.
systemctl enable docker


Below is sample snippet of enabling the docker service using systemctl command.
# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.


3. Check the status of the service using below command.
systemctl list-unit-files | grep -i <service name>


You will see that the service is enabled. Below is the sample output which shows docker service as being enabled.
# systemctl list-unit-files | grep -i docker
docker.service                                enabled
docker.socket                                 disabled

Products to which Article Applies


All Host Operating Systems Using ILOM

Additional Reference


LINUX: How To List All the Services and their State Using systemctl command? (How To Doc)

On Linux 7 & above versions "chkconfig --list" command does not list all th systemd services and their status.

We will have to use systemctl command to check the services and their status on Linux 7 and above versions.

Below command can be executed to list all the services and their status.
systemctl list-unit-files

Below is sample output. 
UNIT FILE                                     STATE
proc-sys-fs-binfmt_misc.automount             masked
dev-hugepages.mount                           static
dev-mqueue.mount                              static
proc-fs-nfsd.mount                            static
proc-sys-fs-binfmt_misc.mount                 static
sys-fs-fuse-connections.mount                 static
sys-kernel-config.mount                       static
sys-kernel-debug.mount                        static
tmp.mount                                     disabled
var-lib-nfs-rpc_pipefs.mount                  static
brandbot.path                                 enabled
systemd-ask-password-console.path             static
systemd-ask-password-wall.path                static
session-2.scope                               static
acpid.service                                 enabled
arp-ethers.service                            disabled
auth-rpcgss-module.service                    static

Products to which Article Applies


All Linux Operating Systems


Additional Reference

LINUX: systemctl Command To Check Network Interfaces Loaded and Active on the Linux Machine (How To Doc)

Below "systemctl" command can be executed to check the network interfaces loaded and active on Linux Machine.
systemctl | egrep -i "net/devices"
Below is sample output of above command.
  sys-subsystem-net-devices-bond0.device                        loaded active plugged   /sys/subsystem/net/devices/bond0
  sys-subsystem-net-devices-bond1.device                        loaded active plugged   /sys/subsystem/net/devices/bond1
  sys-subsystem-net-devices-bond10.device                       loaded active plugged   /sys/subsystem/net/devices/bond10
  sys-subsystem-net-devices-bond2.device                        loaded active plugged   /sys/subsystem/net/devices/bond2

Products to which Article Applies


All Linux Operating Systems


Additional Reference

http://man7.org/linux/man-pages/man1/systemctl.1.html