Обсуждение: BAD SU operator at Postgresql startup (during boot)
Hello. I am new to Postgresql and I am having a problem with starting it in FreeBSD at boot time. (Also, my user account is pgsql not postgresql) Presently, I have this command in my /etc/rc.conf file: su pgsql -c "/usr/local/bin/postmaster -D /usr/local/pgsql/data" Postgresql does start at bootup and the ports are listening (5432). However, every 5-10 minutes a message pops up on theconsole screen: su: in prompt_echo_off(): tcgetattr(): Inappropriate ioctl for device su: BAD SU operator to pgsql on tty and then a message appears in mail:
"Hal Shearer" <bshearer@lynchburg.net> writes: > I am new to Postgresql and I am having a problem with starting it in FreeBSD at boot time. It sounds to me like you started it just fine. The mail message suggests that the error is coming from some cron script that's fired every few minutes. Look in your cron jobs ... regards, tom lane
Tom - thanks for responding! I have been trying to get this posted for two days now so I'm glad my message finally showed up. After umpteen million attempts at getting this installed I think I found the missing clue. It is not cron (that's what I thought initially). To start Postgresql automatically during boot up I had to do the following: 1. After the install was complete I issued the following command: su -l pgsql -c "/usr/local/bin/initdb" 2. edited postgresql.conf: vi /usr/local/pgsql/data/postgresql.conf where I uncommented tcpip_socket and changed it to true and I uncommented the line port = 5432 3. I then issued this command: /usr/local/etc.rc.d/010.pgsql.sh start 4. Issued this command to ensure it was up and running: netstat -an | grep 5432 5. It was up and now all is well with the universe. AND no more "BAD SU" For me the issue was getting this installed so after a boot it was up and running. I never found steps 2 or 3 in the documentation. I actually found it accidentally during the install. My paused right at the page where these two steps were being described. Shame on the Postgresql folks for putting something as important as his in a screen that would roll off quickly and it should be in their FAQs somewhere. That was a friendly rant & suggestion. ;) -----Original Message----- From: pgsql-novice-owner@postgresql.org [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Tom Lane Sent: Tuesday, May 17, 2005 11:47 AM To: bshearer@lynchburg.net Cc: pgsql-novice@postgresql.org Subject: Re: [NOVICE] BAD SU operator at Postgresql startup (during boot) "Hal Shearer" <bshearer@lynchburg.net> writes: > I am new to Postgresql and I am having a problem with starting it in FreeBSD at boot time. It sounds to me like you started it just fine. The mail message suggests that the error is coming from some cron script that's fired every few minutes. Look in your cron jobs ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)