-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from GaloisInc/97-opensut-boot-systemd-unit
Add systemd unit for opensut_boot So far, we've been using the kernel argument `systemd.run=/opt/opensut/bin/opensut_boot` in each VM to run `opensut_boot` at boot time. With this approach, the network interfaces aren't enabled before `opensut_boot` runs, which is a problem for the autopilot component. This branch adds explicit systemd unit files for `opensut_boot`, which are similar to those generated by the `systemd.run` option but with an extra dependency on the network. We can then boot with `systemd.unit=opensut-boot.service` instead of the old `systemd.run` option, and systemd will bring up the network before starting `opensut_boot`.
- Loading branch information
Showing
13 changed files
with
68 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.img | ||
*.deb | ||
/target/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Systemd unit file that runs `opensut_boot` and then shuts down the VM. To | ||
# use this, boot with the kernel argument `systemd.unit=opensut-boot.target` | ||
# (note `.target` rather than `.service`). This is similar to booting with | ||
# `systemd.run=/opt/opensut/bin/opensut_boot` (and indeed these files are based | ||
# on the ones autogenerated by `systemd-run-generator`), but using a custom | ||
# unit file gives us more flexibility regarding dependencies. In particular, | ||
# we use this to delay running `opensut_boot` until after the network | ||
# interfaces have been set up. | ||
|
||
[Unit] | ||
Description=OpenSUT Boot Agent | ||
# Shut down the system once `opensut_boot` terminates. | ||
SuccessAction=exit | ||
FailureAction=exit | ||
# Debian's `networking.service` brings up the interfaces with `ifup`. Since | ||
# the OpenSUT VMs all use static IPs, the network should be ready immediately | ||
# (no need to wait for DHCP, etc). We could instead depend on systemd's | ||
# `network-online.target`, which waits "until the network is sufficiently set | ||
# up", but so far this doesn't seem necessary. | ||
Wants=networking.service | ||
After=networking.service | ||
|
||
[Service] | ||
Type=oneshot | ||
StandardOutput=journal+console | ||
ExecStart=/opt/opensut/bin/opensut_boot |
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,6 @@ | ||
# Systemd unit file that runs `opensut_boot` and then shuts down the VM. See | ||
# `opensut-boot.service` for details. | ||
[Unit] | ||
Description=OpenSUT Boot Agent | ||
Requires=opensut-boot.service | ||
After=opensut-boot.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
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
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
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