您的当前位置:首页 --> CentOS入门
CentOS 7添加自定义系统服务
浏览次数:1435 关键词 ( 自定义  系统  CentOS  )

Centos7开机启动项分为system和user两种类型

比如像mysql这种不用登陆就可以运行的就是system型,放在/usr/lib/systemd/system下,反之,用户登录后才能运行的程序,存在用户(user)里。

 

假如我自定义了一个系统服务,叫mytest.server,文件格式可参考system目录下的其他文件。

执行   systemctl  enable mytest.service  设置开机自启动

     systemctl  start mytest.service   启动服务

     systemctl  status mytest.service  查看状态

 

查看开机项

systemctl  list-unit-files 

下一条 centos系统中网络配置相关
上一条 SecureCRT telnet 到CentOS7 显示中文 设置

数千企业与站长的选择,7*24小时稳定运行

 了解更多套餐详细