Main Menu

Search

Showing posts with label Linker Article Linux systemctl. Show all posts
Showing posts with label Linker Article Linux systemctl. Show all posts

LINUX: How To Make Updated/Modified/New sysctl Kernel Parameter Changes In /etc/sysctl.conf File Get Into Affect/Load On Linux Without A Reboot? (sysctl command)

Below sysctl commands can be used to make updated/modified/new sysctl kernel parameter changes inside /etc/sysctl.conf file to get into affect or load on Linux host without a reboot.
sysctl -p
or
sysctl -p /etc/sysctl.conf


Products to which Article Applies

All Linux Operating Systems

Additional Reference

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

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: 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