LINUX(redhat)学习之控制服务和守护进程

7版本用 systemctrl 来管理服务

6版本用 init 来管理的


systemctrl 的服务通常被称为unit

systemctrl -t help 查看


systemctl enable sshd(设置sshd.service开机启动)

systemctl disable sshd


(static状态是依靠其他服务 不能人为的修改)

systemctl list-units -t service --all

(查询所有的service 活动单元状态)

systemctl list-unit-files -t service

(查看启动配置)

systemctl --failed -t service

(查看启动失败的)

systemctl mask firewalld.service

(mask掉服务,不能进行手动启动,重新启用 umask掉)

(将这个做了一个软连接,umask就是把软连接去掉)

systemctl set-default  multi-user.target    (设置开机默认的target)

设置默认的target

systemctrl isolate multi-user.target

(切换target)

----------------红帽6版本服务-----------------

所有服务都是脚本   /etc/redhat-release

原始在 /etc/init.d/   文件下

启动级别(通过修改)

可直接修改 id:数值:initdefault 确定启动级别

(不同的启动级别的服务放在不同的rd编号下)

以K开头的会自动启动  以S开头的不会开机自动启动

chkconfig --list sshd   (查看级别启动的状态,全off所有级别都不启动)


chkconfig --level 5 sshon (不加参数就是全部on )

service sshd stop(关闭服务)

通过脚本管理


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值