[RndTbl] Scripting question

Sean Walberg sean at ertw.com
Tue Jan 30 15:08:32 CST 2007


Call the script from /etc/inittab, use the respawn keyword.  Your X
display manager is probably set up that way

Sean

On 1/30/07, Kevin McGregor <kmcgregor at shaw.ca> wrote:
> I have this script:
> #!/bin/bash
>
> if [ -e /var/run/pgsql.pipe ]; then
>         while [ -e /var/run/pgsql.pipe ]
>         do
>                 psql -q -h padsysdb -U sysloguser syslog
> </var/run/pgsql.pipe
>         done
> fi
>
> ...running on a Ubuntu Linux server. It's clearly very simple; it just keeps
> checking the named pipe /var/run/pgsql.pipe and sending the contents to the
> psql command, which interprets the input as a SQL command and executes it
> accordingly.
>
> My question is, given that I want this loop to execute (a) from server
> startup (b) indefinitely and without interruption, how do I reasonably
> ensure (a) and (b)?
>
> More specifically, where do I stick this (or an equivalent) in the startup
> scripts on Ubuntu, and is there a good automated way to make sure it keeps
> going? I really don't want to lose any of my database input. It's a fairly
> critical system, and I'd like to make this pretty robust.
>
> Kevin
> _______________________________________________
> Roundtable mailing list
> Roundtable at muug.mb.ca
> http://www.muug.mb.ca/mailman/listinfo/roundtable
>
>


-- 
Sean Walberg <sean at ertw.com>    http://ertw.com/


More information about the Roundtable mailing list