From a9f3619901dad39d140e41540452140f25125847 Mon Sep 17 00:00:00 2001 From: Sumukha Tumkur Vani Date: Wed, 12 Feb 2020 16:38:45 -0800 Subject: [PATCH] Start RestAPI container when sonic boots (#4140) * Start RestAPI container when sonic boots --- files/build_templates/restapi.service.j2 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 files/build_templates/restapi.service.j2 diff --git a/files/build_templates/restapi.service.j2 b/files/build_templates/restapi.service.j2 new file mode 100644 index 000000000000..df1a50eb56c7 --- /dev/null +++ b/files/build_templates/restapi.service.j2 @@ -0,0 +1,16 @@ +[Unit] +Description=RestAPI container +Requires=updategraph.service +After=updategraph.service +Before=ntp-config.service + +[Service] +User={{ sonicadmin_user }} +ExecStartPre=/usr/bin/{{docker_container_name}}.sh start +ExecStart=/usr/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/bin/{{docker_container_name}}.sh stop +Restart=always +RestartSec=30 + +[Install] +WantedBy=multi-user.target \ No newline at end of file