• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

RHEL 7 – RHCSA Notes : Start, stop, and check the status of network services.

by admin

RHEL 7 – RHCSA Notes (Cheat Sheets)

systemd service units

– Previous versions of Oracle Linux use scripts in the /etc/rc.d/init.d directory to control services.
– In Oracle Linux 7, these scripts have been replaced by systemd service units.
– Use the systemctl command to list information about service units.

To list all loaded service units:

# systemctl list-units --type service --all

To see which service units are enabled:

# systemctl list-unit-files --type service

Displaying the Status of Services

– systemd service units correspond to system services.
– To display detailed information about the httpd service:

# systemctl status httpd

– To check whether a service is running (active) or not running (inactive):

# systemctl is-active sshd
active

– To check whether a service is enabled:

 # systemctl is-enabled sshd
enabled

Starting and stopping services

service Utility systemctl Utility Description
service name start systemctl start name Starts a service
service name stop systemctl stop name Stops a service
service name restart systemctl restart name Restarts a service
service name condrestart systemctl try- restart name Restarts a service only if it is running
service name reload systemctl reload name Reloads a configuration
service name status systemctl status name Checks whether a service is running
service –status- all systemctl list-units –type service –all Displays the status of all services

Enabling and disabling services

chkconfig Utility systemctl Utility Description
chkconfig name on systemctl enable name Enables a service
chkconfig name off systemctl disable name Disables a service
chkconfig –list name systemctl status name, systemctl is-enabled name Checks whether a service is enabled
chkconfig –list systemctl list-unit-files –type service Lists all services and checks whether they are enabled

Filed Under: RHCSA notes

Some more articles you might also be interested in …

  1. RHEL 7 – RHCSA Notes : Create, delete, and modify local groups and group memberships.
  2. RHEL 7 – RHCSA Notes – Create and manage Access Control Lists (ACLs)
  3. RHEL 7 – RHCSA Notes : Change passwords and adjust password aging for local user accounts
  4. RHEL 7 – RHCSA Notes : Schedule tasks using at and cron
  5. RHEL 7 – RHCSA Notes : Create hard and soft links.
  6. RHEL 7 – RHCSA Notes : Create, delete, and modify local user accounts
  7. RHEL 7 – RHCSA Notes : Configure a system to use time services
  8. RHEL 7 – RHCSA Notes (Cheat Sheets)
  9. RHEL 7 – RHCSA Notes – input / output redirection
  10. RHEL 7 – RHCSA Notes – vi/vim editor

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright