LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-03-2005, 09:21 PM   #1
karlmdv
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware 10
Posts: 14

Rep: Reputation: 0
Nothing after rc.pgsql in rc.M starts


Hi guys,

I'm running slackware 10 and it seems that the call to rc.pgsql in rc.M causes rc.M to exit. The machine boots completely but nothing after Postgres starts, Postgres itself starts.

I don't know if it's related but a point to note is that the output from MySQL starting comes after 'echo "Finished starting MySQL"' (this just means MySQL forked right?)

Apache and everything after it doesn't start.

There doesn't seem to be anything abnormal in /var/log that I can see.

Any ideas?

TIA, Karl.

----------------
rc.M snippet
----------------
# Start the MySQL database:
if [ -x /etc/rc.d/rc.mysqld ]; then
echo "Started starting MySQL"
. /etc/rc.d/rc.mysqld start
echo "Finished starting MySQL"
fi

# Start the PostgreSQL database:
if [ -x /etc/rc.d/rc.pgsql ]; then
echo "Started starting PostgreSQL"
. /etc/rc.d/rc.pgsql start
echo "Finished starting PostgreSQL"
fi

# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
echo "Started starting Apache"
. /etc/rc.d/rc.httpd start
echo "Finished starting Apache"
fi

----------------
Bootup output snippet
----------------
Started starting MySQL
Finished starting MySQL
Started starting PostgreSQL
Starting PostgreSQL: Starting mysqld daemon with databases from /var/lib/mysql
ok

Welcome to Linux 2.4.26 (tty1)

linux login:
-----------------
rc.pgsql snippet
----------------
$ECHO_N "Starting PostgreSQL: "$ECHO_C
su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o -i"
echo "ok"
----------------
 
Old 04-03-2005, 10:32 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If you don't even see the ok (but do get the message
about starting PostgreSQL) I'd suggest to chuck a few
extra echo's into your rc.mysqld, rc.pgsql (where did
that one come from, btw, Postgres doesn't supply slack
startup-scripts to the best of my knowledge) and maybe
your rc.M as well ... a first attempt of mine would be to
include an & at the end of
Code:
su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o -i"
like so
Code:
su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o -i&"


Cheers,
Tink
 
Old 04-03-2005, 11:13 PM   #3
karlmdv
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware 10
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the reply Tinkster,

the ampersand didn't help, but looking further into pc.pgsql I found the last line was:
exit 0
after commenting this, startup runs as expected.

This prompts another question. It was my belief that programs called from within bash (rc.pgsql is a sh script) were started within their own shell. Is this not the case for sh scripts and the cause of my problems? (insofar as an exit call on a child process will kill the parent too).

WRT the rc.pgsql's origin, I believe that the only installs of postgres that have been on this machine are those that have been built from posgresql.org tarballs. So I'd guess it's come from a 'make install' of postgres.

-Karl.
 
Old 04-04-2005, 03:19 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by karlmdv
the ampersand didn't help, but looking further into pc.pgsql I found the last line was:
exit 0
after commenting this, startup runs as expected.
Glad it's fixed, even though the solution kind of
surprises me :)

Quote:
This prompts another question. It was my belief that programs called from within bash (rc.pgsql is a sh script) were started within their own shell. Is this not the case for sh scripts and the cause of my problems? (insofar as an exit call on a child process will kill the parent too).
The NORMAL action is that the parent spawns a sub-shell,
and waits for its completion (unless you start the sub-process
with an ampersand to detach it) ... which is why I find the "solution"
to remove the exit surprising.

Quote:
WRT the rc.pgsql's origin, I believe that the only installs of postgres that have been on this machine are those that have been built from posgresql.org tarballs. So I'd guess it's come from a 'make install' of postgres.
Has never been supplied by Postgres, at least not in
versions 6.x to 8.x ...


Cheers,
Tink
 
Old 04-04-2005, 03:44 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
There are two things :
Code:
./path/to/script
and
Code:
. /path/to/script
The first execute the script in a sub-shell ->'exit 0' ends the sub-shell
The second include the script -> 'exit 0' ends the main program
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
string tokenise in pl/pgsql hk_linux Programming 2 03-18-2005 05:00 AM
gmake / building pgsql towlie Slackware 4 01-14-2005 09:30 PM
PL/pgSQL anyone? vickr1z Linux - Newbie 0 10-20-2004 12:58 AM
Pgsql or mysql? other? Raspis21 Linux - Software 13 11-14-2003 10:25 PM
Dates in PL/PGSQL anisbet Linux - General 0 11-19-2001 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:27 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