proc $MODULE.instantiate { eid node } {
l3node.instantiate $eid $node
-# FreeBSD-specific:
-# # XXX race if starting two imunes instances simultaneously
-# nexec rm -fr /var/run/quagga
-# nexec rm -f /usr/local/etc/quagga/Quagga.conf
-# nexec ln -s /tmp/$eid/@ /var/run/quagga
-# nexec ln -s /tmp/$eid/@/boot.conf /usr/local/etc/quagga/Quagga.conf
-# foreach file { bgpd ospfd ospf6d ripd ripngd vtysh zebra } {
-# nexec cp /dev/null /usr/local/etc/quagga/$file.conf
-# }
-
upvar 0 ::cf::[set ::curcfg]::[set node]::ve_dir ve_dir
+
+ # buduci da je stroj instanciran, tj. iskopirani su fajlovi,
+ # po njima se moze pisati, ali buduci da jos nije pokrenut nema
+ # smisla koristiti nexec vzctl...
+ #
+ #iz glavnog stroja napravi simlink u file sistemu za VE, kojem se
+ #kao destination preda "/boot.conf" sto kasnije ispadne VE root
nexec ln -s /boot.conf $ve_dir/etc/quagga/Quagga.conf
- foreach file { bgpd ospfd ospf6d ripd ripngd vtysh zebra } {
- puts "maybe nexec cp /dev/null $ve_dir/etc/quagga/$file.conf"
- }
+
+## Probably useless
+# foreach file { bgpd ospfd ospf6d ripd ripngd vtysh zebra } {
+# puts "maybe nexec cp /dev/null $ve_dir/etc/quagga/$file.conf"
+# }
}
proc $MODULE.start { eid node } {
# OpenVZ catch: prije startanja bootcmda moramo upaliti capabilities
+# jer bez toga quagga uopće ne radi
upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
- foreach capability { net_admin net_raw sys_admin } {
+
+## Pokusali sa ovim, ali nije pomoglo
+# foreach capability { chown dac_override dac_read_search fowner
+# fsetid kill setgid setuid linux_immutable net_bind_service net_broadcast
+# net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace
+# sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod
+# lease setveid ve_admin } {
+
+ foreach capability {net_admin net_raw sys_admin} {
nexec vzctl set $node_id --capability $capability:on --save
}
upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
nexec vzctl exec $node_id sysctl -w net/ipv4/ip_forward=1
+
# TODO: IPv6 Quagga support
# nexec vzctl exec $node_id sysctl -w net/ipv6/conf/all/forwarding=1