Linux环境下服务自启

#!/bin/bash
#chkconfig:2345 61 61
###########################使用办法#################################
####1、将此文件放在/etc/rc.d/init.d/下,赋予执行权限################
####2、执行 chkconfig --add autoRun.sh 将自启文件加入系统服务 ######
####3、执行 chkconfig autoRun.sh on 将此命令设置为自启##############
####################################################################
# 关闭防火墙
systemctl stop firewalld.service > /opt/oneAccept.log 2>&1 &

# 防止java命令找不到,此处执行的系统文件为配置JAVA_HOME的文件,依安装方式不同执行文件不同
source ~/.bash_profile
# 启动一网通办
nohup java -jar /opt/oneAccept.jar > /opt/oneAccept.log 2>&1 &


# 启动nginx
/usr/local/nginx/sbin/nginx > /opt/oneAccept.log 2>&1


# 启动liboffice
/opt/libreoffice5.3/program/soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard &


# 启动mysql,依安装方式选择启动方式
##使用linux命令启动service启动
service mysqld start
##使用mysqld脚本启动
/etc/inint.d/mysqld start

  

posted @ 2021-01-14 14:58  蓝色土耳其  阅读(237)  评论(0编辑  收藏  举报