CentOS 7 / RHEL 7 systemd commands

CentOS 7 / RHEL 7 systemd commands

转载地址:http://www.linuxbrigade.com/centos-7-rhel-7-systemd-commands/

By now, if you’ve played around with CentOS 7 (or RHEL 7), you’ve heard that there are now systemd commands you can start using to start, restart and stop various services. They still have the ‘service’ command included for backwards compatibility, but that may go away in future releases. Here’s a little tutorial to help you learn the systemd commands!

Ok, so you’re on your new CentOS 7 (or RHEL 7) system (we’ll just call it CentOS 7 for now to make it easier) and you restarted sshd with the old/familiar ‘service sshd restart’ command and you’re met with this: Redirecting to /bin/systemctl restart sshd.service

Now, it still restarted it, but that little note is annoying. It’s basically telling you “hey – things have changed… use systemctl now!”

You could now type ‘systemctl restart sshd’ for a shorter version.. here are some examples:

Stop service:

Start service:

Restart service (stops/starts):

Reload service (reloads config file):

List status of service:

What about chkconfig? That changed too? Yes, now you want to use systemctl for the chkconfig commands also..

chkconfig service on:

chkconfig service off:

chkconfig service (is it set up to start?)

chkconfig –list (shows what is and isn’t enabled)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值