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的更多相关文章
随机推荐
- CSS之密码强度检测
输入密码后单击空白处即可检测. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht ...
- DataGrid实现逻辑分页
在ASP.NET内建提供的所有数据排列控件中,只有DataGrid数据控件是提供数据分页功能的.DataReapter数据控件只能提供一些简单 的.基础的数据重复排列功能,对于一些比较复杂的应用是无能 ...
- ZigBee HA示例程序分析
ZigBee协议栈中自带的HomeAutomation例程,虽然也是操作灯泡,但是,是通过ZCL来统一处理的,符合HA profile规范,互连互操作性较好.下面就简要分析以下ZCL的使用. 在任务数 ...
- SP避免Form重复提交的三种方案
SP避免Form重复提交的三种方案 1) javascript ,设置一个变量,只允许提交一次. <script language="javascript"> ...
- FPGA使用技巧
1 IOB 为了保证FPGA输入输出接口的时序,一般会要求将输入管脚首先打一拍再使用,输出接口也要打一拍再输出FPGA.将信号打一拍的方法是将信号通过一次寄存器,而且必须在IOB里面的寄存 ...
- Vivado HLS与System Generator:联系与区别
在很多年以前的ISE套件里面,有个功能强大的AccelDSP,它可以可自动地进行浮点到定点转换,并把算法生成可综合的HDL,还可以创建用于验证的测试平台,但是在4年前左右的时候销声匿迹了,当时的说法是 ...
- monkey 测试 adb shell monkey
adb shell monkey -p com.android.recorder --throttle 360 --ignore-crashes --monitor-native-crashes -- ...
- 如何在Mac下使用TF/SD 卡制作Exynos 4412 u-boot启动盘
/** ****************************************************************************** * @author Maox ...
- table的边框线的设置
http://hi.baidu.com/weisuotang/item/a1d98ec298c0aa49a8ba9447 http://www.cnblogs.com/xinlei/archive/2 ...
- XML和HTML常用转义字符
XML和HTML中都有一些特殊的字符,这些字符在XML和HTML中是不能直接使用的,如果必须使用这些字符,应该使用其对应的转义字符. XML常用转义字符: 字符 转义字符 描述 & & ...