On Wed, Jan 27, 2016 at 09:30:27PM +0100, Claudio Jeker wrote:
> On Wed, Jan 27, 2016 at 12:58:48PM -0500, Jiri B wrote:
> > On Wed, Jan 27, 2016 at 01:40:14PM +0100, Antoine Jacoutot wrote:
> > > On Wed, Jan 27, 2016 at 06:47:57AM -0500, Jiri B wrote:
> > > > Would it be worth to extend rc.d for rtable knobs?
> > > > 
> > > > - daemon_rtable varible
> > > > - rc_* functions (route exec, pgrep/pkill -T $rtable...)
> > > > 
> > > > Or are routing tables not much used thus not worth to make
> > > > rc.d more complicated?
> > > 
> > > There has been several discussions about this. No decision made though.
> > > If you can find a nice way to implement it, I can have a look.
> > 
> > rc.d framework is so nice... not sure if this is nice way but it
> > works. Maybe check for existing rtable is not great.
> 
> If I see this correctly you add a foo_rtable variable to rc.conf.local.
> I think there is some drawback to this solution.
> You can only have one daemon running in one rtable at a time
> I often run things like sshd in multiple rtables / rdomains in which
> case I would have to copy the sshd rc.d script and fiddle a bit here and
> there. I would prefer if we would have a rc.conf file specific for a
> rtable. Also it is not possible to start daemons with different flags.
> 
> Non the less I think this is a move in the right direction.

Not sure I understand what you meant... Something like this below?

# rcctl ls on | grep httpd
httpd
httpd_rdomain1
# ls -l /etc/rc.d/httpd_rdomain1
lrwxr-xr-x  1 root  wheel  5 Jan 27 17:53 /etc/rc.d/httpd_rdomain1 -> httpd

# rcctl get httpd
httpd_class=daemon
httpd_flags=
httpd_rtable=0
httpd_timeout=30
httpd_user=root
# rcctl get httpd_rdomain1
httpd_rdomain1_class=daemon
httpd_rdomain1_flags=-f /etc/httpd_test.conf
httpd_rdomain1_rtable=1
httpd_rdomain1_timeout=30
httpd_rdomain1_user=root

# rcctl start httpd         
httpd(ok)
# rcctl check httpd 
httpd(ok)
# rcctl start httpd_rdomain1
httpd_rdomain1(ok)
# rcctl check httpd_rdomain1 
httpd_rdomain1(ok)
# ps -axwo pid,rtable,args | grep httpd 
16902      0 httpd: parent (httpd)
29004      0 httpd: logger (httpd)
 4502      0 httpd: server (httpd)
 7467      0 httpd: server (httpd)
26174      0 httpd: server (httpd)
15487      1 httpd: logger (httpd)
24775      1 httpd: server (httpd)
 4002      1 httpd: parent (httpd)
 1225      1 httpd: server (httpd)
22048      1 httpd: server (httpd)
11243      0 grep httpd

j.

Reply via email to