LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-10-2001, 03:40 AM   #1
marktaff
Member
 
Registered: Jun 2001
Location: Bellevue, WA (Seattle)
Distribution: SuSE 9.3-10.0
Posts: 53

Rep: Reputation: 15
PostgreSQL shell script help, please


All,

I need some help editing a shell script please. I have redhat 7.2.

I need to add the -i flag to the postmaster command line to enable remote connections (I am running pgadmin2 from my windows box).

This shell command worked(initially from root):

# su postgres
# /usr/bin/postmaster -i -D /var/lib/pgsql/data

Problem is, relevent line of the postgresql shell script is greek to me:

Code:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -i -D $PGDATA -p  /usr/bin/postmaster start  > /dev/null 2>&1" < /dev/null
here is a larger section, for contextual purposes:

Code:
else
		#all systems go -- remove any stale lock files
		rm -f /tmp/.s.PGSQL.* > /dev/null
		echo -n "$PSQL_START"
		# -i flag added by taff in line below
		su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -i -D $PGDATA -p  /usr/bin/postmaster start  > /dev/null 2>&1" < /dev/null
 		sleep 1
 		pid=`pidof -s postmaster`
 		if [ $pid ]
		then
			if echo "$TYPESET"|grep "declare -f success ()" >/dev/null
			then
				success "$PSQL_START"
			else
				echo "  [ OK ]"
			fi
			touch /var/lock/subsys/postgresql
			echo $pid > /var/run/postmaster.pid
			echo
		else
			if echo "$TYPESET"|grep "declare -f failure ()" >/dev/null
			then
				failure "$PSQL_START"
			else
				echo " [ FAILED ]"
			fi
			echo
		fi
	fi
}

Thanks.

Mark
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM
Connecting to PostgreSQL from PHP Script iaypaa Linux - Software 0 11-02-2002 04:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration