# starting multiple instance of same daemon from rc.conf



## alief (Dec 10, 2008)

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.


----------



## anomie (Dec 10, 2008)

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.
> 
> ...
> ...



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).


----------



## alief (Dec 11, 2008)

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.


----------



## anomie (Dec 11, 2008)

I'm not a rc script expert, but what I would suggest exploring is: 

 make a copy of the startup script (/usr/local/etc/rc.d/<script>) with a new name
 modify the new startup script copy appropriately - change rcvar, config file location, etc.
 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.)


----------

