Debian增加开机启动

发布时间:2020-06-09 11:58:10 作者:苍天火云
来源:网络 阅读:810

1、增加服务文件

vi /etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

2、增加rc.local文件

vi /etc/rc.local

#!/bin/sh -e

exit 0

添加权限:

chmod +x /etc/rc.local

设置到系统启动:

systemctl enable rc-local

启动脚本:

systemctl start rc-local.service

检查服务状态:

systemctl status rc-local.service

你已经增加了系统启动脚本,可以在这个脚本里面增加你想启动的程序,例如

cd /home/gst/tomcat/bin

./strat.sh

转载于:http://mingli.muhuolong.cn/

推荐阅读:
  1. Debian、Ubuntu系统中开机启动设置
  2. oracle开机启动

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

linux

上一篇:php中this报错的解决方法

下一篇:php中url传参时出现乱码怎么解决

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》