Understanding package manager and systemctl
Day 7 Task: Understanding package manager and systemctl of 90daysofDevops
Tasks
check the status of docker service in your system (make sure you completed above tasks, else docker won't be installed)
stop the service jenkins and post before and after screenshots
read about the commands systemctl vs service
eg. systemctl status docker
vs service docker status
Task 1 :
To check the status of docker status we can use
First, we need to have docker in our system, so enter this command to install it
sudo apt-get install docker.io
// for aws-linux u can use this one
sudo yum install docker.io
To check the status of docker we can use this command
sudo systemctl status docker
you can restart, stop the service using this command
" sudo systemctl restart docker "
" sudo systemctl stop docker "
Task 2 :
stop the service Jenkins and post before and after screenshots
sudo systemctl stop jenkins
Task 3 :
Difference between command systemctl vs service
service
: A traditional command used in older Linux distributions with the System V init system. It manages services by starting, stopping, restarting, enabling, or disabling them.systemctl
: A modern and more powerful command used in newer Linux distributions with the systemd init system. It also manages services but offers more advanced features, including service dependencies, control groups, and better integration with the system.
In general, if you're using a newer Linux distribution, it's recommended to use systemctl
as it provides more capabilities and is the standard method for managing services.