-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
22 changes: 22 additions & 0 deletions
22
ic-os/components/upgrade/shared-resources/setup-shared-resources/setup-shared-swap.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,22 @@ | ||
[Unit] | ||
Description=Setup shared-swap space | ||
DefaultDependencies=no | ||
Requires=dev-mapper-store\x2dshared\x2d\x2dswap.device | ||
After=dev-mapper-store\x2dshared\x2d\x2dswap.device | ||
Before=dev-mapper-store\x2dshared\x2d\x2dswap.swap | ||
# Add an explicit sequencing to LVM setup. The observed problem is that the | ||
# LV apparently becomes notified as "ready" through udev before the actual | ||
# lvcreate command has finished. This results in filesystem setup racing with | ||
# lvcreate performing a "wipe" of the LV, resulting in a destroyed filesystem | ||
# in turn. | ||
After=setup-lvs.service | ||
Requires=setup-lvs.service | ||
|
||
[Install] | ||
RequiredBy=systemd-fsck@dev-mapper-store\x2dshared\x2d\x2dswap.service | ||
WantedBy=local-fs.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=true | ||
ExecStart=/opt/ic/bin/setup-shared-swap.sh |
7 changes: 7 additions & 0 deletions
7
ic-os/components/upgrade/shared-resources/setup-shared-resources/setup-shared-swap.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 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
blkid /dev/mapper/store-shared--swap >/dev/null || ( | ||
mkswap /dev/mapper/store-shared--swap | ||
) |