Skip to content

Commit

Permalink
chore: [NODE-1488] Fixup services (#1837)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bownairo authored Oct 18, 2024
1 parent 944b8d0 commit dff73c6
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Node Exporter
After=syslog.target network.target
After=network.target

[Service]
User=node_exporter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[Unit]
Description=Set up hostname
Before=systemd-networkd.target
DefaultDependencies=no
After=bootstrap-ic-node.service
Before=systemd-networkd.service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[Unit]
Description=Set up hostname
Before=systemd-networkd.target
DefaultDependencies=no
Before=systemd-networkd.service
After=systemd-tmpfiles-setup.service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[Unit]
Description=Set up hostname
Before=systemd-networkd.target
Before=systemd-networkd.service
DefaultDependencies=no
After=bootstrap-ic-node.service
Before=systemd-networkd.service

[Install]
WantedBy=multi-user.target
Expand Down
14 changes: 7 additions & 7 deletions ic-os/components/guestos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ component_files = {
Label("ic/ic.json5.template"): "/opt/ic/share/ic.json5.template",

# init
Label("init/bootstrap-ic-node/guestos/bootstrap-ic-node.sh"): "/opt/ic/bin/bootstrap-ic-node.sh",
Label("init/bootstrap-ic-node/guestos/bootstrap-ic-node.service"): "/etc/systemd/system/bootstrap-ic-node.service",
Label("init/setup-encryption/guestos/setup-encryption.sh"): "/opt/ic/bin/setup-encryption.sh",
Label("init/setup-encryption/guestos/setup-encryption.service"): "/etc/systemd/system/setup-encryption.service",
Label("init/setup-encryption/guestos/setup-var-encryption.sh"): "/opt/ic/bin/setup-var-encryption.sh",
Label("init/bootstrap-ic-node/bootstrap-ic-node.sh"): "/opt/ic/bin/bootstrap-ic-node.sh",
Label("init/bootstrap-ic-node/bootstrap-ic-node.service"): "/etc/systemd/system/bootstrap-ic-node.service",
Label("init/setup-encryption/setup-encryption.sh"): "/opt/ic/bin/setup-encryption.sh",
Label("init/setup-encryption/setup-encryption.service"): "/etc/systemd/system/setup-encryption.service",
Label("init/setup-encryption/setup-var-encryption.sh"): "/opt/ic/bin/setup-var-encryption.sh",
Label("init/setup-lvs/setup-lvs.service"): "/etc/systemd/system/setup-lvs.service",
Label("init/setup-lvs/guestos/setup-lvs.sh"): "/opt/ic/bin/setup-lvs.sh",

# misc
Label("misc/logging.sh"): "/opt/ic/bin/logging.sh",
Label("misc/metrics.sh"): "/opt/ic/bin/metrics.sh",
Label("misc/serial-getty@/guestos/[email protected]"): "/etc/systemd/system/[email protected]",
Label("misc/serial-getty@/guestos/override.conf"): "/etc/systemd/system/[email protected].d/override.conf",
Label("misc/chrony/chrony.conf"): "/etc/chrony/chrony.conf",
Label("misc/chrony/chrony-var.service"): "/etc/systemd/system/chrony-var.service",
Label("misc/vsock/10-vhost-vsock.rules"): "/etc/udev/rules.d/10-vhost-vsock.rules",
Expand Down Expand Up @@ -88,7 +88,7 @@ component_files = {

# networking
Label("networking/generate-network-config/guestos/generate-network-config.service"): "/etc/systemd/system/generate-network-config.service",
Label("networking/retry-ipv6-config/guestos/retry-ipv6-config.sh"): "/opt/ic/bin/retry-ipv6-config.sh",
Label("networking/retry-ipv6-config/retry-ipv6-config.sh"): "/opt/ic/bin/retry-ipv6-config.sh",
Label("networking/retry-ipv6-config/retry-ipv6-config.service"): "/etc/systemd/system/retry-ipv6-config.service",
Label("networking/nftables/reload_nftables.path"): "/etc/systemd/system/reload_nftables.path",
Label("networking/nftables/reload_nftables.service"): "/etc/systemd/system/reload_nftables.service",
Expand Down
3 changes: 3 additions & 0 deletions ic-os/components/misc/serial-getty@/guestos/override.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/opt/ic/bin/infogetty -r /etc/allow_console_root /dev/%I
35 changes: 0 additions & 35 deletions ic-os/components/misc/serial-getty@/guestos/[email protected]

This file was deleted.

3 changes: 3 additions & 0 deletions ic-os/components/misc/serial-getty@/setupos/override.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty -p -a root -o '-p -- \\u' --keep-baud 115200,38400,9600 %I $TERM
40 changes: 0 additions & 40 deletions ic-os/components/misc/serial-getty@/setupos/[email protected]

This file was deleted.

1 change: 0 additions & 1 deletion ic-os/components/misc/vsock/vsock-agent.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[Unit]
Description=VSOCK agent daemon
After=syslog.target

[Service]
User=root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Node Exporter
After=syslog.target network.target
After=network.target

[Service]
User=node_exporter
Expand Down
2 changes: 1 addition & 1 deletion ic-os/components/setupos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ component_files = {
Label("misc/chrony/chrony.conf"): "/etc/chrony/chrony.conf",
Label("misc/chrony/chrony-var.service"): "/etc/systemd/system/chrony-var.service",
Label("misc/fetch-property.sh"): "/opt/ic/bin/fetch-property.sh",
Label("misc/serial-getty@/setupos/[email protected]"): "/etc/systemd/system/[email protected]",
Label("misc/serial-getty@/setupos/override.conf"): "/etc/systemd/system/[email protected].d/override.conf",
Label("monitoring/journald.conf"): "/etc/systemd/journald.conf",

# networking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ DefaultDependencies=no
Requires=dev-mapper-store\x2dshared\x2d\x2ddata.device
After=dev-mapper-store\x2dshared\x2d\x2ddata.device
Before=systemd-fsck@dev-mapper-store\x2dshared\x2d\x2ddata.service
Before=var-lib-ic-data\x2dnode.mount
# 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
Expand All @@ -15,7 +14,6 @@ Requires=setup-lvs.service

[Install]
RequiredBy=systemd-fsck@dev-mapper-store\x2dshared\x2d\x2ddata.service
RequiredBy=var-lib-ic-data\x2dnode.mount
WantedBy=local-fs.target

[Service]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function make_var_cryptsetup() {
echo "Description=Cryptography Setup for var_crypt"
echo "DefaultDependencies=no"
echo "IgnoreOnIsolate=true"
echo "After=setup-encryption.service"
echo "After=cryptsetup-pre.target"
echo "Before=blockdev@dev-mapper-var_crypt.target"
echo "Wants=blockdev@dev-mapper-var_crypt.target"
Expand Down Expand Up @@ -99,5 +98,5 @@ make_requires localfs.target boot.mount
make_requires boot-efi.mount boot.mount
make_requires boot-grub.mount boot.mount

make_var_cryptsetup "$CURRENT_SYSTEM" >"$UNIT_DIR"/cryptsetup@var_crypt.service
make_requires dev-mapper-var_crypt.device cryptsetup@var_crypt.service
make_var_cryptsetup "$CURRENT_SYSTEM" >"$UNIT_DIR"/systemd-cryptsetup@var_crypt.service
make_requires dev-mapper-var_crypt.device systemd-cryptsetup@var_crypt.service

0 comments on commit dff73c6

Please sign in to comment.