starting multiple instance of same daemon from rc.conf

Hi all,

I have a problem with starting 3rd. party programs (from ports / packages).

Lets say i have installed vsftpd and want to enable it to listen in ipv4 and ipv6, i have to create 2 version of vsftpd.conf, vsftpd-v4.conf (for listening in ipv4) and vsftpd-v6.conf (for listening in ipv6).

My question is, how can i enable multiple instance of vsftpd with different configuration from rc.conf ? (actually, for this case i've used rc.local).

Thanks for your attention.
 
With the caveat that I'm usually a vsftpd proponent, this seems strange to me.

I found:
http://vsftpd.beasts.org/vsftpd_conf.html
listen
If enabled, vsftpd will run in standalone mode. This means that vsftpd must not be run from an inetd of some kind. Instead, the vsftpd executable is run once directly. vsftpd itself will then take care of listening for and handling incoming connections.

...

listen_ipv6
Like the listen parameter, except vsftpd will listen on an IPv6 socket instead of an IPv4 one. This parameter and the listen parameter are mutually exclusive.

Is that correct? Did you test both directives and confirm that it's only listening on IPv4 or IPv6? If that's the case it is very annoying.

Not to discourage you from using an otherwise fine package, but in this case I'd consider running ftpd from the base system (which supports IPv4 / IPv6 simultaneously).
 
yes anomie, i've tried it, only 1 listen parameter (ipv4 / ipv6) for every configuration.

in the other occasion i want to start multiple instances of openvpn too... so, i think this problem is quite general.
 
I'm not a rc script expert, but what I would suggest exploring is:
  1. make a copy of the startup script (/usr/local/etc/rc.d/<script>) with a new name
  2. modify the new startup script copy appropriately - change rcvar, config file location, etc.
  3. add the new directive to /etc/rc.conf

IMO, this is going to be a pain to maintain in the long run. (Every time you upgrade the port you will need to carefully check if the config file directives have changed.)
 
Back
Top