Bug 214284 - [feature suggestion] Allow services to run additional instances
Summary: [feature suggestion] Allow services to run additional instances
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-rc (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-11-06 21:04 UTC by Yuri Victorovich
Modified: 2016-11-06 23:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2016-11-06 21:04:49 UTC
In https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207129 I implemented the instances functionality for security/tor, when additional instances of Tor can be run under the umbrella of the same service.

I am going to generalize that functionality so that some other servers can use the additional instances too.

This will be implemented in /etc/rc.subr.

> # /etc/rc.conf will include the lines like this:
> <name>_enable="YES"
> <name>_instances="inst1:<param1>:<param2>{:...} {inst2:<param1>:<param2>{:...} {...additional instances...}}"
> <name>_disable_default_instance="YES"

Then service commands
> # service <cmd> <name> {<instance>}
will execute the command <cmd> on all defined instances, or on one instance <instance>.

rc scripts will have to include the process_instances call with instance declaration:

> process_instances "$1" "$2" "<param1>/<param1_type>:<param2>/<param2_type>{:...}" || return $?
> ...
> run_rc_command_with_instances "$1"