feat(dgn-console): Add perf
All checks were successful
build configuration / build_vault01 (push) Successful in 1m8s
build configuration / build_storage01 (push) Successful in 1m9s
build configuration / build_compute01 (push) Successful in 1m15s
lint / check (push) Successful in 26s
build configuration / build_web01 (push) Successful in 1m30s
build configuration / build_web02 (push) Successful in 57s
build configuration / build_rescue01 (push) Successful in 1m13s
build configuration / push_to_cache (push) Successful in 2m16s

This commit is contained in:
Tom Hubrecht 2024-04-28 19:16:56 +02:00
parent 4e7b3154da
commit 17a6e085b5

View file

@ -76,30 +76,32 @@ in
mtr mtr
tcpdump tcpdump
]) ])
++ lib.optional ++ [ config.boot.kernelPackages.perf ]
(config.services.postgresql.enable && config.services.postgresql.package != cfg.pg-upgrade-to) ++
( lib.optional
pkgs.writeScriptBin "upgrade-pg-cluster" '' (config.services.postgresql.enable && config.services.postgresql.package != cfg.pg-upgrade-to)
set -eux (
# XXX it's perhaps advisable to stop all services that depend on postgresql pkgs.writeScriptBin "upgrade-pg-cluster" ''
systemctl stop postgresql set -eux
# XXX it's perhaps advisable to stop all services that depend on postgresql
systemctl stop postgresql
export NEWDATA="/var/lib/postgresql/${cfg.pg-upgrade-to.psqlSchema}" export NEWDATA="/var/lib/postgresql/${cfg.pg-upgrade-to.psqlSchema}"
export NEWBIN="${cfg.pg-upgrade-to}/bin" export NEWBIN="${cfg.pg-upgrade-to}/bin"
export OLDDATA="${config.services.postgresql.dataDir}" export OLDDATA="${config.services.postgresql.dataDir}"
export OLDBIN="${config.services.postgresql.package}/bin" export OLDBIN="${config.services.postgresql.package}/bin"
install -d -m 0700 -o postgres -g postgres "$NEWDATA" install -d -m 0700 -o postgres -g postgres "$NEWDATA"
cd "$NEWDATA" cd "$NEWDATA"
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA" sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"
sudo -u postgres $NEWBIN/pg_upgrade \ sudo -u postgres $NEWBIN/pg_upgrade \
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \ --old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
--old-bindir $OLDBIN --new-bindir $NEWBIN \ --old-bindir $OLDBIN --new-bindir $NEWBIN \
"$@" "$@"
'' ''
); );
}; };
} }