Skip to content

Commit 475ca99

Browse files
committed
feat: fixing symlink issues, prestart bugs
1 parent 2e9c94a commit 475ca99

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ansible/files/postgres_prestart.sh.j2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ get_pg_cron_version() {
6262
return
6363
fi
6464

65-
log "pg_cron: Found version $version in extensions file"
66-
echo "$version"
65+
# Log the version but don't include it in the output
66+
log "pg_cron: Found version $version in extensions file" >&2
67+
printf "%s" "$version"
6768
}
6869

6970
switch_pg_cron_version() {
@@ -76,8 +77,8 @@ switch_pg_cron_version() {
7677
fi
7778

7879
log "pg_cron: Switching to version $version"
79-
# Run as postgres user since we're modifying their nix profile
80-
sudo -u postgres "$switch_script" "$version"
80+
# Run directly as root since we're already running as root
81+
"$switch_script" "$version"
8182
local exit_code=$?
8283
if [ $exit_code -eq 0 ]; then
8384
log "pg_cron: Version switch completed successfully"

nix/ext/pg_cron.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ stdenv.mkDerivation {
115115
116116
VERSION=$1
117117
NIX_PROFILE="/var/lib/postgresql/.nix-profile"
118-
LIB_DIR="$NIX_PROFILE/lib"
118+
LIB_DIR="$out/lib"
119119
EXTENSION_DIR="$NIX_PROFILE/share/postgresql/extension"
120120
121121
# Check if version exists

0 commit comments

Comments
 (0)