centos 7 创建启动脚本
Posted shabake
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 7 创建启动脚本相关的知识,希望对你有一定的参考价值。
首先创建启动脚本
vi /etc/systemd/system/frpc.service
内容如下
[Unit] Description=frpc After=network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStart=/usr/local/frpc/frpc -c /usr/local/nginx/conf/frpc.ini [Install] WantedBy=multi-user.target
设置开机启动
systemctl enable frpc
重启服务
systemctl restart frpc
查看状态
[[email protected] system]# systemctl status frpc ?frpc.service - Start or stop the frps Loaded: loaded (/etc/systemd/system/frpc.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2018-05-18 18:33:04 CST; 21s ago Main PID: 10195 (frpc) CGroup: /system.slice/frpc.service 忖10195 /usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini May 18 18:33:04 localhost.localdomain systemd[1]: Started Start or stop the f... May 18 18:33:04 localhost.localdomain systemd[1]: Starting Start or stop the ... May 18 18:33:04 localhost.localdomain frpc[10195]: 2018/05/18 18:33:04 [I] [p... May 18 18:33:04 localhost.localdomain frpc[10195]: 2018/05/18 18:33:04 [I] [p... May 18 18:33:04 localhost.localdomain frpc[10195]: 2018/05/18 18:33:04 [I] [p... May 18 18:33:04 localhost.localdomain frpc[10195]: 2018/05/18 18:33:04 [I] [p... May 18 18:33:04 localhost.localdomain frpc[10195]: 2018/05/18 18:33:04 [I] [c... May 18 18:33:05 localhost.localdomain frpc[10195]: 2018/05/18 18:33:05 [W] [c... May 18 18:33:05 localhost.localdomain frpc[10195]: 2018/05/18 18:33:05 [W] [c... Hint: Some lines were ellipsized, use -l to show in full.
成功
以上是关于centos 7 创建启动脚本的主要内容,如果未能解决你的问题,请参考以下文章