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 10-02-2006, 10:43 PM   #1
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Rep: Reputation: 15
How to check whether Postgresql is running?


Is there a command to check? and which process should be active, or..?

Thanks in advance

Jason
 
Old 10-02-2006, 10:52 PM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Code:
 /sbin/service postgresql status
start/stop/status

or try

/etc/init.d/postgresql status



-------------btw-----------


1 Set a password for the system postgres user by typing:
sudo passwd postgres
Give the password for sudo, then enter a new password for the postgres administrator
2 Login as the system postgres user by typing su postgres and giving the password.
3 You must now create a database using the command createdb [dbname] .
4 Add any users who are to have access to the database by using createuser .
5 Log in as the user you just added (or get that user to log in!) and test that you now have access by typing psql -l
 
Old 10-02-2006, 11:07 PM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
check how it's started and next run a ps -ef |grep relevant progname
Example (for mysql):
mysql is started by /etc/rc.d/rc.mysql script
Code:
/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
mysqld_safe is a script that ultimately calls mysqld, si you can check for mysqld like this:
Code:
wim@btd-techweb01:~$ ps -ef |grep mysqld
root      3264     1  0 Aug25 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid
mysql     3285  3264  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3286  3285  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3287  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3288  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3289  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3290  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3291  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3292  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3293  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3294  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
I don't have postgres installed so I can't tell you straight away how. You can try ps -ef |grep pg or ps -ef |grep sqlfor a start if you're too lazy to analyze
 
Old 10-02-2006, 11:22 PM   #4
folkenfanel
Member
 
Registered: Sep 2004
Location: formerly Fanelia and Zaibach
Distribution: Slackware-current !
Posts: 342

Rep: Reputation: 59
Wink /etc/rc.d

Hi there

Slackware normally does not manage things a la Red Hat (service xxx start/restart/stop/...), unless you make it work that way (which would not be difficult at all, but it's matter for another thread ).

Try

/etc/rc.d/rc.postgresql status

Works for the package from www.linuxpackages.net (and for my own homecompiled package)

I do advice using the one from www.linuxpackages.net.
 
Old 10-03-2006, 12:14 AM   #5
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
I'm using Slackware Linux
 
Old 10-03-2006, 12:15 AM   #6
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks for the reply.

However...
root@nimrod3:/# /sbin/service postgresql status
bash: /sbin/service: No such file or directory
root@nimrod3:/# /etc/init.d/postgresql status
bash: /etc/init.d/postgresql: No such file or directory


Er.. so what should I do? Thanks in advance

Jason

Quote:
Originally Posted by odcheck
Code:
 /sbin/service postgresql status
start/stop/status

or try

/etc/init.d/postgresql status



-------------btw-----------


1 Set a password for the system postgres user by typing:
sudo passwd postgres
Give the password for sudo, then enter a new password for the postgres administrator
2 Login as the system postgres user by typing su postgres and giving the password.
3 You must now create a database using the command createdb [dbname] .
4 Add any users who are to have access to the database by using createuser .
5 Log in as the user you just added (or get that user to log in!) and test that you now have access by typing psql -l
 
Old 10-03-2006, 12:17 AM   #7
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks for the reply

root@nimrod3:/# ps -ef |grep sql
1236 27676 1 0 Sep29 ? 00:00:00 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/
data
postgres 20917 20883 0 11:10 pts/1 00:00:00 /usr/local/pgsql/bin/postgres --config-file=/usr/loc
al/pgsql/data/postgresql.conf -D /usr/local/pgsql/data

So, the result =? Thanks in advance.

Jason

Quote:
Originally Posted by Wim Sturkenboom
check how it's started and next run a ps -ef |grep relevant progname
Example (for mysql):
mysql is started by /etc/rc.d/rc.mysql script
Code:
/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
mysqld_safe is a script that ultimately calls mysqld, si you can check for mysqld like this:
Code:
wim@btd-techweb01:~$ ps -ef |grep mysqld
root      3264     1  0 Aug25 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid
mysql     3285  3264  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3286  3285  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3287  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3288  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3289  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3290  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3291  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3292  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3293  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
mysql     3294  3286  0 Aug25 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking
I don't have postgres installed so I can't tell you straight away how. You can try ps -ef |grep pg or ps -ef |grep sqlfor a start if you're too lazy to analyze
 
  


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
How to check what Linux am I running? binary_0011 Linux - Newbie 4 08-15-2006 01:09 PM
way to check and see if a service is running nephish Linux - Software 10 02-11-2006 03:36 PM
PostgreSQL database running on RH7.3 standalone want to be accessed with Java gafoor Programming 2 07-11-2005 07:50 AM
check to see if sshd is running naijaguy Linux - Newbie 1 08-14-2004 02:37 AM
installing and running postgresql or MySql Whatshisface Linux - Software 3 02-22-2004 11:29 PM

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

All times are GMT -5. The time now is 11:35 AM.

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