码迷,mamicode.com
首页 > 其他好文 > 详细

centos 7 创建启动脚本

时间:2018-05-18 19:28:17      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:nginx   class   set   status   mct   内容   /usr   ecs   wan   

首先创建启动脚本

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

查看状态

[root@localhost 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 创建启动脚本

标签:nginx   class   set   status   mct   内容   /usr   ecs   wan   

原文地址:https://www.cnblogs.com/shabake/p/9057488.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!