提交 ffd44993 编写于 作者: R Ray

更新启动脚本 加入systemd

上级 c3093887
echo "ready to stop server $(cd "$(dirname "$0")"; pwd)"
$(cd "$(dirname "$0")"; pwd)/jvm/linux_java11/bin/java -javaagent:$(cd "$(dirname "$0")"; pwd)/console.jar -cp $(cd "$(dirname "$0")"; pwd)/console.jar com.x.server.console.swapcommand.Exit
echo 'check server stoped wait 2s-10s'
sleep 2
PID=`ps -ef | grep "$(cd "$(dirname "$0")"; pwd)" | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
sleep 8
if [ "X$PID" != "X" ]
then
echo ready to kill server $PID
kill -9 $PID
fi
fi
echo 'server stoped ready to start'
$(cd "$(dirname "$0")"; pwd)/start_linux.sh
current_dir="$(cd "$(dirname "$0")"; pwd)"
${current_dir}/stop_linux.sh
${current_dir}/start_linux.sh
\ No newline at end of file
current_dir="$(
cd "$(dirname "$0")"
pwd
)"
if [ -z "$1" ]; then
echo "usage: ./service_linux_install.sh name [start.sh default is start_linux.sh]"
exit
fi
name="$1"
scriptFile="start_linux.sh"
if [ -z "$2" ]; then
echo "use ${current_dir}/${scriptFile} as start script."
else
scriptFile="$2"
fi
if [ ! -f ${current_dir}/${scriptFile} ]; then
echo "start script ${current_dir}/${scriptFile} not exist."
exit
fi
servicefile="/etc/systemd/system/${name}.service"
echo "[Unit]" >${servicefile}
echo "Description=o2server name:${name}" >>${servicefile}
echo "Wants=network-online.target" >>${servicefile}
echo "After=network.target" >>${servicefile}
echo "[Service]" >>${servicefile}
echo "Type=simple" >>${servicefile}
echo "ExecStart=${current_dir}/start_linux.sh" >>${servicefile}
echo "ExecReload=${current_dir}/restart_linux.sh" >>${servicefile}
echo "ExecStop=${current_dir}/stop_linux.sh" >>${servicefile}
echo "[Install]" >>${servicefile}
echo "WantedBy=multi-user.target" >>${servicefile}
$(cd "$(dirname "$0")"; pwd)/jvm/linux_java11/bin/java -javaagent:$(cd "$(dirname "$0")"; pwd)/console.jar -cp $(cd "$(dirname "$0")"; pwd)/console.jar com.x.server.console.swapcommand.Exit
current_dir="$(cd "$(dirname "$0")"; pwd)"
echo "ready to stop o2server path: ${current_dir}"
${current_dir}/jvm/linux_java11/bin/java -javaagent:${current_dir}/console.jar -cp ${current_dir}/console.jar com.x.server.console.swapcommand.Exit
sleep 10
PID=`ps -ef | grep "${current_dir}/jvm/linux_java11/bin/java" | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
sleep 5
if [ "X$PID" != "X" ]
then
echo ready to kill server $PID
kill -9 $PID
fi
fi
\ No newline at end of file
......@@ -138,7 +138,6 @@ public class DumpData {
List<String> list = new ArrayList<>();
if (StringUtils.equals(Config.dumpRestoreData().getMode(), DumpRestoreData.TYPE_FULL)) {
list.addAll((List<String>) Config.resource(Config.RESOURCE_CONTAINERENTITYNAMES));
//return list;
}else {
for (String str : (List<String>) Config.resource(Config.RESOURCE_CONTAINERENTITYNAMES)) {
Class<?> cls = Thread.currentThread().getContextClassLoader().loadClass(str);
......
package com.x.server.console.action;
import java.util.LinkedHashMap;
public class DumpRestoreStorageCatalog extends LinkedHashMap<String, DumpRestoreStorageCatalogItem> {
private static final long serialVersionUID = 3233230359546489069L;
}
package com.x.server.console.action;
import com.x.base.core.project.gson.GsonPropertyObject;
public class DumpRestoreStorageCatalogItem extends GsonPropertyObject {
private Integer count;
private Long size;
private Integer invalidStorage;
private Integer empty;
private Integer normal;
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Long getSize() {
return size;
}
public void setSize(Long size) {
this.size = size;
}
public Integer getInvalidStorage() {
return invalidStorage;
}
public void setInvalidStorage(Integer invalidStorage) {
this.invalidStorage = invalidStorage;
}
public Integer getEmpty() {
return empty;
}
public void setEmpty(Integer empty) {
this.empty = empty;
}
public Integer getNormal() {
return normal;
}
public void setNormal(Integer normal) {
this.normal = normal;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册