-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run "rke2-killall.sh" before shutdown
Create a service to run script `rke2-killall.sh` to stop all the running containers. Signed-off-by: John Liu <john.liu@suse.com>
- Loading branch information
John Liu
committed
Apr 12, 2022
1 parent
6bfeb2d
commit 1017d3c
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
package/harvester-os/files/etc/systemd/system/rke2-shutdown.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Kill RKE2 Containers for clean unmount | ||
DefaultDependencies=no | ||
RefuseManualStart=yes | ||
Before=reboot.target halt.target shutdown.target poweroff.target umount.target final.target | ||
|
||
[Install] | ||
RequiredBy=reboot.target halt.target shutdown.target poweroff.target umount.target final.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=-/usr/local/bin/rke2-killall.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "Enable RKE2 shutdown service" | ||
stages: | ||
initramfs: | ||
- name: "enable rke2-shutdown.service" | ||
if: 'grep -q root=LABEL=COS_ACTIVE /proc/cmdline && [ -n "$(blkid -L COS_ACTIVE)" ]' | ||
commands: | ||
- systemctl enable rke2-shutdown.service |