forked from DGNum/infrastructure
feat(dgn-console): Add perf
This commit is contained in:
parent
4e7b3154da
commit
17a6e085b5
1 changed files with 22 additions and 20 deletions
|
@ -76,30 +76,32 @@ in
|
|||
mtr
|
||||
tcpdump
|
||||
])
|
||||
++ lib.optional
|
||||
(config.services.postgresql.enable && config.services.postgresql.package != cfg.pg-upgrade-to)
|
||||
(
|
||||
pkgs.writeScriptBin "upgrade-pg-cluster" ''
|
||||
set -eux
|
||||
# XXX it's perhaps advisable to stop all services that depend on postgresql
|
||||
systemctl stop postgresql
|
||||
++ [ config.boot.kernelPackages.perf ]
|
||||
++
|
||||
lib.optional
|
||||
(config.services.postgresql.enable && config.services.postgresql.package != cfg.pg-upgrade-to)
|
||||
(
|
||||
pkgs.writeScriptBin "upgrade-pg-cluster" ''
|
||||
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 OLDBIN="${config.services.postgresql.package}/bin"
|
||||
export OLDDATA="${config.services.postgresql.dataDir}"
|
||||
export OLDBIN="${config.services.postgresql.package}/bin"
|
||||
|
||||
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
|
||||
cd "$NEWDATA"
|
||||
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"
|
||||
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
|
||||
cd "$NEWDATA"
|
||||
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"
|
||||
|
||||
sudo -u postgres $NEWBIN/pg_upgrade \
|
||||
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
|
||||
--old-bindir $OLDBIN --new-bindir $NEWBIN \
|
||||
"$@"
|
||||
''
|
||||
);
|
||||
sudo -u postgres $NEWBIN/pg_upgrade \
|
||||
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
|
||||
--old-bindir $OLDBIN --new-bindir $NEWBIN \
|
||||
"$@"
|
||||
''
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue