Systemctl tool is use to start, stop, restart, status basic services, also the functionality of both service and chkconfig.
systemctl ommand is list all running services,
# systemctl
or
# systemctl -a
acpid.service loaded active running ACPI Event Daemon
atd.service loaded active running Job spooling tools
auditd.service loaded active running Security Auditing Service
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
Enable / Disable Services:
The basic command to enables or disable a service to be started on bootup time. For examble how to enable or disable sshd service.
# systemctl enable sshd.service
# systemctl disable sshd.service
# systemctl disable sshd.service
How to Start / Stop / Restart few Services.
The following commands are enable / start / stop / restart / status services,
Networks:
# systemctl enable network.service
# systemctl start network.service
# systemctl stop network.service
# systemctl restart network.service
# systemctl status network.service
# systemctl start network.service
# systemctl stop network.service
# systemctl restart network.service
# systemctl status network.service
Apache (HTTPD)
# systemctl enable httpd.service
# systemctl start httpd.service
# systemctl stop httpd.service
# systemctl restart httpd.service
# systemctl status httpd.service
# systemctl start httpd.service
# systemctl stop httpd.service
# systemctl restart httpd.service
# systemctl status httpd.service
SSH :
# systemctl enable sshd.service
#systemctl start sshd.service
#systemctl stop sshd.service
#systemctl restart sshd.service
#systemctl status sshd.service
#systemctl start sshd.service
#systemctl stop sshd.service
#systemctl restart sshd.service
#systemctl status sshd.service
If you have installed any packages additionally can start same as, for example
Memcached :
# systemctl status memcached.service
memcached.service - Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled)
Active: active (running) since Thu 2015-02-26 09:54:27 IST; 2h 1min ago
Main PID: 444 (memcached)
CGroup: /system.slice/memcached.service
└─444 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024
# systemctl restart memcached.service
# systemctl stop memcached.service
# systemctl stop memcached.service
or
# systemctl restart memcached
# systemctl start memcached
# systemctl status memcached
# systemctl stop memcached
# systemctl start memcached
# systemctl status memcached
# systemctl stop memcached
Comments (0)