FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 10-28-2008, 09:14 AM
Ron Johnson
 
Default how to start postgresql server at machine startup?

On 10/28/08 04:26, Star Liu wrote:

On Tue, Oct 28, 2008 at 3:26 PM, Jeff D <fixedored@gmail.com> wrote:

On Tue, 28 Oct 2008, Star Liu wrote:


On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:

On 10/27/08 21:07, Star Liu wrote:

I installed postgresql server in my machine, but i does not start
automatically at startup time, so i need to mannually type these
commands to start it everytime when i restart system

Desktop:~# su postgres
Desktop:/root$ cd ~
Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &

i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:

Why the heck would you put it in an X script??????????

I do not know, I just put all the things I want to do at system
startup into this file


su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
but it doesn't work

how can i make these commands automatically executed at system startup?
thanks

How did you install PostgreSQL? If thru a Debian package, then Debian will
handle all this for you.

Yes, i installed it thru debian package, but it doesn't start up at
system startup, so i need to start it by myself, is there anyway to
automate it? thanks


Are you sure its not starting and just listening on the localhost
interface? This is how it comes configured by default. If you want it to
listen on a different interface you have to edit
/etc/postgresql/8.3/main/postgresql.conf to reflect that and restart it
through /etc/init.d/postgresql-8.3 restart .

my /etc/postgresql folder has nothing inside, did i miss some process
for postgresql server? thanks


Are you sure that you installed "it" properly?

--
Ron Johnson, Jr.
Jefferson LA USA

Help a man when he is in trouble and he will remember you when
he is in trouble again.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-28-2008, 12:01 PM
"Ben Olive"
 
Default how to start postgresql server at machine startup?

Try this:

Install sysv-rc-conf (available through apt)
run it, you will see a list of all of your startup daemons. Ensure that postgresql is set to run at 3,4,5

--Ben


On Tue, Oct 28, 2008 at 6:14 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:

On 10/28/08 04:26, Star Liu wrote:


On Tue, Oct 28, 2008 at 3:26 PM, Jeff D <fixedored@gmail.com> wrote:


On Tue, 28 Oct 2008, Star Liu wrote:




On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:


On 10/27/08 21:07, Star Liu wrote:


I installed postgresql server in my machine, but i does not start

automatically at startup time, so i need to mannually type these

commands to start it everytime when i restart system



Desktop:~# su postgres

Desktop:/root$ cd ~

Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &



i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:


Why the heck would you put it in an X script??????????


I do not know, I just put all the things I want to do at system

startup into this file





su -c "postgres -D /var/lib/postgresql/data >

/var/lib/postgresql/log/logfile 2>&1 &" postgres

but it doesn't work



how can i make these commands automatically executed at system startup?

*thanks


How did you install PostgreSQL? *If thru a Debian package, then Debian will

handle all this for you.


Yes, i installed it thru debian package, but it doesn't start up at

system startup, so i need to start it by myself, is there anyway to

automate it? thanks




Are you sure its not starting and just listening on the localhost

interface? *This is how it comes configured by default. *If you want it to

listen on a different interface you have to edit

/etc/postgresql/8.3/main/postgresql.conf to reflect that and restart it

through /etc/init.d/postgresql-8.3 restart .


my /etc/postgresql folder has nothing inside, did i miss some process

for postgresql server? thanks




Are you sure that you installed "it" properly?



--

Ron Johnson, Jr.

Jefferson LA *USA



Help a man when he is in trouble and he will remember you when

he is in trouble again.





--

To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-28-2008, 12:59 PM
"Star Liu"
 
Default how to start postgresql server at machine startup?

On Tue, Oct 28, 2008 at 9:01 PM, Ben Olive <ben.olive@gatech.edu> wrote:
> Try this:
>
> Install sysv-rc-conf (available through apt)
> run it, you will see a list of all of your startup daemons. Ensure that
> postgresql is set to run at 3,4,5
>
> --Ben
the 2,3,4,5 are all checked for postgresql, and from
system-admin-services, i can also find postgresql is checked, so i
guess that, postgresql has already been started at system startup, but
it doesn't know where to find the data and log folders, so i need to
manually execute the command which contains correct data and log
folders info:
postgres -D /var/lib/postgresql/data > /var/lib/postgresql/log/logfile 2>&1 &

thanks

> On Tue, Oct 28, 2008 at 6:14 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:
>>
>> On 10/28/08 04:26, Star Liu wrote:
>>>
>>> On Tue, Oct 28, 2008 at 3:26 PM, Jeff D <fixedored@gmail.com> wrote:
>>>>
>>>> On Tue, 28 Oct 2008, Star Liu wrote:
>>>>
>>>>> On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net>
>>>>> wrote:
>>>>>>
>>>>>> On 10/27/08 21:07, Star Liu wrote:
>>>>>>>
>>>>>>> I installed postgresql server in my machine, but i does not start
>>>>>>> automatically at startup time, so i need to mannually type these
>>>>>>> commands to start it everytime when i restart system
>>>>>>>
>>>>>>> Desktop:~# su postgres
>>>>>>> Desktop:/root$ cd ~
>>>>>>> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>>>>>>>
>>>>>>> i tried to add this command line into
>>>>>>> /etc/X11/Xsession.d/95StarHabit:
>>>>>>
>>>>>> Why the heck would you put it in an X script??????????
>>>>>
>>>>> I do not know, I just put all the things I want to do at system
>>>>> startup into this file
>>>>>
>>>>>>> su -c "postgres -D /var/lib/postgresql/data >
>>>>>>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>>>>>>> but it doesn't work
>>>>>>>
>>>>>>> how can i make these commands automatically executed at system
>>>>>>> startup?
>>>>>>> thanks
>>>>>>
>>>>>> How did you install PostgreSQL? If thru a Debian package, then Debian
>>>>>> will
>>>>>> handle all this for you.
>>>>>
>>>>> Yes, i installed it thru debian package, but it doesn't start up at
>>>>> system startup, so i need to start it by myself, is there anyway to
>>>>> automate it? thanks
>>>>>
>>>> Are you sure its not starting and just listening on the localhost
>>>> interface? This is how it comes configured by default. If you want it
>>>> to
>>>> listen on a different interface you have to edit
>>>> /etc/postgresql/8.3/main/postgresql.conf to reflect that and restart it
>>>> through /etc/init.d/postgresql-8.3 restart .
>>>
>>> my /etc/postgresql folder has nothing inside, did i miss some process
>>> for postgresql server? thanks
>>
>> Are you sure that you installed "it" properly?
>>
>> --
>> Ron Johnson, Jr.
>> Jefferson LA USA
>>
>> Help a man when he is in trouble and he will remember you when
>> he is in trouble again.
>>
>>
>> --
>> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a
>> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>>
>
>



--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 
Old 10-28-2008, 08:54 PM
Chris Bannister
 
Default how to start postgresql server at machine startup?

[Please don't bottom-post. Instead, remove quoted material that you're
not replying to, and reply inline to the points you're responding to.]

On Tue, Oct 28, 2008 at 05:26:22PM +0800, Star Liu wrote:
> my /etc/postgresql folder has nothing inside, did i miss some process
> for postgresql server? thanks

Something is severely hosed!

root@box:~# ls -al /etc/postgresql
total 20
drwxr-xr-x 3 root root 4096 2008-08-31 09:35 .
drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
drwxr-xr-x 3 root root 4096 2008-08-31 09:30 8.3

root@box:~# ls -al /etc/postgresql-common/
total 32
drwxr-xr-x 3 root root 4096 2008-10-13 12:29 .
drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
-rw-r--r-- 1 root root 1999 2008-03-31 22:39 autovacuum.conf
drwxr-xr-x 2 root root 4096 2007-01-30 04:30 pg_upgradecluster.d
-rw-r--r-- 1 root root 540 2007-12-29 00:50 root.crt
-rw-r--r-- 1 root root 1135 2006-04-05 08:52 user_clusters

I'd do a pg_dump then purge the postgresql packages, reinstall them then
use pg_restore.

> I'm a debian user and a web
> developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
> Shanghai, China.

Mmmm, of course, if you have done any heavy customisation on a previous
version then perhaps the upgrade didn't go to smoothly? I'm only
guessing here.

--
Chris.
======
I contend that we are both atheists. I just believe in one fewer god
than you do. When you understand why you dismiss all the other
possible gods, you will understand why I dismiss yours.
-- Stephen F Roberts


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-28-2008, 11:27 PM
"Star Liu"
 
Default how to start postgresql server at machine startup?

On Wed, Oct 29, 2008 at 5:54 AM, Chris Bannister
<mockingbird@earthlight.co.nz> wrote:
>
> [Please don't bottom-post. Instead, remove quoted material that you're
> not replying to, and reply inline to the points you're responding to.]
>
> On Tue, Oct 28, 2008 at 05:26:22PM +0800, Star Liu wrote:
>> my /etc/postgresql folder has nothing inside, did i miss some process
>> for postgresql server? thanks
>
> Something is severely hosed!
>
> root@box:~# ls -al /etc/postgresql
> total 20
> drwxr-xr-x 3 root root 4096 2008-08-31 09:35 .
> drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
> drwxr-xr-x 3 root root 4096 2008-08-31 09:30 8.3
unfortunitely, I do not have the folder 8.3 inside

> root@box:~# ls -al /etc/postgresql-common/
> total 32
> drwxr-xr-x 3 root root 4096 2008-10-13 12:29 .
> drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
> -rw-r--r-- 1 root root 1999 2008-03-31 22:39 autovacuum.conf
> drwxr-xr-x 2 root root 4096 2007-01-30 04:30 pg_upgradecluster.d
> -rw-r--r-- 1 root root 540 2007-12-29 00:50 root.crt
> -rw-r--r-- 1 root root 1135 2006-04-05 08:52 user_clusters
>
> I'd do a pg_dump then purge the postgresql packages, reinstall them then
> use pg_restore.
thank you, I think it should be an available solution. but what i'm
curious is how to execute a command as another user? why the following
command does not work?
---------------
su -c "postgres -D ~/data > ~/log/logfile 2>&1 &" postgres
----------------
for it doesn't work, i need to break this command into 2 seperate
commands to make it work, but it's not convinient.
-----------
su postgres
postgres -D ~/data > ~/log/logfile 2>&1 &
-----------


>> I'm a debian user and a web
>> developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
>> Shanghai, China.
>
> Mmmm, of course, if you have done any heavy customisation on a previous
> version then perhaps the upgrade didn't go to smoothly? I'm only
> guessing here.
>
> --
> Chris.
> ======
> I contend that we are both atheists. I just believe in one fewer god
> than you do. When you understand why you dismiss all the other
> possible gods, you will understand why I dismiss yours.
> -- Stephen F Roberts
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>



--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 
Old 10-29-2008, 12:41 AM
"Star Liu"
 
Default how to start postgresql server at machine startup?

On Wed, Oct 29, 2008 at 8:27 AM, Star Liu <minxinjianxin@gmail.com> wrote:
> On Wed, Oct 29, 2008 at 5:54 AM, Chris Bannister
> <mockingbird@earthlight.co.nz> wrote:
>>
>> [Please don't bottom-post. Instead, remove quoted material that you're
>> not replying to, and reply inline to the points you're responding to.]
>>
>> On Tue, Oct 28, 2008 at 05:26:22PM +0800, Star Liu wrote:
>>> my /etc/postgresql folder has nothing inside, did i miss some process
>>> for postgresql server? thanks
>>
>> Something is severely hosed!
>>
>> root@box:~# ls -al /etc/postgresql
>> total 20
>> drwxr-xr-x 3 root root 4096 2008-08-31 09:35 .
>> drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
>> drwxr-xr-x 3 root root 4096 2008-08-31 09:30 8.3
> unfortunitely, I do not have the folder 8.3 inside
>
>> root@box:~# ls -al /etc/postgresql-common/
>> total 32
>> drwxr-xr-x 3 root root 4096 2008-10-13 12:29 .
>> drwxr-xr-x 108 root root 12288 2008-10-28 23:07 ..
>> -rw-r--r-- 1 root root 1999 2008-03-31 22:39 autovacuum.conf
>> drwxr-xr-x 2 root root 4096 2007-01-30 04:30 pg_upgradecluster.d
>> -rw-r--r-- 1 root root 540 2007-12-29 00:50 root.crt
>> -rw-r--r-- 1 root root 1135 2006-04-05 08:52 user_clusters
>>
>> I'd do a pg_dump then purge the postgresql packages, reinstall them then
>> use pg_restore.
> thank you, I think it should be an available solution. but what i'm
> curious is how to execute a command as another user? why the following
> command does not work?
> ---------------
> su -c "postgres -D ~/data > ~/log/logfile 2>&1 &" postgres
> ----------------
> for it doesn't work, i need to break this command into 2 seperate
> commands to make it work, but it's not convinient.
> -----------
> su postgres
> postgres -D ~/data > ~/log/logfile 2>&1 &
> -----------
In the ~/log/logfile file, i found the error message says cannot find
postgres command, so i change it to this:
su -c "/usr/lib/postgresql/8.3/bin/postgres -D ~/data > ~/log/logfile
2>&1 &" postgres
and it works now!

>>> I'm a debian user and a web
>>> developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
>>> Shanghai, China.
>>
>> Mmmm, of course, if you have done any heavy customisation on a previous
>> version then perhaps the upgrade didn't go to smoothly? I'm only
>> guessing here.
>>
>> --
>> Chris.
>> ======
>> I contend that we are both atheists. I just believe in one fewer god
>> than you do. When you understand why you dismiss all the other
>> possible gods, you will understand why I dismiss yours.
>> -- Stephen F Roberts
>>
>>
>> --
>> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
>> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>>
>>
>
>
>
> --
> I'm a debian user and a web
> developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
> Shanghai, China.
> Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
> HomePage http://starliu dot 9966 dot com [It's only available when my
> personal machine is running, on which it's hosted.]
>



--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 
Old 10-29-2008, 12:51 AM
Ron Johnson
 
Default how to start postgresql server at machine startup?

On 10/28/08 20:41, Star Liu wrote:
[snip]

In the ~/log/logfile file, i found the error message says cannot find
postgres command, so i change it to this:
su -c "/usr/lib/postgresql/8.3/bin/postgres -D ~/data > ~/log/logfile
2>&1 &" postgres
and it works now!


But this is a Band-Aid on a hosed postgresql install.

--
Ron Johnson, Jr.
Jefferson LA USA

Help a man when he is in trouble and he will remember you when
he is in trouble again.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-29-2008, 08:51 PM
 
Default how to start postgresql server at machine startup?

On Tue, 28 Oct 2008 10:07:13 +0800
"Star Liu" <minxinjianxin@gmail.com> wrote:

> I installed postgresql server in my machine, but i does not start
> automatically at startup time, so i need to mannually type these
> commands to start it everytime when i restart system
>
> Desktop:~# su postgres
> Desktop:/root$ cd ~
> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>
> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
> su -c "postgres -D /var/lib/postgresql/data >
> /var/lib/postgresql/log/logfile 2>&1 &" postgres
> but it doesn't work
>
> how can i make these commands automatically executed at system
> startup? thanks

Normally when you install PostgreSQL in Debian it will automatically
install the startup script /etc/init.d/postgresql and by default that
will start when you boot the machine.

You also don't create the log or data directories manually so you must
have done something wrong during installation.

Try uninstall everything and reinstall it using "the debian way":

# apt-get --purge remove postgresql-8.1

or

# apt-get --purge remove postgresql-8.3 (if you are using lenny).

Remove any log and/or data directories, scripts etc. that you have
created manually.

Then just install PostgreSQL with:

# apt-get update && apt-get install postgresql-8.1 (or 8.3 if lenny).

Make sure you are ONLY using Debian repos and not something else that
might provide another version of PostgreSQL.

I manage several PostgreSQL installations daily, and I have never
experienced the problems you describe.

> --
> I'm a debian user and a web developer(XML+XSLT+AJAX+PostgreSQL+PHP) in
> City of Shanghai, China.
> Welcome to add my IMs! (msn) starliu@live.com (xmpp)
> minxinjianxin@gmail.com HomePage http://starliu dot 9966 dot com
> [It's only available when my personal machine is running, on which
> it's hosted.]
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>
>


---
Best regards

Kim Lesmer
Programmer/Unix systemadministrator

Web : www.bitflop.com
E-mail : knl@bitflop.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-29-2008, 10:27 PM
"Star Liu"
 
Default how to start postgresql server at machine startup?

On Thu, Oct 30, 2008 at 5:51 AM, <knl@bitflop.com> wrote:
> On Tue, 28 Oct 2008 10:07:13 +0800
> "Star Liu" <minxinjianxin@gmail.com> wrote:
>
>> I installed postgresql server in my machine, but i does not start
>> automatically at startup time, so i need to mannually type these
>> commands to start it everytime when i restart system
>>
>> Desktop:~# su postgres
>> Desktop:/root$ cd ~
>> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>>
>> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
>> su -c "postgres -D /var/lib/postgresql/data >
>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>> but it doesn't work
>>
>> how can i make these commands automatically executed at system
>> startup? thanks
>
> Normally when you install PostgreSQL in Debian it will automatically
> install the startup script /etc/init.d/postgresql and by default that
> will start when you boot the machine.
>
> You also don't create the log or data directories manually so you must
> have done something wrong during installation.
>
> Try uninstall everything and reinstall it using "the debian way":
>
> # apt-get --purge remove postgresql-8.1
>
> or
>
> # apt-get --purge remove postgresql-8.3 (if you are using lenny).
>
> Remove any log and/or data directories, scripts etc. that you have
> created manually.
>
> Then just install PostgreSQL with:
>
> # apt-get update && apt-get install postgresql-8.1 (or 8.3 if lenny).
>
> Make sure you are ONLY using Debian repos and not something else that
> might provide another version of PostgreSQL.
>
> I manage several PostgreSQL installations daily, and I have never
> experienced the problems you describe.
Thank you very much! Nice to meet you, for you must be a postgresql
expert. I will try your way next time I get trouble with postgresql.

>> --
>> I'm a debian user and a web developer(XML+XSLT+AJAX+PostgreSQL+PHP) in
>> City of Shanghai, China.
>> Welcome to add my IMs! (msn) starliu@live.com (xmpp)
>> minxinjianxin@gmail.com HomePage http://starliu dot 9966 dot com
>> [It's only available when my personal machine is running, on which
>> it's hosted.]
>>
>>
>> --
>> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
>> with a subject of "unsubscribe". Trouble? Contact
>> listmaster@lists.debian.org
>>
>>
>
>
> ---
> Best regards
>
> Kim Lesmer
> Programmer/Unix systemadministrator
>
> Web : www.bitflop.com
> E-mail : knl@bitflop.com
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>



--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 

Thread Tools




All times are GMT. The time now is 07:34 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org