spring boot init.d不起作用

时间:2015-12-23 01:38:55

标签: spring-boot

我按照spring boot参考指南安装服务作为init.d服务,但它似乎不起作用。知道这里可能出了什么问题吗?

AWS上的Ubuntu主机

$ cat /etc/issue
Ubuntu 14.04.3 LTS \n \l

根据参考文档

使用符号链接将应用程序安装为init.d服务
$ sudo ln -s /opt/services/account-history-service/account-history-service-0.0.1-217782-SNAPSHOT.jar /etc/init.d/account-history-service

$ sudo /etc/init.d/account-history-service status
sudo: /etc/init.d/account-history-service: command not found

$ sudo chmod +x /etc/init.d/account-history-service

尝试开始,但失败并出现以下错误

$ sudo /etc/init.d/account-history-service start
/etc/init.d/account-history-service: 1: /etc/init.d/account-history-service: Syntax error: "(" unexpected

知道可能出错了吗?这个版本的ubuntu不受支持吗?

1 个答案:

答案 0 :(得分:0)

这对我有用。首先确保您已在POM.xml中为完全可执行的jar配置了maven。然后重新构建应用程序并再次创建符号链接。

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style type="text/css">
table{
    margin:20px auto;
}
table td{
padding:10px;
    width:300px;
    background:#ededed;
}

button{
    display:block;
    margin:0 auto;
}
p{
    padding:10px;
    text-align:center;
}
</style>
</head>
<body>
<table id="table" valign="center">
<tr id="r1">
    <td class="select0">1</td>
    <td>
        <select class="select1">
            <option value="">First Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
        </select>
    </td>
    <td>
    <select class="select2">
            <option value="">Second Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
    </select>
    </td>
</tr>

<tr class="row">
    <td class="select0">2</td>
    <td>
        <select class="select1">
            <option value="">First Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
        </select>
    </td>
    <td>
    <select class="select2">
            <option value="0">Second Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
    </select>
    </td>
</tr>

<tr class="row">
    <td class="select0">3</td>
    <td>
        <select class="select1">
            <option value="0">First Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
        </select>
    </td>
    <td>
    <select class="select2">
            <option value="0">Second Select </option>
            <option value="value1">Option1 </option>
            <option value="value2">Option2 </option>
            <option value="value3">Option3 </option>
            <option value="value4">Option4 </option>
    </select>
    </td>
</tr>
</table>

<br>
<br>
<button class="button-click">Click Here</button>
<p id="output"></p>
<script>

$(".button-click").on("click",(function(){
    var arr = [];
    $("#table tr").each(function() {
    let temp = {};
        temp.WorkOrderID = $(this).find(".select0").html();
        temp.BlueDropdown = $(this).find(".select1").val();
        temp.GreenDropdown = $(this).find(".select2").val();
        arr.push(temp);
    });
    console.log(arr);
}));

</script>
</body>
</html>
</html>