Christopher Browne cbbrowne at ca.afilias.info
Thu Jan 27 12:35:53 PST 2011
Raymond O'Donnell <rod at iol.ie> writes:
> Hi all,
>
> Apologies for the entry-level question.... I'm getting to grips with 
> Slony on Linux for the first time (have been running it on Windows for a 
> while).
>
> The slon program is described in the docs as a daemon.... so does that 
> mean that when run it's supposed to detach from the terminal and run 
> independently, continuing to run when I log out?
>
> If not, what do people usually do?

Erm, slon is logically a daemon, so it's *like* those programs that
detach themselves.  And yes, it's supposed to run independently, because
it's not much good if it stops replicating when you log out :-).

It's not *formally* implemented as a daemon, though - we didn't go the
whole 9 yards to make it detach itself that way.

You are free to wrap it in something that leaves the result silent
(e.g. - like a shell script).

On Windows, I believe it gets invoked as a Service, so the slon
processes are children of the server process.

On Linux, there are several ways to have a "service" wrapped around it:

1.  You could run on command line, so your shell is the service, and it
emits messages to stdout, which might emit to your terminal session.
Pretty useful for debugging; it's kind of inconvenient when a daemon
is unable to make itself heard at the terminal.

2.  There are built-in scripts that represent 'service wrappers.'

See tools/slon_start.sh, tools/launch_clusters.sh, which are scripts
that I wrote for this purpose.  One does one slon; the other launches a
whole set of them.

3.  People commonly build scripts in the style of SysV Init that are
pretty analogous to those in #2.

See /etc/init.d on your favorite system for samples of such scripts for
other services.  They'll generally be pretty similar to the scripts in
#2.

The thing that's special/different about Slony is that it launches a
slon for every replica, whereas it's typical for /etc/init.d scripts to
be starting only a single instance of a service to run on that host.
-- 
let name="cbbrowne" and tld="ca.afilias.info" in name ^ "@" ^ tld;;
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list