Skip to content

Commit

Permalink
Add elemental-register-reset.service
Browse files Browse the repository at this point in the history
  • Loading branch information
anmazzotti authored and davidcassany committed Aug 30, 2023
1 parent d09c2c4 commit d301e1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .obs/specfile/elemental.spec
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%service_add_pre shutdown-containerd.service
%service_add_pre elemental-register.service
%service_add_pre elemental-register-install.service
%service_add_pre elemental-register-reset.service
%service_add_pre elemental-register.timer
%endif

Expand All @@ -86,12 +87,14 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%service_add_post shutdown-containerd.service
%service_add_post elemental-register.service
%service_add_post elemental-register-install.service
%service_add_post elemental-register-reset.service
%service_add_post elemental-register.timer
%else
%systemd_post elemental-populate-node-labels.service
%systemd_post shutdown-containerd.service
%systemd_post elemental-register.service
%systemd_post elemental-register-install.service
%systemd_post elemental-register-reset.service
%systemd_post elemental-register.timer
%endif

Expand All @@ -101,12 +104,14 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%service_del_preun shutdown-containerd.service
%service_del_preun elemental-register.service
%service_del_preun elemental-register-install.service
%service_del_preun elemental-register-reset.service
%service_del_preun elemental-register.timer
%else
%systemd_preun elemental-populate-node-labels.service
%systemd_preun shutdown-containerd.service
%systemd_preun elemental-register.service
%systemd_preun elemental-register-install.service
%systemd_preun elemental-register-reset.service
%systemd_preun elemental-register.timer
%endif

Expand All @@ -116,12 +121,14 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%service_del_postun shutdown-containerd.service
%service_del_postun elemental-register.service
%service_del_postun elemental-register-install.service
%service_del_postun elemental-register-reset.service
%service_del_postun elemental-register.timer
%else
%systemd_postun elemental-populate-node-labels.service
%systemd_postun shutdown-containerd.service
%systemd_postun elemental-register.service
%systemd_postun elemental-register-install.service
%systemd_postun elemental-register-reset.service
%systemd_postun elemental-register.timer
%endif

Expand All @@ -141,6 +148,7 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%{_unitdir}/shutdown-containerd.service
%{_unitdir}/elemental-register.service
%{_unitdir}/elemental-register-install.service
%{_unitdir}/elemental-register-reset.service
%{_unitdir}/elemental-register.timer
%{_unitdir}/elemental-populate-node-labels.service
%{_sbindir}/elemental-populate-node-labels
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Elemental Register Reset
Documentation=https://elemental.docs.rancher.com
Wants=network-online.target
After=network-online.target
ConditionPathExists=/run/cos/recovery_mode

[Service]
EnvironmentFile=-/etc/default/elemental
EnvironmentFile=-/etc/sysconfig/proxy
Type=oneshot
ExecStart=/usr/sbin/elemental-register --debug --reset
Restart=on-failure
RestartSec=5

0 comments on commit d301e1b

Please sign in to comment.