質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Go

Go(golang)は、Googleで開発されたオープンソースのプログラミング言語です。

Q&A

解決済

1回答

2183閲覧

CloudFront + S3でページを公開するも真っ白になってしまう

smilax

総合スコア23

Go

Go(golang)は、Googleで開発されたオープンソースのプログラミング言語です。

0グッド

0クリップ

投稿2020/10/16 02:02

編集2020/10/16 06:18

EC2上でgoのAPIサーバーを落ちた時に自動再起動するようにしたいのですが、unixファイルがうまく動かないので質問させていただきます。

サービスを実行すると下記のようなエラーでます。

app.service - Automatic start server demon Loaded: loaded (/home/ec2-user/etc/systemd/system/app.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since 木 2020-10-15 14:27:11 UTC; 11h ago Process: 23383 ExecStart=/home/ec2-user/cuee-user-bff/cuee-user-bff (code=exited, status=217/USER) Main PID: 23383 (code=exited, status=217/USER) 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: app.service: main process exited, code=exited, status=217/USER 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: Unit app.service entered failed state. 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: app.service failed. 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: app.service holdoff time over, scheduling restart. 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: start request repeated too quickly for app.service 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: Failed to start Automatic start server demon. 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: Unit app.service entered failed state. 10月 15 14:27:11 ip-xxxxxxxxx.ap-northeast-1.compute.internal systemd[1]: app.service failed.

ExecStartでバイナリを実行しているという認識だったのですが、間違いないでしょうか?
etc/systemd/system/app.service

[Unit] Description=Automatic start server demon [Service] ExecStart=/home/ec2-user/cuee-user-bff/cuee-user-bff WorkingDirectory=/home/ec2-user/cuee-user-bff Restart=always Type=simple User=ubuntu [Install] WantedBy=multi-user.target

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

対象のEC2ホストにsshログインして

cd /home/ec2-user/cuee-user-bff ./cuee-user-bff

としてみたときにエラーが出ていないか確認してみてください。

追記1

以下のようにユーザー指定で起動するか確認してみてください。

sudo -u ubuntu ./cuee-user-bff

投稿2020/10/16 02:52

編集2020/10/16 05:58
nobonobo

総合スコア3367

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

smilax

2020/10/16 05:43

問題なく動きます!
smilax

2020/10/16 06:13

sudo: 不明なユーザーです: ubuntu sudo: ポリシープラグインを初期化できません と出力されました
smilax

2020/10/16 06:16

ec2-userとしたらうまく行きました! ありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問