みなさんこんにちは、sturtupでスクリプトを実行するか、ネットワークのセルタップを実行しますか?質問は愚かかもしれないUbuntu17.04
は、私がグーグルを試みたが、何も私のために動作しません。
だから私は必要なもののインターフェイスのENO1後に起動時にスクリプトを実行し、アップeno2することであり、そのIPアドレスを得た:
#!/bin/sh
ip rule add from 172.28.1.0/24 pref 200 lookup 201
ip route add default via 172.28.1.1 dev eno1 table 201
ip rule add from 172.28.2.0/24 pref 200 lookup 202
ip route add default via 172.28.2.1 dev eno2 table 202
ip route add default nexthop via 172.28.1.1 dev eno1
ip route append default nexthop via 172.28.2.1 dev eno2
ip route flush cache
systemctl start apache2
これは、セットアップにいくつかのネットワークパラメータです。 は、だから私は試してみました:
1は、このスクリプトを追加し、私は/etc/rc.localのファイルを持っていないので、
2、働いていない
をに/etc/rc.localにコマンドを追加しますそれはsudoの権限が必要と仮定して動作していないスタートアップアプリケーション
(起動時に、sudoでスクリプトを実行する方法がわからない)
3.Add initスクリプト(廃止)
あまりにもうまくいきません、私は前のケースのようにsudoの権利のために仮定します。
コメント:
no listening sockets available, shutting down
はEDIT:: 私はサービス作成 - net_conf.service:システムが起動した後、apache2のは、次のエラーで終了したので、私はやる、apache2のを開始systemctl
[Unit]
After=network-online.target
[Service]
ExecStart=/network_configuration/conf.sh
[Install]
WantedBy=default.target
を
私のスクリプトはconf.shです。以下でご覧になれます。
それ次(systemctlステータスnet_conf.service)の結果:
Oct 10 23:02:09 loraserver conf.sh[1848]: RTNETLINK answers: Network is unreachable
Oct 10 23:02:09 loraserver conf.sh[1848]: RTNETLINK answers: File exists
Oct 10 23:02:09 loraserver conf.sh[1848]: RTNETLINK answers: Network is unreachable
Oct 10 23:02:09 loraserver conf.sh[1848]: RTNETLINK answers: Network is unreachable
Oct 10 23:02:09 loraserver conf.sh[1848]: RTNETLINK answers: Network is unreachable
Oct 10 23:02:09 loraserver conf.sh[1848]: Job for apache2.service failed because the control process exited with error code.
Oct 10 23:02:09 loraserver conf.sh[1848]: See "systemctl status apache2.service" and "journalctl -xe" for details.
EDIT2: はまた-s -q --timeout = 30と120引数でエグゼス開始に追加しようとしました。動作しません。 提案がありますか?
お手数ですが、よろしくお願いいたします。
敬具、 オレグSomovにsystemdは、システムサービスを開始するためのシステムである(と思うバージョン15.04以降のUbuntuを含む)のLinuxの新しいバージョンで