From d6490b5db349417e9e53c74ef76018f01f729f4c Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 9 Mar 2009 11:38:03 -0700 Subject: Change tag node to use 'create' instead of 'update' since the cli orders them differently. --- templates/interfaces/ethernet/node.def | 2 +- templates/interfaces/ethernet/node.tag/address/node.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index c231b74..d4e86c4 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -4,6 +4,6 @@ help: Set ethernet interface syntax:expression: exec \ "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=ethernet" allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet -update: sudo ip link set "$VAR(@)" up +create: sudo ip link set "$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on delete: sudo ip link set "$VAR(@)" down diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def index afbd822..dd4d5fa 100644 --- a/templates/interfaces/ethernet/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/address/node.def @@ -3,7 +3,7 @@ type: txt help: Set an IP address for this interface syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"\ ; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)" -update:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) +create:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) delete:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@) allowed: echo "dhcp <>" comp_help:Possible completions: -- cgit v1.2.3 From 7389eafe6644ed25f4f827cab335ddeed4015db0 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 9 Mar 2009 12:18:24 -0700 Subject: fix for qos-walkthrough. manage def file during commit--should handle general case, just happened to show up on qos-walkthrough (after def files were supported in the new commit). --- src/commit2.c | 3 +++ src/common/unionfs.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/commit2.c b/src/commit2.c index 0d77fb6..269b06f 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -231,6 +231,9 @@ main(int argc, char** argv) if (disable_partial_commit == TRUE) { complete(orig_node_tree, test_mode); } + /* + * Need to add to the following func below to clean up dangling .wh. files + */ common_commit_clean_temp_config(test_mode); if (g_debug == TRUE) { printf("commit2: successful commit, now cleaning up temp directories\n"); diff --git a/src/common/unionfs.c b/src/common/unionfs.c index 4cb2ed6..4e62b01 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -524,6 +524,7 @@ common_commit_copy_to_live_config(GNode *node, boolean test_mode) } char *command = malloc(MAX_LENGTH_DIR_PATH); static const char format0[]="mkdir -p %s ; /bin/true"; + static const char formatpoint5[]="rm -fr %s"; /*tmpp*/ static const char format1[]="cp -r -f %s/* %s"; /*mdirp, tmpp*/ static const char format2[]="sudo umount %s"; //mdirp @@ -564,6 +565,16 @@ common_commit_copy_to_live_config(GNode *node, boolean test_mode) return; } + //have to clean out tbuf before copying + sprintf(command, formatpoint5, tbuf); + if (g_debug) { + printf("%s\n",command); + fflush(NULL); + } + if (test_mode == FALSE) { + system(command); + } + //mkdir temp merge sprintf(command,format0,tbuf); if (g_debug) { @@ -574,6 +585,8 @@ common_commit_copy_to_live_config(GNode *node, boolean test_mode) system(command); } + + //cp merge to temp merge sprintf(command, format1, mbuf, tbuf); if (g_debug) { @@ -622,6 +635,13 @@ common_commit_clean_temp_config(boolean test_mode) } //first clean up the root // common_commit_copy_to_live_config("/"); + + /* + * Need to add to the following func below to clean up dangling .wh. files. + * This pass needs to be prior to the commands below (but after the umount). + * This fixes a bug when higher priority root nodes are deleted and not removed. + */ + char *command; command = malloc(MAX_LENGTH_DIR_PATH); @@ -1020,12 +1040,28 @@ copy_func(GNode *node, gpointer data) struct SrcDst *sd = (struct SrcDst*)data; static const char format[]="mkdir -p %s%s";/*tmpp, adirp*/ static const char format_value[]="cp %s%s{node.val,def} %s%s. 2>/dev/null";/*tmpp, adirp*/ + static const char clear_def[]="rm %s%sdef 2>/dev/null";/*adirp*/ char *path = ((struct VyattaNode*)(node->data))->_data._path; //might not work for terminating multinodes as the node.val won't be copied if (((struct VyattaNode*)(node->data))->_data._value == TRUE && ((struct VyattaNode*)(node->data))->_config._def.tag == FALSE) { //THIS IS ONLY FOR NODE.VAL (or leafs, term multis) + + //before copy also need to clear out def file in active directory (will copy over current if found) + //this is for the case where it is set by default, then unset at the node--i.e. no longer a default value. + if (((struct VyattaNode*)(node->data))->_config._multi == FALSE) { //only for leaf + char *parent_path = ((struct VyattaNode*)(node->parent->data))->_data._path; + sprintf(command,clear_def,sd->_dst,parent_path,sd->_dst,parent_path); + if (g_debug) { + printf("%s\n",command); + fflush(NULL); + } + if (sd->_test_mode == FALSE) { + system(command); + } + } + char *parent_path = ((struct VyattaNode*)(node->parent->data))->_data._path; sprintf(command,format_value,sd->_src,parent_path,sd->_dst,parent_path); if (g_debug) { -- cgit v1.2.3 From a9e307819cac8b34ec1d61256c35c87710a8ac98 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 9 Mar 2009 12:20:22 -0700 Subject: 0.14.40 --- debian/changelog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6dd45fc..186f488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +vyatta-cfg (0.14.40) unstable; urgency=low + + [ Stig Thormodsrud ] + * Change tag node to use 'create' instead of 'update' since the cli + orders them differently. + + [ slioch ] + * fix for qos-walkthrough. manage def file during commit--should + handle general case, just happened to show up on qos-walkthrough + (after def files were supported in the new + + -- slioch Mon, 09 Mar 2009 12:20:22 -0700 + vyatta-cfg (0.14.39) unstable; urgency=low * Fix show_interfaces() so that it includes vlans for $type='all'. -- cgit v1.2.3 From bd48938b3dc1634c64c6d099ccf5d193d94c4019 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 9 Mar 2009 17:45:28 -0700 Subject: added action and location of error to syslog on commit. error message string will need to be added later after some reworking of the old node execution code. --- src/commit2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commit2.c b/src/commit2.c index 269b06f..e6b63fa 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include "common/common.h" @@ -366,6 +367,7 @@ process_func(GNode *node, gpointer data) } if (!status) { //EXECUTE_LIST RETURNS FALSE ON FAILURE.... + syslog(LOG_ERR,"commit error for %s:[%s]\n",ActionNames[result->_action],d->_path); if (g_display_error_node) { fprintf(out_stream,"%s:[%s]\n",ActionNames[result->_action],d->_path); } -- cgit v1.2.3