ubuntu设置gitLab、jira自启动

一、uubuntu设置gitLab自启动

Ubuntu 下禁止 Gitlab 开机自启动:

$ sudo systemctl disable gitlab-runsvdir.service
  • 1

Ubuntu 下启用 Gitlab 开机自启动:

$ sudo systemctl enable gitlab-runsvdir.service

二、ubuntu设置gitLab自启动

1.进入/etc/init.d/目录

2.touch tomcat-jira

3.编辑,vi tomcat-jira,里面写入


#!/bin/bash  
# chkconfig: 345 90 10
# description: tomcat8
# processname: tomcat8

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_172
TOMCAT_HOME=/opt/atlassian/jira
STARTUP_SHELL=$TOMCAT_HOME/bin/startup.sh
SHUTDOWN_SHELL=$TOMCAT_HOME/bin/shutdown.sh


case "$1" in
start)
sh $STARTUP_SHELL
;;
stop)
sh $SHUTDOWN_SHELL
;;
restart)
sh $SHUTDOWN_SHELL
sh $STARTUP_SHELL
;;
esac

4.给其增加可执行权限

sudo chmod +x /etc/init.d/tomcat-jira

5.sudo sysv-rc-conf tomcat-jira on

没有此命令则安装  sudo apt-get install sysv-rc-conf

检查tomcat启动设置: sysv-rc-conf  --list|grep tomcat-jira

直接进/etc/rcX.d中,也能发现以S开头的tomcat的启动项。S开头的启动项表示开机启动,K开头的表示开机不启动。

rcX.d包括如下:

进入:

6.如果要取消开机启动,sysv-rc-conf tomcat off
   如果要启动项要删除tomcat,sysv-rc-conf tomcat remove

猜你喜欢

转载自blog.csdn.net/xiaohanshasha/article/details/81772611