Systemctl to disable service on boot

We will learn basic commands to manage systemd services and units using systemctl.

Using systemctl we can enable disable particular service to be started or stopped when system boot.

To check status of service use

systemctl status postfix.service

To stop service use

systemctl stop postfix.service

To start service

systemctl start postfix.service

To disable the service from starting automatically on boot, type:

systemctl stop postfix.service

and then

systemctl disable postfix.service

This will make sure service is stopped now and will not start automatically after server reboot.

If you want service should be started automatically when server boot you will need to enable it using following command.

systemctl enable postfix.service

Leave a Reply

Your email address will not be published. Required fields are marked *