Solved Postgresql service won't start after upgrade to 13.2 from 13.1

My upgrade from 13.1 P7 to 13.2 went without issues. However, I have now discovered that I cannot start postgresql as I get the following error:
Code:
/usr/local/etc/rc.d/postgresql start
-su: Syntax error: redirection unexpected (expecting word)
Any ideas how I resolve this
 
I have just done that but attempting to start postgresql is still throwing the same error
 
The rc.conf has not been changed. Is there a file that initiates the service start that could have a rouge -su in it?

Code:
hostname="Ruru"
ifconfig_re0="DHCP"
clear_tmp_enable="YES"

# CREATE CLONED LOOPBACK DEVICE
cloned_interfaces="lo1"
#ipv4_addrs_lo1="10.2.2.1-9/29"
ifconfig_lo1_alias0="inet 10.2.2.2 netmask 255.255.255.255"
#gateway_enable="YES"

#START SERVICES
#autofs_enable="YES"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
linux_enable="YES"
mysql_enable="YES"
minidlna_enable="YES"
postgresql_enable="YES"
lpd_enable="NO"
cupsd_enable="YES"
apache24_enable="YES"
devfs_system_ruleset="common"
webcamd_enable="YES"
webcamd_0_flags="-d ugen2.5"
ntpd_enable="YES"
ntpd_config="/etc/ntp.conf"
ntp_leapfile_fetch_verbose="YES"
# JAILS
jail_enable=YES

# ENABLE PF FILTERING
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_program="/sbin/pfctl"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"

#START GUI INTERFACE
dbus_enable="YES"
gdm_enable="YES"
gnome_enable="YES"
#slim_enable="YES"
#moused_enable="YES"[CODE]
 
The startup script /usr/local/etc/rc.d/postgresql have su command inside it which call pg_ctl to be started as postgres user which is exactly where your get the error. Usually because of wrong pipe redirection or using "bash" instead "sh"

It look like this
# md5sum /usr/local/etc/rc.d/postgresql
d1aaef0530c6b37a26367608da39e149 /usr/local/etc/rc.d/postgresql

Code:
postgresql_command()
{
    ${su_cmd} -l ${postgresql_user} -c "exec ${command} ${command_args} ${rc_arg}"
}

The entire command look like this:
/usr/bin/su -l postgres -c "exec /usr/local/bin/pg_ctl -D /var/db/postgres/data13 -w -s -m fast start"
/usr/bin/su -l postgres -c "exec /usr/local/bin/pg_ctl -D /var/db/postgres/data13 -w -s -m fast stop"
 
My file is unchanged same checksum as yours

Tried your cmd and got the same error result

Code:
# md5sum /usr/local/etc/rc.d/postgresql
d1aaef0530c6b37a26367608da39e149  /usr/local/etc/rc.d/postgresql

and the postgres user is set up in passwd as
Code:
postgres:*:1002:1002:postgres:/home/postgres:/bin/sh[CODE]
 
Could this be a merge conflict that didn't get resolved after the update? Famously easy to end up with spurious "<<<<" lines in config files. Perhaps /etc/login.conf?
 
Yes that was it /etc/profile had rouge >>>>> & ====== from the merge. Once these were remove everything is working again. Thanks putney.
 
Back
Top