Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2016 11:57:06 +1300
From:      Andrew Thompson <andy@fud.org.nz>
To:        Garrett Wollman <wollman@bimajority.org>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: Good example for startup script with multiple "profiles"?
Message-ID:  <CAFAOGNSdVhcv3fxcht9UzM-SP7YJt2Xa6GedtpXY=1=u4D3JNg@mail.gmail.com>
In-Reply-To: <22203.48400.34474.502294@hergotha.csail.mit.edu>
References:  <22203.48400.34474.502294@hergotha.csail.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 February 2016 at 11:43, Garrett Wollman <wollman@bimajority.org>
wrote:

> It's sometimes useful to have a single rc script start multiple copies
> of the same service, using different options.  (For example, and my
> use case here, running a monitoring daemon with different parameters
> on "inside" and "outside" network interfaces.)  Is there a good
> example I can crib from for how best to code this up while taking
> maximal advantage of the rc.subr framework?
>

Slightly different but the openvpn startup script uses the filename as the
variable prefix and you start multiple copies by linking the file to a new
name. Works well.

# This script supports running multiple instances of openvpn.
# To run additional instances link this script to something like
# % ln -s openvpn openvpn_foo
# and define additional openvpn_foo_* variables in one of
# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo


Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFAOGNSdVhcv3fxcht9UzM-SP7YJt2Xa6GedtpXY=1=u4D3JNg>