Stopping and Disabling Services in Linux

Things are a little different between Centos/RHEL6 and Centos/RHEL7 when it comes to starting and stopping services.

Having grown up on /etc/init.d/ scripts, it’s enough of a challenge using service blah stop instead of /etc/init.d/blah stop, but I guess service blah stop was added to Centos/RHEL6 to simplify things.

And then systemd comes alone they go and change it.  Way to go in terms of keeping things simple – even though it does bring some consistency across redhat and debian based distros going forward tbf…

Now it feels like every time I try to do something as simple as start and stop a service on a redhat based distro, Sod’s Law kicks in and I always get the command wrong, making me feel like a total noob, despite having rocked the command line for over 20 years.

As you can probably gather, I’m not a fan of the landscape changing (which is what drove me away from Windowz and into Linux in the first place – the longevity of the marketable skills set was better).  In my defence, Linus Torvalds isn’t that happy about it either.

Hence this little post.  A quick reminder on which command to use.  Now I’ve written it, I won’t need it of course.  Funny how the brain works, eh?

RHEL/CENTOS 6
chkconfig | grep zabbix – lists all services in all runlevels
chkconfig zabbix-agent off – toggle it on/off at startup
service zabbix-agent stop   -stop the service

RHEL/CENTOS 7
chkconfig
systemctl status zabbix-agent.service
systemctl disable zabbix-agent
systemctl stop zabbix-agent.service

 

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.