centos7下添加开机启动

在/etc/systemd/system下创建weblogic .Service

touch weblogic.Service

添加启动权限

chmod +x weblogic.Service

 编辑weblogic.Service

vim weblogic.Service

[Unit]

Description=weblogic Service          #服务的说明

After=syslog.target ntpdate.service sntp.service  #启动顺序,表示这些服务启动后启动该服务

[Service]                #此块对服务器进行设置

Type=simple                 #服务类型

User=weblogic                  #启动的用户

Group=weblogic                         #启动的组

ExecStart=/etc/init.d/weblogic start         #启动时调用的脚本和参数

ExecStop=/etc/init.d/weblogic stop          #停止时调用的脚本和参数

ExecReload=/etc/init.d/weblogic restart       #重启时调用的脚本和参数

[Install]

WantedBy=multi-user.target                 #启动的级别,相当域centos6中的init 3

更多参数,可以参考一下连接

http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html

猜你喜欢

转载自www.cnblogs.com/xiaoyaoren/p/9944592.html