Hi, Antoine Jacoutot wrote on Thu, Jan 28, 2016 at 10:41:52AM +0100:
> As mentioned in another thread already: > # ln -s /etc/rc.d/mydaemon /etc/rc.d/mydaemon2 > Then use mydaemon2_flags ... in rc.conf.local. This seems to be a recurring user question. Do you consider this addition useful? I think rcctl(8) is the best place to document it because that's the highest level user interface and "How do i run multiple copies of a daemon?" is a very high-level user question, while rc.d(8) and rc.conf(8) document lower, more technical levels. I'd love to make the example more specific and document an actual use case that frequently occurs in practice, but even though many have said that such cases do occur, i can't think of any. For example, for httpd(8), it looks like all use cases can be solved by running one copy and using "server ... { ... }" well in httpd.conf(5). So, if anybody can describe a specific use case to make the example better, that's quite welcome. I certainly don't want an example in the style of # ln -s httpd httpd2 That's a terrible name. The next admin coming along will have no clue what this second httpd is needed for. Yours, Ingo Index: rcctl.8 =================================================================== RCS file: /cvs/src/usr.sbin/rcctl/rcctl.8,v retrieving revision 1.26 diff -u -p -r1.26 rcctl.8 --- rcctl.8 24 Oct 2015 17:08:36 -0000 1.26 +++ rcctl.8 28 Jan 2016 17:39:13 -0000 @@ -193,6 +193,18 @@ ntpd_user=root # echo $? 0 .Ed +.Pp +The recommended way to run a second copy of a given daemon for a +different purpose is to create a symbolic link to its +.Xr rc.d 8 +control script: +.Bd -literal -offset indent +# cd /etc/rc.d/ +# ln -s httpd httpd_purpose +# rcctl set httpd_purpose flags -some options ... +# rcctl set httpd_purpose status on +# rcctl start httpd_purpose +.Ed .Sh SEE ALSO .Xr rc.conf.local 8 , .Xr rc.d 8