Bug 125 - New init script
Summary: New init script
Status: ASSIGNED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: rpm (show other bugs)
Version: devel
Hardware: PC Linux
: low enhancement
Assignee: Devrim GUNDUZ
URL:
Depends on:
Blocks:
 
Reported: 2010-05-18 10:43 UTC by Jose Arthur Benetasso Villanova
Modified: 2010-11-22 07:54 UTC (History)
1 user (show)

See Also:


Attachments
New init file (2.72 KB, application/octet-stream)
2010-05-18 10:43 UTC, Jose Arthur Benetasso Villanova
Details
diff -Nur file (2.52 KB, patch)
2010-05-18 11:10 UTC, Jose Arthur Benetasso Villanova
Details
diff -Nur file using pidfile (3.65 KB, patch)
2010-05-26 15:13 UTC, Jose Arthur Benetasso Villanova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Arthur Benetasso Villanova 2010-05-18 10:43:30 UTC
Created attachment 41 [details]
New init file

I modified the init script to support multiple daemons on the same machine.

For me, it is necessary because I have 2 databases on the same cluster, each one using a different set, replicating.

How to use:

* copy or link /etc/init.d/slon to /etc/init.d/slon-new (choose your name).
* create a file /etc/sysconfig/slon-new (match above name) with at least this variables:

SLONCONF=/etc/slon-new.conf
SLONPID=/var/run/slon-new.pid
SLONLOG=/var/log/slony-new

That's it.

I tested it on CentOS.
Comment 1 Steve Singer 2010-05-18 11:02:03 UTC
Can you include the output of 'diff' comparing your version against the version of the slony script that you based your changes on (ideally the head of REL_2_0_STABLE from cvs?)
Comment 2 Jose Arthur Benetasso Villanova 2010-05-18 11:10:27 UTC
Created attachment 42 [details]
diff -Nur file

Here.
Comment 3 Devrim GUNDUZ 2010-05-18 14:06:12 UTC
This did not work for me.

pkill kills slon daemons, however slon_watchdog restarts slons in a few seconds.

Why don't you call slon_kill there?

Regards, Devrim
Comment 4 Jose Arthur Benetasso Villanova 2010-05-18 15:02:08 UTC
Hi Devrim.

I've compiled against a CentOS 5.5 and Postgresql 8.4.3 and using the specfile When I run 'pgrep -f "slon -f /etc/slon.conf"' the command returns 2 processes, but with the same name.

For me its the opposite: slon_kill didn't work.
Comment 5 Devrim GUNDUZ 2010-05-19 08:44:12 UTC
(In reply to comment #4)
 
> For me its the opposite: slon_kill didn't work.

Why?

Regards, Devrim
Comment 6 Jose Arthur Benetasso Villanova 2010-05-19 10:03:34 UTC
Hi Devrim.

The output is:
---
slon_kill.pl...   Killing all slon and slon_watchdog instances for the cluster replication
1.  Kill slon watchdogs
No watchdogs found

2. Kill slon processes
No slon processes found
---

Inside the script:
line 44: egrep found nothing, since I don't have any process called slon_watchdog
line 56: egrep found nothing, since I don't have any process that match '[s]lon .*$CLUSTER_NAME'

I've tested using the cvs HEAD and 2.0.STABLE

Again, both processes have the same name:

[root@Centosx64 ~]# ps -fu postgres
UID        PID  PPID  C STIME TTY          TIME CMD
postgres 19747     1  0 14:01 ?        00:00:00 /usr/bin/slon -f /etc/slon.conf
postgres 19749 19747  0 14:01 ?        00:00:00 /usr/bin/slon -f /etc/slon.conf
Comment 7 Jose Arthur Benetasso Villanova 2010-05-26 15:13:33 UTC
Created attachment 43 [details]
diff -Nur file using pidfile

Hi Devrim.

I rewrote the init to use pidfile. I've changed some lines from spec, to solve permission issues.

Jose Arthur.
Comment 8 Christopher Browne 2010-08-19 14:11:04 UTC
I have applied this to a "bug125" branch on GitHub.  It looks plausible, but not having much Red Hat around, I can't really validate the legitimacy.

See:

http://github.com/cbbrowne/slony1-engine/commit/c030014cf25aa5be83da987ab8bfc5e71d36a6be

I'll be happy to apply this to 2.0 and HEAD, if Devrim gives his OK.

Or if Devrim wants to apply it, that's good too.
Comment 9 Devrim GUNDUZ 2010-08-20 01:56:52 UTC
(In reply to comment #8)
> I have applied this to a "bug125" branch on GitHub.  It looks plausible, but
> not having much Red Hat around, I can't really validate the legitimacy.
> 
> See:
> 
> http://github.com/cbbrowne/slony1-engine/commit/c030014cf25aa5be83da987ab8bfc5e71d36a6be
> 
> I'll be happy to apply this to 2.0 and HEAD, if Devrim gives his OK.
> 
> Or if Devrim wants to apply it, that's good too.


IMHO none of the init scripts will actually work unless we have a slon_ctl script (that I submitted before, which still needs some work).

I'm on holiday now. I will return next weekend, and will look at this after then.

Regards, Devrim
Comment 10 Steve Singer 2010-11-10 07:08:33 UTC
Devrim,

what is the status of this script + your slon_ctl script.

I would think the target branch for both of them would be 2.1 since I don't think we want to change how init scripts work in 2.0

Is there a git branch floating around with this script + your slon_ctl script?
Comment 11 Devrim GUNDUZ 2010-11-22 07:54:11 UTC
(In reply to comment #10)
 
> what is the status of this script + your slon_ctl script.

I committed current version here:

http://projects.gunduz.org/browser/slony1/slon_ctl/slon_ctl.pl

or to get directly:
http://projects.gunduz.org/repo/slony1/slon_ctl/slon_ctl.pl
 
> I would think the target branch for both of them would be 2.1 since I don't
> think we want to change how init scripts work in 2.0

Ok.

Regards, Devrim