[Linux-HA] Question regarding Pure-FTPd OCF Script

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Oct 16 08:00:41 MDT 2007


On Tue, Oct 16, 2007 at 01:34:40PM +0200, Dejan Muhamedagic wrote:
> Hi,
> 
> On Mon, Oct 15, 2007 at 06:20:49PM +0200, Raoul Bhatia [IPAX] wrote:
> > Dear list,
> > 
> > on line 117 in ocf::heartbeat::Pure-FTPd, pure-ftpd is started via
> > 
> >   $OCF_RESKEY_script $OCF_RESKEY_conffile -g $PIDFILE
> > 
> > on debian etch, pure-ftpd is started by the wrapper
> > "/usr/sbin/pure-ftpd-wrapper" 
> > which reads a different configuration structure from /etc/pure-ftpd/ 
> > and expects to be called similar to:
> > 
> >   STANDALONE_OR_INETD=standalone $OCF_RESKEY_script
> > 
> > so one need to 1) set a shell environment variable and 2) call it 
> > without -g $PIDFILE.
> > 
> > moreover, in this wrapper, PIDFILE is hardwired to 
> > 
> >   "/var/run/pure-ftpd/pure-ftpd.pid"
> > 
> > whereas in the ocf, PIDFILE is hardwired to 
> > 
> >   ${HA_RSCTMP}/pure-ftpd-${OCF_RESOURCE_INSTANCE}.pid
> > 
> > as i am not that familiar with ocf scripts, default values and overriding 
> > default values, in what way should one patch the ocf script, so it 
> > still works as before but can too be used with debian?
> 
> The only way I can see is to introduce, say, a dist variable
> (OCF_RESKEY_dist) and then put if-else (or case) statements where
> appropriate:

This is not a very good advice. Though not probable, it is
possible that one has more than one distribution in the cluster.
As Andrew suggested, try to figure out where the agent runs
dynamically (/etc/debian_version) or, perhaps, just check if that
wrapper is present:

if [ -x /usr/sbin/pure-ftpd-wrapper ]
...

Thanks,

Dejan

> case "$OCF_RESKEY_dist" in
> 	Debian)
> 	*)
> esac
> 
> Thanks,
> 
> Dejan
> 
> > my current, ugly hack looks like the diff attached.
> > 
> > cheers,
> > raoul
> > -- 
> > ____________________________________________________________________
> > DI (FH) Raoul Bhatia M.Sc.          email.          r.bhatia at ipax.at
> > Technischer Leiter
> > 
> > IPAX - Aloy Bhatia Hava OEG         web.          http://www.ipax.at
> > Barawitzkagasse 10/2/2/11           email.            office at ipax.at
> > 1190 Wien                           tel.               +43 1 3670030
> > FN 277995t HG Wien                  fax.            +43 1 3670030 15
> > ____________________________________________________________________
> 
> > _______________________________________________
> > Linux-HA mailing list
> > Linux-HA at lists.linux-ha.org
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha
> > See also: http://linux-ha.org/ReportingProblems
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems



More information about the Linux-HA mailing list