linux中实现jboss自启动

news/2024/7/8 6:10:06

在该目录/etc/rc.d/init.d/中

创建文件:jboss 内容如下

# cat /etc/rc.d/init.d/jboss
   #!/bin/bash
   # chkconfig: 2345 99 01
   # description: JBoss 3.2.3

   case "$1" in
   start)
        su - root -c '/jboss/jboss/bin/run.sh &'
        ;;
   stop)
        su - root -c '/jboss/jboss/bin/shutdown.sh -S &'
        ;;
   *)
        echo "Usage: jboss { start | stop }"
        ;;
   esac

第二种方法:

在/etc/rc.d中的文件rc.local中:

加入可以自启动jboss和oracle

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
su - root -c '/jboss/jboss/bin/run.sh &'
su - oracle -c '/u01/app/oracle/oracle/product/10.2.0/db_1/bin/lsnrctl start'
su - oracle -c '/u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart start'


http://www.niftyadmin.cn/n/1733235.html

相关文章

重启虚拟机启动Docker常见问题

文章目录重启虚拟机启动Docker常见问题一、Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?二、admin is not in the sudoers file. This incident will be reported.(没有这个问题请自觉跳过)三、…

ESP8266接温度传感器18B20时序校准

陈拓 chentuoms.xab.ac.cn 2020/06/22-2020/06/25 1. 概述 在《ESP8266_SDK发送温度数据到阿里云》 https://blog.csdn.net/chentuo2000/article/details/105592791 https://zhuanlan.zhihu.com/p/132582024 一文中我们将温度传感器DS18B20的温度数据传送到了阿里云物联网平…

RabbitMQ第四个实操小案例——DirectExchange

文章目录RabbitMQ第四个实操小案例——DirectExchangeRabbitMQ第四个实操小案例——DirectExchange DirectExchange:这种交换机的模式跟前面的Fouout(广播)不太一样,DirectExchange 会将接收到的消息根据规则路由到指定的Queue&a…

javascript面向对象技术基础(六)

http://sdcyst.javaeye.com/blog/296492作用域、闭包、模拟私有属性 先来简单说一下变量作用域,这些东西我们都很熟悉了,所以也不详细介绍。 Js代码 var sco "global"; //全局变量 function t() { var sco "local"; //函…

javascript面向对象技术基础(四)

http://sdcyst.javaeye.com/blog/288808类、构造函数、原型 先来说明一点:在上面的内容中提到,每一个函数都包含了一个prototype属性,这个属性指向了一个prototype对象(Every function has a prototype property that refers to a predefined prototype object --section8.6.…

树莓派安装Web服务器Boa和CGIC

树莓派安装Web服务器Boa和CGIC 陈拓 2020/08/01-2020/08/09 1. 树莓派换源 为了加快所需软件的下载,我们需要先换源。 首先查看系统版本:lsb_release -a修改软件更新源 /etc/apt/sources.list sudo nano /etc/apt/sources.list 在下面的语句前面加#注…

树莓派I2C通过Shell操作FDC2214

陈拓 chentuoms.xab.ac.cn 2020/07/21-2020/07/29 FDC2214是Ti公司的一款低功耗高精度的电容传感器芯片。本文讲述用树莓派Linux Shell配置和操作FDC2214,可以快速熟悉并进行原型开发。 1. 树莓派换源 为了加快所需软件的下载,我们需要先换源。 首先查…

界面渐变特效 -- CSS实现 -- 兼容IE8

特别注意:里面的RGB颜色值必须要全写,不能使用缩写。左右:background: -webkit-gradient(linear, 0 0, 0 100%, from(#80c1e7), to(#213c7c)); background: -webkit-linear-gradient(left, #80c1e7, #213c7c); background: -moz-linear-g…