Skip to content

Commit

Permalink
Merge pull request #481 from amazonlinux/mark-successful-boot
Browse files Browse the repository at this point in the history
Add a service to call signpost when we determine that the boot was successful
  • Loading branch information
tjkirch authored Nov 15, 2019
2 parents 33fb6fc + f25198b commit 7342e4e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/kubernetes/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Wants=configured.target
BindsTo=containerd.service

[Service]
Type=notify
EnvironmentFile=/etc/kubernetes/kubelet/env
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT
# Pull the pause container image before starting `kubelet` so `containerd/cri` wouldn't have to
Expand Down Expand Up @@ -38,3 +39,4 @@ MemoryAccounting=true

[Install]
WantedBy=multi-user.target
RequiredBy=mark-successful-boot.service
13 changes: 13 additions & 0 deletions packages/workspaces/mark-successful-boot.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Call signpost to mark the boot as successful after all required targets are met.
After=multi-user.target
# Each service that must start correctly in order for a boot to be successful should be of type "notify"
# and include "RequiredBy=mark-successful-boot.service" in its [Install] section.

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/signpost mark-successful-boot

[Install]
WantedBy=multi-user.target
5 changes: 4 additions & 1 deletion packages/workspaces/workspaces.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Source106: migrator.service
Source107: host-containers@.service
Source108: updog.timer
Source109: updog.service
Source110: mark-successful-boot.service

# 2xx sources: tmpfilesd configs
Source200: migration-tmpfiles.conf
Expand Down Expand Up @@ -197,7 +198,8 @@ install -p -m 0644 %{S:5} %{buildroot}%{_cross_templatedir}

install -d %{buildroot}%{_cross_unitdir}
install -p -m 0644 \
%{S:100} %{S:101} %{S:102} %{S:103} %{S:104} %{S:105} %{S:106} %{S:107} %{S:108} %{S:109} \
%{S:100} %{S:101} %{S:102} %{S:103} %{S:104} %{S:105} \
%{S:106} %{S:107} %{S:108} %{S:109} %{S:110} \
%{buildroot}%{_cross_unitdir}

install -d %{buildroot}%{_cross_tmpfilesdir}
Expand Down Expand Up @@ -263,6 +265,7 @@ install -p -m 0644 %{S:201} %{buildroot}%{_cross_tmpfilesdir}/host-containers.co

%files -n %{_cross_os}signpost
%{_cross_bindir}/signpost
%{_cross_unitdir}/mark-successful-boot.service

%files -n %{_cross_os}updog
%{_cross_bindir}/updog
Expand Down

0 comments on commit 7342e4e

Please sign in to comment.