Friday, December 2, 2016

Mematikan suatu service di Linux secara permanent..

How to Kill a Process in Linux

In order to kill a running process in Linux, use the ‘Kill PID‘ command. But, before running Kill command, we must know the PID of the process. For example, here I want to find a PID of ‘cupsd‘ process.
[avishek@tecmint]# ps ax | grep cupsd
1511 ?        Ss     0:00 cupsd -C /etc/cups/cupsd.conf
So, the PID of ‘cupsd‘ process is ‘1511‘. To kill that PID, run the following command.
[avishek@tecmint]# kill -9 1511
To find out more about kill command with their examples, read the article A Guide to Kill Command to Terminate a Process in Linux

How to Disable a Services in Linux

In Red Hat based distributions such as Fedora and CentOS, make use of a script called ‘chkconfig‘ to enable and disable the running services in Linux.
For example, lets disable the Apache web server at the system startup.
[avishek@tecmint]# chkconfig httpd off
[avishek@tecmint]# chkconfig httpd --del
In Debian based distributions such as UbuntuLinux Mint and other Debian based distributions use a script called update-rc.d.
For example, to disable the Apache service at the system startup execute the following command. Here ‘-f’option stands for force is mandatory.
[avishek@tecmint]# update-rc.d -f apache2 remove
After making these changes, The system next time will boot without these UN-necessary process which in-fact will be saving our system resource and the server would be more practical, fast, safe and secure.

No comments:

Post a Comment

have a question, just spill it :D