linux_fedora nexus_auto_start
vi /etc/rc.d/rc.local
#!/bin/bash
#this is a script foe nexus start,if the nexus is startting,return.
echo "nexus verify.."
testing8081=`(netstat -an|grep )`
if [ "NULL$testing8081" = "NULL" ] ; then
echo "nuxus starting..."
/home/Jorcen/Environments/nexus/nexus-2.7.-/bin/nexus start
else
echo -n "nexus had started,do you need restart it?(Y/N):"
read verify
if [ "$verify" = "Y" ] ; then
/home/Jorcen/Environments/nexus/nexus-2.7.-/bin/nexus restart
echo "nexus restared.."
fi
fi
编 辑文件/lib/systemd/system /rc-local.service,将ConditionFilel***ecutable=/etc/rc.d/rc.local前面奖赏#号注释掉 及#ConditionFilel***ecutable=/etc/rc.d/rc.local
[root@localhost Jorcen]# vi /lib/systemd/system/rc-local.service # This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version. # This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
#ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target [Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=
RemainAfterExit=yes
SysVStartPriority=
step2
[root@localhost Jorcen]# chmod +x /etc/rc.d/rc.local
[root@localhost Jorcen]# ln -s /etc/rc.d/rc.local /etc/rc.local
[root@localhost Jorcen]# systemctl status rc-local.service
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
Active: failed (Result: exit-code) since Sat -- :: CST; 2min 44s ago
Process: ExecStart=/etc/rc.d/rc.local start (code=exited, status=/EXEC) Mar :: localhost.localdomain systemd[]: Starting /etc/rc.d/rc.local...
Mar :: localhost.localdomain systemd[]: rc-local.service: control p...
Mar :: localhost.localdomain systemd[]: Failed to start /etc/rc.d/r...
Mar :: localhost.localdomain systemd[]: Unit rc-local.service enter...
[root@localhost Jorcen]# systemctl start rc-local.service
[root@localhost Jorcen]# systemctl status rc-local.service
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
Active: active (running) since Sat -- :: CST; 27s ago
Process: ExecStart=/etc/rc.d/rc.local start (code=exited, status=/SUCCESS)
Main PID: (wrapper)
CGroup: name=systemd:/system/rc-local.service
├─ /home/Jorcen/Environments/nexus/nexus-2.7.-/bin/jsw/linux-x86-/wrapper /home/Jorcen/Environments/nexus/nexus-2.7.-/bin/js...
└─ java -Djava.net.preferIPv4Stack=true -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl -Djava.library.path=bin/jsw/lib -classpa... Mar :: localhost.localdomain systemd[]: Starting /etc/rc.d/rc.local Compatibility...
Mar :: localhost.localdomain rc.local[]: nexus verify..
Mar :: localhost.localdomain rc.local[]: nuxus starting...
Mar :: localhost.localdomain rc.local[]: ****************************************
Mar :: localhost.localdomain rc.local[]: WARNING - NOT RECOMMENDED TO RUN AS ROOT
Mar :: localhost.localdomain rc.local[]: ****************************************
Mar :: localhost.localdomain rc.local[]: Starting Nexus OSS...
Mar :: localhost.localdomain rc.local[]: Removed stale pid file: /home/Jorcen/Environments/nexus/nexus-2.7.-/nexus.pid
Mar :: localhost.localdomain systemd[]: Started /etc/rc.d/rc.local Compatibility.
linux_fedora nexus_auto_start的更多相关文章
随机推荐
- 十、Notepad++正则表达式使用
推荐个正则表达式在线测试的工具http://ccmpp.com/Regex/ Notepad++正则表达式使用 2011-01-06 10:01:35| 分类: 文档 | 标签:正则表达式 替换 no ...
- C#完全无客户端访问Oracle
网上太多的C#无客户端访问oracle案例,经我测试无一成功,特将我在oracle官网上和自己琢磨总结,终于成功,废话不多说,直接上项目. 一,准备条件 (由于我这里是用的控制台程序来测试的,所以将上 ...
- 在浏览器中打开本地应用(iOS)
在浏览器中点击跳转到本地应用的方法(如果本地没有安装的话) 然后在浏览器中输入tianxiang://就能打开这个应用了 ................省略 遇到一个12年还是初中的小朋友,
- sql server 修改列类型
如下代码中为修改bcp数据库中表B_TaskFileMonitor中的列FileSizeOriginal的类型为bigint use bcp; ); --判断是否存在这一列 IF COL_LENGTH ...
- C语言获取系统时间的几种方式[转]
C语言获取系统时间的几种方式 C语言中如何获取时间?精度如何? 1 使用time_t time( time_t * timer ) 精确到秒 2 使用clock_t clock() 得到的是CPU时间 ...
- 推荐7款新鲜出炉的HTML5/CSS3应用
1.HTML5/CSS3发光文字可自定义文字色彩效果很赞 要分享的这款HTML5/CSS3文字效果很帅,鼠标滑过文字时,文字会出现发光的特效,并且我们可以自定义文字和颜色. 在线演示 源码下载 2.H ...
- 配置Qt开发环境下的OpenCV开发
1.使用CMake工具(http://www.cmak.org),选择MinGW Makefile. *一定要注意编译的版本要与Qt的mingw32的版本相同.否则容易出现undefined refe ...
- vector C++ 详细用法
vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库.vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vec ...
- c# 取得ip地址和网关
/// <summary> /// 得到本机IP /// </summary> private string GetLocalIP() { //本机IP地址 string st ...
- php解析url的三种方法举例
使用php解析url的三个示例. 方法一: $url="http://www.jbxue.com"; file_get_contents($url); 方法二: // CURL 方 ...