diff --git a/agent-simulator/tomcatconf/commands-simulator.properties.in b/agent-simulator/tomcatconf/commands-simulator.properties.in deleted file mode 100644 index 4350bb788b4..00000000000 --- a/agent-simulator/tomcatconf/commands-simulator.properties.in +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -configureSimulator=com.cloud.api.commands.ConfigureSimulatorCmd;1 -querySimulatorMock=com.cloud.api.commands.QuerySimulatorMockCmd;1 -cleanupSimulatorMock=com.cloud.api.commands.CleanupSimulatorMockCmd;1 diff --git a/client/pom.xml b/client/pom.xml index a6e0383b48b..96cbae420aa 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -798,7 +798,6 @@ - diff --git a/developer/developer-prefill.sql b/developer/developer-prefill.sql index cc67748b8dd..c9ab468e5b3 100644 --- a/developer/developer-prefill.sql +++ b/developer/developer-prefill.sql @@ -112,7 +112,7 @@ INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) VALUES ('Advanced', 'DEFAULT', 'management-server', - 'ping.timeout', '1.5'); + 'ping.timeout', '2.0'); -- Enable dynamic RBAC by default for fresh deployments INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) diff --git a/pom.xml b/pom.xml index 283b32171df..c30247aaf3e 100644 --- a/pom.xml +++ b/pom.xml @@ -920,35 +920,12 @@ ui/lib/reset.css ui/lib/require.js utils/testsmallfileinactive - systemvm/conf/agent.properties - systemvm/conf/environment.properties - systemvm/js/jquery.js - systemvm/js/jquery.flot.navigate.js - systemvm/patches/debian/systemvm.vmx - systemvm/patches/debian/config/root/.ssh/authorized_keys - systemvm/patches/debian/config/etc/apache2/httpd.conf - systemvm/patches/debian/config/etc/apache2/vhost.template - systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl - systemvm/patches/debian/config/etc/vpcdnsmasq.conf - systemvm/patches/debian/config/etc/ssh/sshd_config - systemvm/patches/debian/config/etc/rsyslog.conf - systemvm/patches/debian/config/etc/logrotate.conf - systemvm/patches/debian/config/etc/logrotate.d/* - systemvm/patches/debian/config/etc/sysctl.conf - systemvm/patches/debian/config/root/redundant_router/keepalived.conf.templ - systemvm/patches/debian/config/root/redundant_router/arping_gateways.sh.templ - systemvm/patches/debian/config/root/redundant_router/conntrackd.conf.templ - systemvm/patches/debian/vpn/etc/ipsec.conf - systemvm/patches/debian/vpn/etc/ppp/options.xl2tpd - systemvm/patches/debian/vpn/etc/xl2tpd/xl2tpd.conf - systemvm/patches/debian/vpn/etc/ipsec.secrets - systemvm/patches/debian/config/etc/haproxy/haproxy.cfg - systemvm/patches/debian/config/etc/cloud-nic.rules - systemvm/patches/debian/config/etc/modprobe.d/aesni_intel - systemvm/patches/debian/config/etc/rc.local - systemvm/patches/debian/config/var/www/html/userdata/.htaccess - systemvm/patches/debian/config/var/www/html/latest/.htaccess - systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf + systemvm/agent/conf/agent.properties + systemvm/agent/conf/environment.properties + systemvm/agent/js/jquery.js + systemvm/agent/js/jquery.flot.navigate.js + systemvm/patches/debian/** + systemvm/patches/vpn/** tools/transifex/.tx/config tools/logo/apache_cloudstack.png tools/marvin/marvin/sandbox/advanced/sandbox.cfg diff --git a/setup/dev/advanced.cfg b/setup/dev/advanced.cfg index bdb25e56456..d5762c39bce 100644 --- a/setup/dev/advanced.cfg +++ b/setup/dev/advanced.cfg @@ -231,7 +231,7 @@ }, { "name": "ping.timeout", - "value": "1.5" + "value": "2.0" } ], "mgtSvr": [ diff --git a/systemvm/certs/localhost.crt b/systemvm/agent/certs/localhost.crt similarity index 100% rename from systemvm/certs/localhost.crt rename to systemvm/agent/certs/localhost.crt diff --git a/systemvm/certs/localhost.key b/systemvm/agent/certs/localhost.key similarity index 100% rename from systemvm/certs/localhost.key rename to systemvm/agent/certs/localhost.key diff --git a/systemvm/certs/realhostip.crt b/systemvm/agent/certs/realhostip.crt similarity index 100% rename from systemvm/certs/realhostip.crt rename to systemvm/agent/certs/realhostip.crt diff --git a/systemvm/certs/realhostip.csr b/systemvm/agent/certs/realhostip.csr similarity index 100% rename from systemvm/certs/realhostip.csr rename to systemvm/agent/certs/realhostip.csr diff --git a/systemvm/certs/realhostip.key b/systemvm/agent/certs/realhostip.key similarity index 100% rename from systemvm/certs/realhostip.key rename to systemvm/agent/certs/realhostip.key diff --git a/systemvm/certs/realhostip.keystore b/systemvm/agent/certs/realhostip.keystore similarity index 100% rename from systemvm/certs/realhostip.keystore rename to systemvm/agent/certs/realhostip.keystore diff --git a/systemvm/conf/agent.properties b/systemvm/agent/conf/agent.properties similarity index 99% rename from systemvm/conf/agent.properties rename to systemvm/agent/conf/agent.properties index 051cf610710..9bc4dcaf965 100644 --- a/systemvm/conf/agent.properties +++ b/systemvm/agent/conf/agent.properties @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/conf/consoleproxy.properties b/systemvm/agent/conf/consoleproxy.properties similarity index 99% rename from systemvm/conf/consoleproxy.properties rename to systemvm/agent/conf/consoleproxy.properties index a3cddbcab96..96a345b31f7 100644 --- a/systemvm/conf/consoleproxy.properties +++ b/systemvm/agent/conf/consoleproxy.properties @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/conf/environment.properties b/systemvm/agent/conf/environment.properties similarity index 100% rename from systemvm/conf/environment.properties rename to systemvm/agent/conf/environment.properties diff --git a/systemvm/conf/log4j-cloud.xml b/systemvm/agent/conf/log4j-cloud.xml similarity index 100% rename from systemvm/conf/log4j-cloud.xml rename to systemvm/agent/conf/log4j-cloud.xml diff --git a/systemvm/css/ajaxviewer.css b/systemvm/agent/css/ajaxviewer.css similarity index 80% rename from systemvm/css/ajaxviewer.css rename to systemvm/agent/css/ajaxviewer.css index 3e0681401bf..73dee4af5ed 100644 --- a/systemvm/css/ajaxviewer.css +++ b/systemvm/agent/css/ajaxviewer.css @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,7 +21,7 @@ body { margin:0 0; text-align: center; } - + #main_panel { clear:both; margin: 0 auto; @@ -33,57 +33,57 @@ body { } #toolbar { - font:normal 12px 'Trebuchet MS','Arial'; - margin:0 auto; + font:normal 12px 'Trebuchet MS','Arial'; + margin:0 auto; text-align: left; - padding:0 0; + padding:0 0; height:32px; - background-image:url(/resource/images/back.gif); - background-repeat:repeat-x; + background-image:url(/resource/images/back.gif); + background-repeat:repeat-x; } -#toolbar ul { - margin:0 0; - padding:0 10px 0 10px; +#toolbar ul { + margin:0 0; + padding:0 10px 0 10px; float:left; display:block; line-height:32px; - list-style:none; + list-style:none; } #toolbar li { - float:left; - display:inline; + float:left; + display:inline; padding:0; height:32px; } -#toolbar a { - color:white; +#toolbar a { + color:white; float:left; display:block; - padding:0 3px 0 3px; + padding:0 3px 0 3px; text-decoration:none; line-height:32px; } -#toolbar a span { - display:block; - float:none; - padding:0 10px 0 7px; -} +#toolbar a span { + display:block; + float:none; + padding:0 10px 0 7px; +} -#toolbar a span img { - border:none; - margin:8px 4px 0 0; -} +#toolbar a span img { + border:none; + margin:8px 4px 0 0; +} -#toolbar a:hover { - background: url(/resource/images/left.png) no-repeat left center; -} +#toolbar a:hover { + background: url(/resource/images/left.png) no-repeat left center; +} -#toolbar a:hover span { - background:url(/resource/images/right.png) no-repeat right center; +#toolbar a:hover span { + background:url(/resource/images/right.png) no-repeat right center; } @@ -106,23 +106,23 @@ body { } #toolbar ul li ul li.current { - background: url(/resource/images/cad.gif) no-repeat left center; + background: url(/resource/images/cad.gif) no-repeat left center; } #toolbar ul li ul li a { display:block; - padding:0 3px 0 3px; + padding:0 3px 0 3px; text-decoration:none; line-height:32px; vertical-align: bottom; /* this is to fix the list gap in IE */ } #toolbar ul li ul li a:hover { - background: url(/resource/images/left.png) no-repeat left center; + background: url(/resource/images/left.png) no-repeat left center; } #toolbar ul li ul li a:hover span { - background: url(/resource/images/right2.png) no-repeat right center; + background: url(/resource/images/right2.png) no-repeat right center; } span.dark { @@ -131,7 +131,7 @@ span.dark { display:block; width:32px; height:30px; - background:url(/resource/images/gray-green.png) no-repeat center center; + background:url(/resource/images/gray-green.png) no-repeat center center; } span.bright { @@ -140,5 +140,5 @@ span.bright { display:block; width:32px; height:30px; - background:url(/resource/images/bright-green.png) no-repeat center center; + background:url(/resource/images/bright-green.png) no-repeat center center; } diff --git a/systemvm/css/logger.css b/systemvm/agent/css/logger.css similarity index 93% rename from systemvm/css/logger.css rename to systemvm/agent/css/logger.css index 42ac8071ed5..40629d3f6e5 100644 --- a/systemvm/css/logger.css +++ b/systemvm/agent/css/logger.css @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -45,14 +45,14 @@ under the License. .logwin_title_actionbox .select { - background: #424242; - font: normal 10px Arial, Helvetica, sans-serif; - float:left; - border: 1px solid #6e6e6e; - height: 16px; - width: 100px; - margin-left:3px; - padding:0 0 0 3px; + background: #424242; + font: normal 10px Arial, Helvetica, sans-serif; + float:left; + border: 1px solid #6e6e6e; + height: 16px; + width: 100px; + margin-left:3px; + padding:0 0 0 3px; color:#CCC; } @@ -136,4 +136,3 @@ a:hover.logwin_minimizebutton { height: 477px; background: white; } - diff --git a/systemvm/images/back.gif b/systemvm/agent/images/back.gif similarity index 100% rename from systemvm/images/back.gif rename to systemvm/agent/images/back.gif diff --git a/systemvm/images/bright-green.png b/systemvm/agent/images/bright-green.png similarity index 100% rename from systemvm/images/bright-green.png rename to systemvm/agent/images/bright-green.png diff --git a/systemvm/images/cad.gif b/systemvm/agent/images/cad.gif similarity index 100% rename from systemvm/images/cad.gif rename to systemvm/agent/images/cad.gif diff --git a/systemvm/images/cannotconnect.jpg b/systemvm/agent/images/cannotconnect.jpg similarity index 100% rename from systemvm/images/cannotconnect.jpg rename to systemvm/agent/images/cannotconnect.jpg diff --git a/systemvm/images/clr_button.gif b/systemvm/agent/images/clr_button.gif similarity index 100% rename from systemvm/images/clr_button.gif rename to systemvm/agent/images/clr_button.gif diff --git a/systemvm/images/clr_button_hover.gif b/systemvm/agent/images/clr_button_hover.gif similarity index 100% rename from systemvm/images/clr_button_hover.gif rename to systemvm/agent/images/clr_button_hover.gif diff --git a/systemvm/images/dot.cur b/systemvm/agent/images/dot.cur similarity index 100% rename from systemvm/images/dot.cur rename to systemvm/agent/images/dot.cur diff --git a/systemvm/images/gray-green.png b/systemvm/agent/images/gray-green.png similarity index 100% rename from systemvm/images/gray-green.png rename to systemvm/agent/images/gray-green.png diff --git a/systemvm/images/grid_headerbg.gif b/systemvm/agent/images/grid_headerbg.gif similarity index 100% rename from systemvm/images/grid_headerbg.gif rename to systemvm/agent/images/grid_headerbg.gif diff --git a/systemvm/images/left.png b/systemvm/agent/images/left.png similarity index 100% rename from systemvm/images/left.png rename to systemvm/agent/images/left.png diff --git a/systemvm/images/minimize_button.gif b/systemvm/agent/images/minimize_button.gif similarity index 100% rename from systemvm/images/minimize_button.gif rename to systemvm/agent/images/minimize_button.gif diff --git a/systemvm/images/minimize_button_hover.gif b/systemvm/agent/images/minimize_button_hover.gif similarity index 100% rename from systemvm/images/minimize_button_hover.gif rename to systemvm/agent/images/minimize_button_hover.gif diff --git a/systemvm/images/notready.jpg b/systemvm/agent/images/notready.jpg similarity index 100% rename from systemvm/images/notready.jpg rename to systemvm/agent/images/notready.jpg diff --git a/systemvm/images/play_button.gif b/systemvm/agent/images/play_button.gif similarity index 100% rename from systemvm/images/play_button.gif rename to systemvm/agent/images/play_button.gif diff --git a/systemvm/images/play_button_hover.gif b/systemvm/agent/images/play_button_hover.gif similarity index 100% rename from systemvm/images/play_button_hover.gif rename to systemvm/agent/images/play_button_hover.gif diff --git a/systemvm/images/right.png b/systemvm/agent/images/right.png similarity index 100% rename from systemvm/images/right.png rename to systemvm/agent/images/right.png diff --git a/systemvm/images/right2.png b/systemvm/agent/images/right2.png similarity index 100% rename from systemvm/images/right2.png rename to systemvm/agent/images/right2.png diff --git a/systemvm/images/shrink_button.gif b/systemvm/agent/images/shrink_button.gif similarity index 100% rename from systemvm/images/shrink_button.gif rename to systemvm/agent/images/shrink_button.gif diff --git a/systemvm/images/shrink_button_hover.gif b/systemvm/agent/images/shrink_button_hover.gif similarity index 100% rename from systemvm/images/shrink_button_hover.gif rename to systemvm/agent/images/shrink_button_hover.gif diff --git a/systemvm/images/stop_button.gif b/systemvm/agent/images/stop_button.gif similarity index 100% rename from systemvm/images/stop_button.gif rename to systemvm/agent/images/stop_button.gif diff --git a/systemvm/images/stop_button_hover.gif b/systemvm/agent/images/stop_button_hover.gif similarity index 100% rename from systemvm/images/stop_button_hover.gif rename to systemvm/agent/images/stop_button_hover.gif diff --git a/systemvm/images/winlog.png b/systemvm/agent/images/winlog.png similarity index 100% rename from systemvm/images/winlog.png rename to systemvm/agent/images/winlog.png diff --git a/systemvm/js/ajaxkeys.js b/systemvm/agent/js/ajaxkeys.js similarity index 100% rename from systemvm/js/ajaxkeys.js rename to systemvm/agent/js/ajaxkeys.js diff --git a/systemvm/js/ajaxviewer.js b/systemvm/agent/js/ajaxviewer.js similarity index 94% rename from systemvm/js/ajaxviewer.js rename to systemvm/agent/js/ajaxviewer.js index b085f9925c3..f160abc9b58 100644 --- a/systemvm/js/ajaxviewer.js +++ b/systemvm/agent/js/ajaxviewer.js @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -34,12 +34,12 @@ StringBuilder.prototype = { } return this; }, - + clear : function() { this.strings.length = 1; return this; }, - + toString: function() { return this.strings.join(""); } @@ -51,7 +51,7 @@ function getCurrentLanguage() { var tokens = acceptLanguages.split(','); if(tokens.length > 0) return tokens[0]; - + return "en-us"; } else { return "en-us"; @@ -74,11 +74,11 @@ function KeyboardMapper() { // // For KeyPress event, it translates it only if there exist a mapping entry // in jsX11KeysymMap map and the entry meets the condition -// +// // COOKED keyboard // Primarily translates KeyPress event, either as is or through mapped result // It translates KeyDown/KeyUp only there exists a mapping entry, or if there -// is no mapping entry, translate when certain modifier key is pressed (i.e., +// is no mapping entry, translate when certain modifier key is pressed (i.e., // CTRL or ALT key // // Mapping entry types @@ -86,10 +86,10 @@ function KeyboardMapper() { // boolean : only valid for jsX11KeysymMap, existence of this type, no matter true or false // in value, corresponding KeyDown/KeyUp event will be masked // array : contains a set of conditional mapping entry -// +// // Conditional mapping entry // -// { +// { // type: , code: , modifiers: , // shift : , -- match on shift state // guestos : , -- match on guestos type @@ -152,7 +152,7 @@ KeyboardMapper.prototype = { }, RawkeyboardInputHandler : function(eventType, code, modifiers, guestos, browser, browserVersion) { if(eventType == AjaxViewer.KEY_DOWN || eventType == AjaxViewer.KEY_UP) { - + // special handling for Alt + Ctrl + Ins, convert it into Alt-Ctrl-Del if(code == AjaxViewer.JS_KEY_INSERT) { if((modifiers & AjaxViewer.ALT_KEY_MASK) != 0 && (modifiers & AjaxViewer.CTRL_KEY_MASK) != 0) { @@ -160,7 +160,7 @@ KeyboardMapper.prototype = { return; } } - + var X11Keysym = code; if(this.jsX11KeysymMap[code] != undefined && (guestos == 'windows' || modifiers != AjaxViewer.SHIFT_KEY_MASK || code == AjaxViewer.JS_KEY_CAPSLOCK)) { X11Keysym = this.jsX11KeysymMap[code]; @@ -183,7 +183,7 @@ KeyboardMapper.prototype = { // special handling for ALT/CTRL key if(eventType == AjaxViewer.KEY_UP && (code == AjaxViewer.JS_KEY_ALT || code == AjaxViewer.JS_KEY_CTRL)) this.mappedInput.push({type : eventType, code: this.jsX11KeysymMap[code], modifiers: modifiers}); - + } else if(eventType == AjaxViewer.KEY_PRESS && guestos == 'null') { // ENTER/BACKSPACE key should already have been sent through KEY DOWN/KEY UP event if(code == AjaxViewer.JS_KEY_ENTER || code == AjaxViewer.JS_KEY_BACKSPACE) @@ -207,10 +207,10 @@ KeyboardMapper.prototype = { } } }, - + CookedKeyboardInputHandler : function(eventType, code, modifiers, guestos, browser, browserVersion) { if(eventType == AjaxViewer.KEY_DOWN || eventType == AjaxViewer.KEY_UP) { - + // special handling for Alt + Ctrl + Ins, convert it into Alt-Ctrl-Del if(code == AjaxViewer.JS_KEY_INSERT) { if((modifiers & AjaxViewer.ALT_KEY_MASK) != 0 && (modifiers & AjaxViewer.CTRL_KEY_MASK) != 0) { @@ -218,7 +218,7 @@ KeyboardMapper.prototype = { return; } } - + var X11Keysym = code; if(this.jsX11KeysymMap[code] != undefined) { X11Keysym = this.jsX11KeysymMap[code]; @@ -252,7 +252,7 @@ KeyboardMapper.prototype = { this.mappedInput.push({type : AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: modifiers}); return; } - + if(code == AjaxViewer.JS_NUMPAD_PLUS) { this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SHIFT, modifiers: modifiers}); this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: 43, modifiers: modifiers}); @@ -260,7 +260,7 @@ KeyboardMapper.prototype = { this.mappedInput.push({type : AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: modifiers}); return; } - + // ENTER/BACKSPACE key should already have been sent through KEY DOWN/KEY UP event if(code == AjaxViewer.JS_KEY_ENTER || code == AjaxViewer.JS_KEY_BACKSPACE) return; @@ -285,20 +285,20 @@ KeyboardMapper.prototype = { } } }, - + inputFeed : function(eventType, code, modifiers, guestos, browser, browserVersion) { if(this.keyboardType == KeyboardMapper.KEYBOARD_TYPE_RAW) this.RawkeyboardInputHandler(eventType, code, modifiers, guestos, browser, browserVersion); else this.CookedKeyboardInputHandler(eventType, code, modifiers, guestos, browser, browserVersion); }, - + getMappedInput : function() { var mappedInput = this.mappedInput; this.mappedInput = []; return mappedInput; }, - + isConditionalEntryMatched : function(eventType, code, modifiers, entry, guestos, browser, browserVersion) { if(eventType == AjaxViewer.KEY_DOWN || eventType == AjaxViewer.KEY_UP) { // for KeyDown/KeyUp events, we require that the type in entry should match with @@ -306,10 +306,10 @@ KeyboardMapper.prototype = { if(entry.type != eventType) return false; } - + // check conditional match if(entry.shift != undefined) { - var shift = ((modifiers & AjaxViewer.SHIFT_KEY_MASK) != 0 ? true : false); + var shift = ((modifiers & AjaxViewer.SHIFT_KEY_MASK) != 0 ? true : false); if(entry.shift ^ shift) return false; } @@ -325,20 +325,20 @@ KeyboardMapper.prototype = { if(entry.guestos != guestos) return false; } - + if(entry.browser != undefined) { if(entry.browser != browser) return false; } - + if(entry.browserVersion != undefined) { if(entry.browserVersion != browserVersion) return false; } - + return true; }, - + isModifierInput : function(code) { return $.inArray(code, [AjaxViewer.ALT_KEY_MASK, AjaxViewer.SHIFT_KEY_MASK, AjaxViewer.CTRL_KEY_MASK, AjaxViewer.META_KEY_MASK]) >= 0; } @@ -352,10 +352,10 @@ function AjaxViewer(panelId, imageUrl, updateUrl, locale, guestos, tileMap, widt // however, a back door key-sequence can trigger to open the logger window, it is designed to help // trouble-shooting g_logger = new Logger(); - + // g_logger.enable(true); // g_logger.open(); - + var ajaxViewer = this; this.imageLoaded = false; this.fullImage = true; @@ -364,7 +364,7 @@ function AjaxViewer(panelId, imageUrl, updateUrl, locale, guestos, tileMap, widt $(this.img).attr('src', imageUrl).load(function() { ajaxViewer.imageLoaded = true; }); - + this.updateUrl = updateUrl; this.tileMap = tileMap; this.guestos = guestos; @@ -381,16 +381,16 @@ function AjaxViewer(panelId, imageUrl, updateUrl, locale, guestos, tileMap, widt this.currentKeyboard = AjaxViewer.KEYBOARD_TYPE_ENGLISH; this.keyboardMappers = []; - + this.timer = 0; this.eventQueue = []; this.sendingEventInProgress = false; - + this.lastClickEvent = { x: 0, y: 0, button: 0, modifiers: 0, time: new Date().getTime() }; - + if(window.onStatusNotify == undefined) window.onStatusNotify = function(status) {}; - + this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight); // this.setupKeyboardTranslationle(); this.setupKeyboardTranslationTable(this.keyboardMappers); @@ -408,7 +408,7 @@ AjaxViewer.EVENT_BAG = 7; AjaxViewer.MOUSE_DBLCLK = 8; AjaxViewer.MOUSE_SCROLL = 9; -// use java AWT key modifier masks +// use java AWT key modifier masks AjaxViewer.SHIFT_KEY_MASK = 64; AjaxViewer.CTRL_KEY_MASK = 128; AjaxViewer.META_KEY_MASK = 256; @@ -487,7 +487,7 @@ AjaxViewer.JS_KEY_COMMA = 188; // , AjaxViewer.JS_KEY_DASH = 189; // - AjaxViewer.JS_KEY_PERIOD = 190; // . AjaxViewer.JS_KEY_FORWARD_SLASH = 191; // / -AjaxViewer.JS_KEY_GRAVE_ACCENT = 192; // ` +AjaxViewer.JS_KEY_GRAVE_ACCENT = 192; // ` AjaxViewer.JS_KEY_OPEN_BRACKET = 219; // [ AjaxViewer.JS_KEY_BACK_SLASH = 220; // \ AjaxViewer.JS_KEY_CLOSE_BRACKET = 221; // ] @@ -574,29 +574,29 @@ AjaxViewer.getEventName = function(type) { switch(type) { case AjaxViewer.MOUSE_MOVE : return "MOUSE_MOVE"; - + case AjaxViewer.MOUSE_DOWN : return "MOUSE_DOWN"; - + case AjaxViewer.MOUSE_UP : return "MOUSE_UP"; - + case AjaxViewer.KEY_PRESS : return "KEY_PRESS"; - + case AjaxViewer.KEY_DOWN : return "KEY_DOWN"; - + case AjaxViewer.KEY_UP : return "KEY_UP"; - + case AjaxViewer.EVENT_BAG : return "EVENT_BAG"; - + case AjaxViewer.MOUSE_DBLCLK : return "MOUSE_DBLCLK"; } - + return "N/A"; }; @@ -604,18 +604,18 @@ AjaxViewer.prototype = { setDirty: function(value) { this.dirty = value; }, - + isDirty: function() { return this.dirty; }, - + isImageLoaded: function() { return this.imageLoaded; }, - + refresh: function(imageUrl, tileMap, fullImage) { var ajaxViewer = this; - var img = $(this.img); + var img = $(this.img); this.fullImage = fullImage; this.imgUrl=imageUrl; @@ -624,28 +624,28 @@ AjaxViewer.prototype = { }); this.tileMap = tileMap; }, - + resize: function(panelId, width, height, tileWidth, tileHeight) { $(".canvas_tile", document.body).each(function() { $(this).remove(); }); $("table", $("#" + panelId)).remove(); - + this.width = width; this.height = height; this.tileWidth = tileWidth; this.tileHeight = tileHeight; this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight); }, - + start: function() { var ajaxViewer = this; this.timer = setInterval(function() { ajaxViewer.heartbeat(); }, 50); - + $(document).bind("ajaxError", function(event, XMLHttpRequest, ajaxOptions, thrownError) { ajaxViewer.onAjaxError(event, XMLHttpRequest, ajaxOptions, thrownError); }); - + this.eventQueue = []; // reset event queue this.sendingEventInProgress = false; ajaxViewer.installMouseHook(); @@ -656,20 +656,20 @@ AjaxViewer.prototype = { ajaxViewer.onWindowResize(); }); }, - + stop: function() { clearInterval(this.timer); this.deleteCanvas(); this.uninstallMouseHook(); - this.uninstallKeyboardHook(); + this.uninstallKeyboardHook(); this.eventQueue = []; this.sendingEventInProgress = false; $(document).unbind("ajaxError"); $(window).unbind("resize"); }, - + sendMouseEvent: function(event, x, y, whichButton, modifiers) { this.eventQueue.push({ type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT, @@ -686,7 +686,7 @@ AjaxViewer.prototype = { setupKeyboardTranslationTable : function() { this.keyboardMappers = []; - + var mapper = new KeyboardMapper(); this.keyboardMappers[AjaxViewer.KEYBOARD_TYPE_ENGLISH] = mapper; mapper.setKeyboardType(KeyboardMapper.KEYBOARD_TYPE_COOKED); @@ -704,7 +704,7 @@ AjaxViewer.prototype = { mapper.setKeyboardType(KeyboardMapper.KEYBOARD_TYPE_FR); // JP keyboard plugged in a English host OS -/* +/* mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_COLON] = AjaxViewer.X11_KEY_COLON; mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_CLOSE_BRACKET] = AjaxViewer.X11_KEY_CLOSE_BRACKET; mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_AT_SIGN] = AjaxViewer.X11_KEY_GRAVE_ACCENT; @@ -712,17 +712,17 @@ AjaxViewer.prototype = { mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_BACK_SLASH] = AjaxViewer.X11_KEY_REVERSE_SOLIUS; // X11 REVERSE SOLIDUS mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_YEN_MARK] = AjaxViewer.X11_KEY_YEN_MARK; // X11 YEN SIGN mapper.jsKeyPressX11KeysymMap[61] = [ - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_CIRCUMFLEX_ACCENT, modifiers: 0 }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_CIRCUMFLEX_ACCENT, modifiers: 0 }, - ]; - + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_CIRCUMFLEX_ACCENT, modifiers: 0 }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_CIRCUMFLEX_ACCENT, modifiers: 0 }, + ]; + mapper.jsKeyPressX11KeysymMap[43] = [ - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true } + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true } ]; */ @@ -736,24 +736,24 @@ AjaxViewer.prototype = { mapper.jsX11KeysymMap[186] = AjaxViewer.X11_KEY_COLON; // Chrome mapper.jsX11KeysymMap[226] = AjaxViewer.X11_KEY_REVERSE_SOLIUS; // \| key left to right SHIFT on JP keyboard mapper.jsX11KeysymMap[240] = [ - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_CAPSLOCK, modifiers: 0 }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_CAPSLOCK, modifiers: 0 }, - ]; - + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_CAPSLOCK, modifiers: 0 }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_CAPSLOCK, modifiers: 0 }, + ]; + // for keycode 107, keypress 59 mapper.jsKeyPressX11KeysymMap[59] = [ - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SEMI_COLON, modifiers: 0 }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SEMI_COLON, modifiers: 0 }, - ]; - + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SEMI_COLON, modifiers: 0 }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SEMI_COLON, modifiers: 0 }, + ]; + // for keycode 107, keypress 43 mapper.jsKeyPressX11KeysymMap[43] = [ - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, - {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: 0, shift: false }, + {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, + {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, ]; */ @@ -784,11 +784,11 @@ AjaxViewer.prototype = { } }, // end of the setupKeyboardTranslationTable function - + getCurrentKeyboardMapper : function() { return this.keyboardMappers[this.currentKeyboard]; }, - + setupUIController : function() { var ajaxViewer = this; var pullDownElement = $("#toolbar").find(".pulldown"); @@ -797,13 +797,13 @@ AjaxViewer.prototype = { var subMenu = pullDownElement.find("ul"); var offset = subMenu.parent().offset(); subMenu.css("left", offset.left); - + $("li.current").removeClass("current"); $("li:has(a[cmd$=" + ajaxViewer.currentKeyboard + "])", subMenu).addClass("current"); subMenu.css("z-index", "" + ajaxViewer.maxTileZIndex + 1).show(); return false; }, - + function(e) { pullDownElement.find("ul").hide(); return false; @@ -814,10 +814,10 @@ AjaxViewer.prototype = { $(val).click(function(e) { var cmd = $(e.target).attr("cmd"); if(cmd) - ajaxViewer.onCommand(cmd); + ajaxViewer.onCommand(cmd); else { var cmdLink = $(e.target).closest("a"); - + if(cmdLink.attr("cmd")) { var cmd = cmdLink.attr("cmd"); ajaxViewer.onCommand(cmd); @@ -826,7 +826,7 @@ AjaxViewer.prototype = { }); }); }, - + onCommand : function(cmd) { if(cmd == "keyboard_jp") { $("#toolbar").find(".pulldown").find("ul").hide(); @@ -862,12 +862,12 @@ AjaxViewer.prototype = { } } }, - + sendKeyboardEvent: function(event, code, modifiers) { // back door to open logger window - CTRL-ATL-SHIFT+SPACE - if(code == 32 && + if(code == 32 && (modifiers & AjaxViewer.SHIFT_KEY_MASK | AjaxViewer.CTRL_KEY_MASK | AjaxViewer.ALT_KEY_MASK) == (AjaxViewer.SHIFT_KEY_MASK | AjaxViewer.CTRL_KEY_MASK | AjaxViewer.ALT_KEY_MASK)) { - + if(!g_logger.isOpen()) { g_logger.enable(true); g_logger.open(); @@ -876,7 +876,7 @@ AjaxViewer.prototype = { g_logger.close(); } } - + var len; g_logger.log(Logger.LEVEL_INFO, "Keyboard event: " + AjaxViewer.getEventName(event) + ", code: " + code + ", modifiers: " + modifiers + ', char: ' + String.fromCharCode(code)); this.eventQueue.push({ @@ -889,11 +889,11 @@ AjaxViewer.prototype = { if(event != AjaxViewer.KEY_DOWN) this.checkEventQueue(); }, - + aggregateEvents: function() { var ajaxViewer = this; var aggratedQueue = []; - + var aggregating = false; var mouseX; var mouseY; @@ -924,13 +924,13 @@ AjaxViewer.prototype = { modifiers: 0 }); aggregating = false; - + aggratedQueue.push(item); } } } }); - + if(aggregating) { aggratedQueue.push({ type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT, @@ -941,13 +941,13 @@ AjaxViewer.prototype = { modifiers: 0 }); } - - this.eventQueue = aggratedQueue; + + this.eventQueue = aggratedQueue; }, - + checkEventQueue: function() { var ajaxViewer = this; - + if(!this.sendingEventInProgress && this.eventQueue.length > 0) { var sb = new StringBuilder(); sb.append(""+this.eventQueue.length).append("|"); @@ -968,41 +968,41 @@ AjaxViewer.prototype = { } }); this.eventQueue.length = 0; - + var url = ajaxViewer.updateUrl + "&event=" + AjaxViewer.EVENT_BAG; - + g_logger.log(Logger.LEVEL_TRACE, "Posting client event " + sb.toString() + "..."); - + ajaxViewer.sendingEventInProgress = true; window.onStatusNotify(AjaxViewer.STATUS_SENDING); $.post(url, {data: sb.toString()}, function(data, textStatus) { g_logger.log(Logger.LEVEL_TRACE, "Client event " + sb.toString() + " is posted"); - + ajaxViewer.sendingEventInProgress = false; window.onStatusNotify(AjaxViewer.STATUS_SENT); - + ajaxViewer.checkUpdate(); }, 'html'); } }, - + onAjaxError: function(event, XMLHttpRequest, ajaxOptions, thrownError) { if(window.onClientError != undefined && jQuery.isFunction(window.onClientError)) { window.onClientError(); } }, - + onWindowResize: function() { var offset = this.panel.offset(); - + var row = $('tr:first', this.panel); var cell = $('td:first', row); var tile = this.getTile(cell, 'tile'); - + var tileOffset = tile.offset(); var deltaX = offset.left - tileOffset.left; var deltaY = offset.top - tileOffset.top; - + if(deltaX != 0 || deltaY != 0) { $(".canvas_tile").each(function() { var offsetFrom = $(this).offset(); @@ -1010,28 +1010,28 @@ AjaxViewer.prototype = { }); } }, - + deleteCanvas: function() { $('.canvas_tile', $(document.body)).each(function() { $(this).remove(); }); }, - + generateCanvas: function(wrapperDivId, width, height, tileWidth, tileHeight) { var canvasParent = $('#' + wrapperDivId); canvasParent.width(width); canvasParent.height(height); - + if(window.onCanvasSizeChange != undefined && jQuery.isFunction(window.onCanvasSizeChange)) window.onCanvasSizeChange(width, height); - + var tableDef = '\r\n'; var i = 0; var j = 0; for(i = 0; i < Math.ceil((height + tileHeight - 1) / tileHeight); i++) { var rowHeight = Math.min(height - i*tileHeight, tileHeight); tableDef += '\r\n'; - + for(j = 0; j < Math.ceil((width + tileWidth - 1) / tileWidth); j++) { var colWidth = Math.min(width - j*tileWidth, tileWidth); tableDef += '\r\n'; @@ -1039,40 +1039,40 @@ AjaxViewer.prototype = { tableDef += '\r\n'; } tableDef += '
\r\n'; - + return $(tableDef).appendTo(canvasParent); }, - + getTile: function(cell, name) { var clonedDiv = cell.data(name); if(!clonedDiv) { var offset = cell.offset(); - var divDef = "
"; - + clonedDiv = $(divDef).appendTo($(document.body)); cell.data(name, clonedDiv); } - + return clonedDiv; }, - + initCell: function(cell) { if(!cell.data("init")) { cell.data("init", true); - + cell.data("current", 0); this.getTile(cell, "tile2"); this.getTile(cell, "tile"); } }, - + displayCell: function(cell, bg) { var div; var divPrev; if(!cell.data("current")) { cell.data("current", 1); - + divPrev = this.getTile(cell, "tile"); div = this.getTile(cell, "tile2"); } else { @@ -1080,13 +1080,13 @@ AjaxViewer.prototype = { divPrev = this.getTile(cell, "tile2"); div = this.getTile(cell, "tile"); } - + var zIndex = parseInt(divPrev.css("z-index")) + 1; this.maxTileZIndex = Math.max(this.maxTileZIndex, zIndex); div.css("z-index", zIndex); div.css("background", bg); }, - + updateTile: function() { if(this.dirty) { var ajaxViewer = this; @@ -1094,7 +1094,7 @@ AjaxViewer.prototype = { var tileHeight = this.tileHeight; var imgUrl = this.imgUrl; var panel = this.panel; - + if(this.fullImage) { $.each(this.tileMap, function() { var i = $(this)[0]; @@ -1102,7 +1102,7 @@ AjaxViewer.prototype = { var row = $("TR:eq("+i+")", panel); var cell = $("TD:eq("+j+")", row); var attr = "url(" + imgUrl + ") -"+j*tileWidth+"px -"+i*tileHeight + "px"; - + ajaxViewer.initCell(cell); ajaxViewer.displayCell(cell, attr); }); @@ -1114,25 +1114,25 @@ AjaxViewer.prototype = { var attr = "url(" + imgUrl + ") no-repeat -"+offset+"px 0px"; var row = $("TR:eq("+i+")", panel); var cell = $("TD:eq("+j+")", row); - + ajaxViewer.initCell(cell); ajaxViewer.displayCell(cell, attr); }); } - + this.dirty = false; } }, - + heartbeat: function() { this.checkEventQueue(); this.checkUpdate(); }, - + checkUpdate: function() { if(!this.isDirty()) return; - + if(this.isImageLoaded()) { this.updateTile(); var url = this.updateUrl; @@ -1147,84 +1147,84 @@ AjaxViewer.prototype = { eval(data); ajaxViewer.setDirty(true); window.onStatusNotify(AjaxViewer.STATUS_RECEIVED); - + ajaxViewer.checkUpdate(); } }); - } + } }, - + ptInPanel: function(pageX, pageY) { var mainPanel = this.panel; - + var offset = mainPanel.offset(); var x = pageX - offset.left; var y = pageY - offset.top; - + if(x < 0 || y < 0 || x > mainPanel.width() - 1 || y > mainPanel.height() - 1) return false; return true; }, - + pageToPanel: function(pageX, pageY) { var mainPanel = this.panel; - + var offset = mainPanel.offset(); var x = pageX - offset.left; var y = pageY - offset.top; - + if(x < 0) x = 0; if(x > mainPanel.width() - 1) x = mainPanel.width() - 1; - + if(y < 0) y = 0; if(y > mainPanel.height() - 1) y = mainPanel.height() - 1; - + return { x: Math.ceil(x), y: Math.ceil(y) }; }, - + installMouseHook: function() { var ajaxViewer = this; var target = $(document.body); - + target.mousemove(function(e) { if(!ajaxViewer.ptInPanel(e.pageX, e.pageY)) return true; - - var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); + + var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); ajaxViewer.onMouseMove(pt.x, pt.y); - + e.stopPropagation(); return false; }); - + target.mousedown(function(e) { ajaxViewer.panel.parent().focus(); - + if(!ajaxViewer.ptInPanel(e.pageX, e.pageY)) return true; - + var modifiers = ajaxViewer.getKeyModifiers(e); var whichButton = e.button; - - var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); + + var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); ajaxViewer.onMouseDown(pt.x, pt.y, whichButton, modifiers); - + e.stopPropagation(); return false; }); - + target.mouseup(function(e) { if(!ajaxViewer.ptInPanel(e.pageX, e.pageY)) return true; - + var modifiers = ajaxViewer.getKeyModifiers(e); var whichButton = e.button; - - var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); + + var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY); ajaxViewer.onMouseUp(pt.x, pt.y, whichButton, modifiers); e.stopPropagation(); @@ -1247,11 +1247,11 @@ AjaxViewer.prototype = { e.stopPropagation(); return false; }); - + // disable browser right-click context menu target.bind("contextmenu", function() { return false; }); }, - + uninstallMouseHook : function() { var target = $(document); target.unbind("mousemove"); @@ -1259,7 +1259,7 @@ AjaxViewer.prototype = { target.unbind("mouseup"); target.unbind("contextmenu"); }, - + requiresDefaultKeyProcess : function(e) { switch(e.which) { case 8 : // backspace @@ -1281,16 +1281,16 @@ AjaxViewer.prototype = { case 47 : // FORWARD SLASH // Added to stop Firefox's quick search from opening return false; } - + if(this.getKeyModifiers(e) == AjaxViewer.SHIFT_KEY_MASK) return true; - + if(this.getKeyModifiers(e) != 0) return false; - + return true; }, - + installKeyboardHook: function() { var ajaxViewer = this; var target = $(document); @@ -1301,65 +1301,65 @@ AjaxViewer.prototype = { e.stopPropagation(); if(ajaxViewer.requiresDefaultKeyProcess(e)) return true; - + e.preventDefault(); return false; }); - + target.keydown(function(e) { ajaxViewer.onKeyDown(e.which, ajaxViewer.getKeyModifiers(e)); - + e.stopPropagation(); if(ajaxViewer.requiresDefaultKeyProcess(e)) return true; - + e.preventDefault(); return false; }); - + target.keyup(function(e) { ajaxViewer.onKeyUp(e.which, ajaxViewer.getKeyModifiers(e)); e.stopPropagation(); if(ajaxViewer.requiresDefaultKeyProcess(e)) return true; - + e.preventDefault(); return false; }); }, - + uninstallKeyboardHook : function() { var target = $(document); target.unbind("keypress"); target.unbind("keydown"); target.unbind("keyup"); }, - + onMouseMove: function(x, y) { this.sendMouseEvent(AjaxViewer.MOUSE_MOVE, x, y, 0, 0); }, - + onMouseDown: function(x, y, whichButton, modifiers) { this.sendMouseEvent(AjaxViewer.MOUSE_DOWN, x, y, whichButton, modifiers); }, - + onMouseUp: function(x, y, whichButton, modifiers) { this.sendMouseEvent(AjaxViewer.MOUSE_UP, x, y, whichButton, modifiers); - + var curTick = new Date().getTime(); if(this.lastClickEvent.time && (curTick - this.lastClickEvent.time < 300)) { - this.onMouseDblClick(this.lastClickEvent.x, this.lastClickEvent.y, + this.onMouseDblClick(this.lastClickEvent.x, this.lastClickEvent.y, this.lastClickEvent.button, this.lastClickEvent.modifiers); } - + this.lastClickEvent.x = x; this.lastClickEvent.y = y; this.lastClickEvent.button = whichButton; this.lastClickEvent.modifiers = modifiers; this.lastClickEvent.time = curTick; }, - + onMouseDblClick: function(x, y, whichButton, modifiers) { this.sendMouseEvent(AjaxViewer.MOUSE_DBLCLK, x, y, whichButton, modifiers); }, @@ -1368,73 +1368,72 @@ AjaxViewer.prototype = { this.sendMouseEvent(AjaxViewer.MOUSE_SCROLL, x, y, whichButton, modifiers); }, - + onKeyPress: function(code, modifiers) { g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-PRESS: " + code + ", modifers: " + modifiers); - + this.dispatchKeyboardInput(AjaxViewer.KEY_PRESS, code, modifiers); }, - + onKeyDown: function(code, modifiers) { g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-DOWN: " + code + ", modifers: " + modifiers); - + this.dispatchKeyboardInput(AjaxViewer.KEY_DOWN, code, modifiers); }, - + onKeyUp: function(code, modifiers) { g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-UP: " + code + ", modifers: " + modifiers); - + this.dispatchKeyboardInput(AjaxViewer.KEY_UP, code, modifiers); }, - + dispatchKeyboardInput : function(event, code, modifiers) { var keyboardMapper = ajaxViewer.getCurrentKeyboardMapper(); keyboardMapper.inputFeed(event, code, modifiers, this.guestos, $.browser, $.browser.version); this.dispatchMappedKeyboardInput(keyboardMapper.getMappedInput()); }, - + dispatchMappedKeyboardInput : function(mappedInput) { for(var i = 0; i < mappedInput.length; i++) { switch(mappedInput[i].type) { case AjaxViewer.KEY_DOWN : this.sendKeyboardEvent(AjaxViewer.KEY_DOWN, mappedInput[i].code, mappedInput[i].modifiers); break; - + case AjaxViewer.KEY_UP : this.sendKeyboardEvent(AjaxViewer.KEY_UP, mappedInput[i].code, mappedInput[i].modifiers); break; - + case AjaxViewer.KEY_PRESS : this.sendKeyboardEvent(AjaxViewer.KEY_PRESS, mappedInput[i].code, mappedInput[i].modifiers); break; } } }, - + getKeyModifiers: function(e) { var modifiers = 0; if(e.altKey) modifiers |= AjaxViewer.ALT_KEY_MASK; - + if(e.altLeft) modifiers |= AjaxViewer.LEFT_ALT_MASK; - + if(e.ctrlKey) modifiers |= AjaxViewer.CTRL_KEY_MASK; - + if(e.ctrlLeft) modifiers |= AjaxViewer.LEFT_CTRL_MASK; - + if(e.shiftKey) modifiers |= AjaxViewer.SHIFT_KEY_MASK; - + if(e.shiftLeft) modifiers |= AjaxViewer.LEFT_SHIFT_MASK; - + if(e.metaKey) modifiers |= AjaxViewer.META_KEY_MASK; - + return modifiers; } }; - diff --git a/systemvm/js/cloud.logger.js b/systemvm/agent/js/cloud.logger.js similarity index 91% rename from systemvm/js/cloud.logger.js rename to systemvm/agent/js/cloud.logger.js index 5e61accd16d..d2f20792f8b 100644 --- a/systemvm/js/cloud.logger.js +++ b/systemvm/agent/js/cloud.logger.js @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,14 +28,14 @@ under the License. function Logger() { this.bDockEnabled = true; - + this.logWin = null; this.logger = null; this.header = null; - + this.bEnabled = true; this.level = 0; - + this.bMoving = false; this.offsetStart = {left: 0, top: 0}; this.ptStart = {x: 0, y: 0}; @@ -51,24 +51,24 @@ Logger.LEVEL_FATAL = 5; Logger.LEVEL_SYS = 100; Logger.prototype = { - + open: function() { if(this.logWin) { this.logWin.show(); - + this.log(Logger.LEVEL_SYS, "Logger is open in browser: " + this.objectToString($.browser)); return; } - + var logger = this; - var logWinMarkup = [ + var logWinMarkup = [ '
', '
', '
', - '', - '', - '', - '
', + '', + '', + '', + '', '', - '
', + '', + '', '
', '
', - '', + '', '', '
', '
', '
', '
' ].join(''); - + this.logWin = $(logWinMarkup).appendTo(document.body); this.header = $('.logwin_title:first', this.logWin); this.logger = $('.logwin_content:first', this.logWin); @@ -95,22 +95,22 @@ Logger.prototype = { $(".logwin_title", this.logWin).mousedown(function(e) { if($(e.target).attr('cmd')) return true; - + if(!logger.bMoving) { logger.bMoving = true; logger.offsetStart = logger.logWin.offset(); logger.ptStart = {x: e.pageX, y: e.pageY}; - + $(document).bind("mousemove", function(e) { if(logger.bMoving) { logger.enableDocking(false); - + var logWinNewLeft = logger.offsetStart.left + e.pageX - logger.ptStart.x; var logWinNewTop = logger.offsetStart.top + e.pageY - logger.ptStart.y; - + logger.logWin.css("left", logWinNewLeft + "px").css("top", logWinNewTop + "px"); } - return false; + return false; }); $(document).bind("mouseup", function(e) { @@ -118,98 +118,98 @@ Logger.prototype = { logger.bMoving = false; $(document).unbind("mousemove", arguments.callee.name); $(document).unbind("mouseup", arguments.callee.name); - + return false; } return true; }); } - + // prevent default handling return false; }).dblclick(function(e) { logger.expand(!logger.isExpanded()); }); - + this.logWin.click(function(e) { if($(e.target).attr('cmd')) { switch($(e.target).attr('cmd')) { case '1' : logger.enable(true); break; - + case '2' : logger.enable(false); break; - + case '3' : logger.clear(); break; - + case '4' : logger.enableDocking(true); logger.dockIn(); break; - + case '5' : logger.expand(!logger.isExpanded()); break; - + default : break; } } }); - + $("#template_type", this.logWin).change(function(e) { logger.setLevel(parseInt($(this).val())); }); - + this.logWin.css("left", (($(document.body).width() - this.logWin.width()) / 2) + "px"); this.dockIn(); - + this.log(Logger.LEVEL_SYS, "Logger is open in browser: " + this.objectToString($.browser)); }, - + close: function() { if(this.logWin) this.logWin.hide(); }, - + isOpen: function() { if(this.logWin) return this.logWin.is(":visible"); return false; }, - + dockIn: function() { var logger = this; var offset = this.logWin.offset(); var bottom = offset.top + this.logWin.height(); var delta = bottom - 2; - - this.logWin.animate({top: (offset.top - delta) + "px"}, 200, + + this.logWin.animate({top: (offset.top - delta) + "px"}, 200, function() { logger.logWin.unbind("mouseleave"); logger.logWin.bind("mouseenter", function(e) { if(logger.bDockEnabled) logger.dockOut(); }); - } + } ); }, - + dockOut: function() { var logger = this; - this.logWin.animate({top: "0px"}, 200, + this.logWin.animate({top: "0px"}, 200, function() { logger.logWin.unbind("mouseenter"); logger.logWin.bind("mouseleave", function(e) { if(logger.bDockEnabled) { var xPosInLogWin = e.pageX - logger.logWin.offset().left; var yPosInLogWin = e.pageY - logger.logWin.offset().top; - - if(xPosInLogWin < 0 || yPosInLogWin < 0 || + + if(xPosInLogWin < 0 || yPosInLogWin < 0 || xPosInLogWin > logger.logWin.width() || yPosInLogWin > logger.logWin.height()) { logger.dockIn(); } @@ -218,11 +218,11 @@ Logger.prototype = { } ); }, - + enableDocking: function(bEnable) { this.bDockEnabled = bEnable; }, - + log: function(level, message) { // Note : LEVEL_SYS message will always be logged if(this.logger && (level == Logger.LEVEL_SYS || this.bEnabled && level >= this.level)) { @@ -236,33 +236,33 @@ Logger.prototype = { ':', curTime.getMinutes(), ":", curTime.getSeconds(), ".", curTime.getMilliseconds()].join(''); - + this.logger.append(this.getLevelDisplayString(level) + " - " + curTimeString + " - " + message + '
'); } }, - + clear: function() { if(this.logger) { this.logger.empty(); this.log(Logger.LEVEL_SYS, "Logger is cleared"); } }, - + setLevel: function(level) { this.level = level; - + this.log(Logger.LEVEL_SYS, "Set logger trace level to " + this.getLevelDisplayString(level)); }, - + enable: function(bEnabled) { this.bEnabled = bEnabled; - + if(bEnabled) this.log(Logger.LEVEL_SYS, "Logger is enabled"); else this.log(Logger.LEVEL_SYS, "Logger is disabled"); }, - + expand: function(bExpand) { if(bExpand) { this.logWin.height(Logger.DEFAULT_WIN_HEIGHT); @@ -272,59 +272,59 @@ Logger.prototype = { this.logger.height(0); } }, - + isExpanded: function() { return this.logWin.height() > this.header.height(); }, - + getLevelDisplayString: function(level) { switch(level) { case Logger.LEVEL_TRACE : return "TRACE"; - + case Logger.LEVEL_DEBUG : return "DEBUG"; - + case Logger.LEVEL_INFO : return "INFO"; - + case Logger.LEVEL_WARN : return "WARN"; - + case Logger.LEVEL_ERROR : return "ERROR"; - + case Logger.LEVEL_FATAL : return "FATAL"; - + case Logger.LEVEL_SYS : return "SYSINFO"; } - + return "LEVEL " + level; }, - + // this is a util function which actually can be put elsewhere instead of in this class objectToString : function(object) { if(object) { if(object instanceof Object) { var sb = ['{' ]; - + $.each(object, function(name, val) { sb.push('' + name + ': '); - + if(val instanceof Object) { sb.push(this.objectToString(val)); } else { sb.push('' + val); } - + sb.push(','); }); - + if(sb[sb.length - 1] == ',' ) sb.length = sb.length - 1; - + sb.push('}'); return sb.join(""); } else { @@ -335,4 +335,3 @@ Logger.prototype = { } } }; - diff --git a/systemvm/js/handler.js b/systemvm/agent/js/handler.js similarity index 99% rename from systemvm/js/handler.js rename to systemvm/agent/js/handler.js index d22ff079ee6..b820f1e2e23 100644 --- a/systemvm/js/handler.js +++ b/systemvm/agent/js/handler.js @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/js/jquery.flot.navigate.js b/systemvm/agent/js/jquery.flot.navigate.js similarity index 96% rename from systemvm/js/jquery.flot.navigate.js rename to systemvm/agent/js/jquery.flot.navigate.js index 02d189f6190..a7bb023d9b5 100644 --- a/systemvm/js/jquery.flot.navigate.js +++ b/systemvm/agent/js/jquery.flot.navigate.js @@ -17,7 +17,7 @@ Options: trigger: "dblclick" // or "click" for single click amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out) } - + pan: { interactive: false cursor: "move" // CSS mouse cursor value used when dragging, e.g. "pointer" @@ -28,7 +28,7 @@ Options: zoomRange: null // or [number, number] (min range, max range) or false panRange: null // or [number, number] (min, max) or false } - + "interactive" enables the built-in drag/click behaviour. If you enable interactive for pan, then you'll have a basic plot that supports moving around; the same for zoom. @@ -58,16 +58,16 @@ panRange to false, panning on that axis will be disabled. Example API usage: plot = $.plot(...); - - // zoom default amount in on the pixel (10, 20) + + // zoom default amount in on the pixel (10, 20) plot.zoom({ center: { left: 10, top: 20 } }); // zoom out again plot.zoomOut({ center: { left: 10, top: 20 } }); - // zoom 200% in on the pixel (10, 20) + // zoom 200% in on the pixel (10, 20) plot.zoom({ amount: 2, center: { left: 10, top: 20 } }); - + // pan 100 pixels to the left and 20 down plot.pan({ left: -100, top: 20 }) @@ -79,7 +79,7 @@ you convert between these). "amount" is the amount to zoom the viewport relative to the current range, so 1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out). You can set the default in the options. - + */ @@ -88,7 +88,7 @@ range, so 1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is // effort of downloading them. /* -jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) +jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt */ (function(E){E.fn.drag=function(L,K,J){if(K){this.bind("dragstart",L)}if(J){this.bind("dragend",J)}return !L?this.trigger("drag"):this.bind("drag",K?K:L)};var A=E.event,B=A.special,F=B.drag={not:":input",distance:0,which:1,dragging:false,setup:function(J){J=E.extend({distance:F.distance,which:F.which,not:F.not},J||{});J.distance=I(J.distance);A.add(this,"mousedown",H,J);if(this.attachEvent){this.attachEvent("ondragstart",D)}},teardown:function(){A.remove(this,"mousedown",H);if(this===F.dragging){F.dragging=F.proxy=false}G(this,true);if(this.detachEvent){this.detachEvent("ondragstart",D)}}};B.dragstart=B.dragend={setup:function(){},teardown:function(){}};function H(L){var K=this,J,M=L.data||{};if(M.elem){K=L.dragTarget=M.elem;L.dragProxy=F.proxy||K;L.cursorOffsetX=M.pageX-M.left;L.cursorOffsetY=M.pageY-M.top;L.offsetX=L.pageX-L.cursorOffsetX;L.offsetY=L.pageY-L.cursorOffsetY}else{if(F.dragging||(M.which>0&&L.which!=M.which)||E(L.target).is(M.not)){return }}switch(L.type){case"mousedown":E.extend(M,E(K).offset(),{elem:K,target:L.target,pageX:L.pageX,pageY:L.pageY});A.add(document,"mousemove mouseup",H,M);G(K,false);F.dragging=null;return false;case !F.dragging&&"mousemove":if(I(L.pageX-M.pageX)+I(L.pageY-M.pageY) max) { @@ -256,14 +256,14 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L ((zr[0] != null && range < zr[0]) || (zr[1] != null && range > zr[1]))) return; - + opts.min = min; opts.max = max; }); - + plot.setupGrid(); plot.draw(); - + if (!args.preventEvent) plot.getPlaceholder().trigger("plotzoom", [ plot ]); } @@ -289,7 +289,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L var pr = opts.panRange; if (pr === false) // no panning on this axis return; - + if (pr) { // check whether we hit the wall if (pr[0] != null && pr[0] > min) { @@ -297,21 +297,21 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L min += d; max += d; } - + if (pr[1] != null && pr[1] < max) { d = pr[1] - max; min += d; max += d; } } - + opts.min = min; opts.max = max; }); - + plot.setupGrid(); plot.draw(); - + if (!args.preventEvent) plot.getPlaceholder().trigger("plotpan", [ plot ]); } @@ -325,11 +325,11 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L if (panTimeout) clearTimeout(panTimeout); } - + plot.hooks.bindEvents.push(bindEvents); plot.hooks.shutdown.push(shutdown); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/systemvm/js/jquery.js b/systemvm/agent/js/jquery.js similarity index 100% rename from systemvm/js/jquery.js rename to systemvm/agent/js/jquery.js diff --git a/systemvm/scripts/_run.sh b/systemvm/agent/scripts/_run.sh similarity index 99% rename from systemvm/scripts/_run.sh rename to systemvm/agent/scripts/_run.sh index 96cc88bb17c..1b473f64ebf 100755 --- a/systemvm/scripts/_run.sh +++ b/systemvm/agent/scripts/_run.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/scripts/config_auth.sh b/systemvm/agent/scripts/config_auth.sh similarity index 97% rename from systemvm/scripts/config_auth.sh rename to systemvm/agent/scripts/config_auth.sh index 4b74f8eb995..b5781feb6c7 100755 --- a/systemvm/scripts/config_auth.sh +++ b/systemvm/agent/scripts/config_auth.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -18,7 +18,7 @@ - + BASE_DIR="/var/www/html/copy/template/" @@ -43,7 +43,7 @@ config_htaccess() { let "result=$result+$?" echo "Require valid-user" >> $HTACCESS let "result=$result+$?" - return $result + return $result } write_passwd() { @@ -65,5 +65,5 @@ then exit 2 fi -config_htaccess +config_htaccess exit $? diff --git a/systemvm/scripts/config_ssl.sh b/systemvm/agent/scripts/config_ssl.sh similarity index 95% rename from systemvm/scripts/config_ssl.sh rename to systemvm/agent/scripts/config_ssl.sh index 931c1a5120a..b8cf47c23e3 100755 --- a/systemvm/scripts/config_ssl.sh +++ b/systemvm/agent/scripts/config_ssl.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -47,8 +47,6 @@ config_apache2_conf() { cp -f /etc/apache2/sites-available/default-ssl.orig /etc/apache2/sites-available/default-ssl sed -i -e "s///" /etc/apache2/sites-available/default sed -i -e "s///" /etc/apache2/sites-available/default-ssl - sed -i -e "s/Listen .*:80/Listen $ip:80/g" /etc/apache2/ports.conf - sed -i -e "s/Listen .*:443/Listen $ip:443/g" /etc/apache2/ports.conf sed -i 's/ssl-cert-snakeoil.key/cert_apache.key/' /etc/apache2/sites-available/default-ssl sed -i 's/ssl-cert-snakeoil.pem/cert_apache.crt/' /etc/apache2/sites-available/default-ssl sed -i 's/SSLProtocol.*$/SSLProtocol all -SSLv2 -SSLv3/' /etc/apache2/sites-available/default-ssl @@ -90,7 +88,7 @@ copy_certs() { return $? fi if [ ! -z customCertChain ] && [ -f $customCertChain ] ; then - cp $customCertChain /etc/httpd/ssl/certs + cp $customCertChain /etc/httpd/ssl/certs fi return 1 } @@ -158,7 +156,7 @@ fi if [ "$cflag" == "1" ] then - if [ "$cpkflag$cpcflag" != "11" ] + if [ "$cpkflag$cpcflag" != "11" ] then help exit 1 @@ -175,7 +173,7 @@ then exit 3 fi - if [ "$cccflag" == "1" ] + if [ "$cccflag" == "1" ] then if [ ! -f "$customCertChain" ] then @@ -208,10 +206,7 @@ fi if [ -d /etc/apache2 ] then config_apache2_conf $publicIp $hostName - /etc/init.d/apache2 stop - /etc/init.d/apache2 start + systemctl restart apache2 else config_httpd_conf $publicIp $hostName fi - - diff --git a/systemvm/scripts/consoleproxy.sh b/systemvm/agent/scripts/consoleproxy.sh similarity index 99% rename from systemvm/scripts/consoleproxy.sh rename to systemvm/agent/scripts/consoleproxy.sh index 294d5974bb5..1adbcc1a97e 100755 --- a/systemvm/scripts/consoleproxy.sh +++ b/systemvm/agent/scripts/consoleproxy.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/scripts/ipfirewall.sh b/systemvm/agent/scripts/ipfirewall.sh similarity index 99% rename from systemvm/scripts/ipfirewall.sh rename to systemvm/agent/scripts/ipfirewall.sh index 4711b8ac6db..7450f7fca8a 100755 --- a/systemvm/scripts/ipfirewall.sh +++ b/systemvm/agent/scripts/ipfirewall.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -47,4 +47,3 @@ do ips "$i" done exit $? - diff --git a/systemvm/scripts/run-proxy.sh b/systemvm/agent/scripts/run-proxy.sh similarity index 94% rename from systemvm/scripts/run-proxy.sh rename to systemvm/agent/scripts/run-proxy.sh index d6ccf7c0091..f26f54b12b5 100644 --- a/systemvm/scripts/run-proxy.sh +++ b/systemvm/agent/scripts/run-proxy.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -18,11 +18,11 @@ - + #run.sh runs the console proxy. -# make sure we delete the old files from the original template +# make sure we delete the old files from the original template rm console-proxy.jar rm console-common.jar rm conf/cloud.properties @@ -44,5 +44,5 @@ done # ;; # esac # done - + java -mx700m -cp $CP:./conf com.cloud.consoleproxy.ConsoleProxy $@ diff --git a/systemvm/scripts/run.sh b/systemvm/agent/scripts/run.sh similarity index 99% rename from systemvm/scripts/run.sh rename to systemvm/agent/scripts/run.sh index 7923a34931f..3ef001be31b 100755 --- a/systemvm/scripts/run.sh +++ b/systemvm/agent/scripts/run.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/scripts/secstorage.sh b/systemvm/agent/scripts/secstorage.sh similarity index 99% rename from systemvm/scripts/secstorage.sh rename to systemvm/agent/scripts/secstorage.sh index b45afc2e8ca..f210bb79615 100755 --- a/systemvm/scripts/secstorage.sh +++ b/systemvm/agent/scripts/secstorage.sh @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/scripts/ssvm-check.sh b/systemvm/agent/scripts/ssvm-check.sh similarity index 97% rename from systemvm/scripts/ssvm-check.sh rename to systemvm/agent/scripts/ssvm-check.sh index ffd3d954305..2abab81da72 100644 --- a/systemvm/scripts/ssvm-check.sh +++ b/systemvm/agent/scripts/ssvm-check.sh @@ -6,16 +6,16 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - + # Health check script for the Secondary Storage VM @@ -29,7 +29,7 @@ do value=`echo $i | cut -d= -f2` case $key in host) - MGMTSERVER=$value + MGMTSERVER=$value ;; esac done @@ -141,6 +141,6 @@ else fi echo ================================================ -echo Tests Complete. Look for ERROR or WARNING above. +echo Tests Complete. Look for ERROR or WARNING above. exit 0 diff --git a/systemvm/scripts/utils.sh b/systemvm/agent/scripts/utils.sh similarity index 100% rename from systemvm/scripts/utils.sh rename to systemvm/agent/scripts/utils.sh diff --git a/systemvm/ui/viewer-bad-sid.ftl b/systemvm/agent/ui/viewer-bad-sid.ftl similarity index 99% rename from systemvm/ui/viewer-bad-sid.ftl rename to systemvm/agent/ui/viewer-bad-sid.ftl index 2f30ec36015..fa1625a94d8 100644 --- a/systemvm/ui/viewer-bad-sid.ftl +++ b/systemvm/agent/ui/viewer-bad-sid.ftl @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/ui/viewer-connect-failed.ftl b/systemvm/agent/ui/viewer-connect-failed.ftl similarity index 99% rename from systemvm/ui/viewer-connect-failed.ftl rename to systemvm/agent/ui/viewer-connect-failed.ftl index 9d907cacb43..eb715ad7bef 100644 --- a/systemvm/ui/viewer-connect-failed.ftl +++ b/systemvm/agent/ui/viewer-connect-failed.ftl @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/ui/viewer-update.ftl b/systemvm/agent/ui/viewer-update.ftl similarity index 97% rename from systemvm/ui/viewer-update.ftl rename to systemvm/agent/ui/viewer-update.ftl index 6bf9ab35ce7..6de70338b69 100644 --- a/systemvm/ui/viewer-update.ftl +++ b/systemvm/agent/ui/viewer-update.ftl @@ -18,7 +18,6 @@ under the License. --> tileMap = [ ${tileSequence} ]; <#if resized == true> - ajaxViewer.resize('main_panel', ${width}, ${height}, ${tileWidth}, ${tileHeight}); + ajaxViewer.resize('main_panel', ${width}, ${height}, ${tileWidth}, ${tileHeight}); ajaxViewer.refresh('${imgUrl}', tileMap, false); - diff --git a/systemvm/ui/viewer.ftl b/systemvm/agent/ui/viewer.ftl similarity index 84% rename from systemvm/ui/viewer.ftl rename to systemvm/agent/ui/viewer.ftl index 62de193cf7b..e6b12071111 100644 --- a/systemvm/ui/viewer.ftl +++ b/systemvm/agent/ui/viewer.ftl @@ -6,9 +6,9 @@ regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,26 +28,26 @@ under the License.
- + - + diff --git a/systemvm/bindir/cloud-setup-console-proxy.in b/systemvm/bindir/cloud-setup-console-proxy.in deleted file mode 100755 index 6439c0fc329..00000000000 --- a/systemvm/bindir/cloud-setup-console-proxy.in +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -import sys, os, subprocess, errno, re, getopt - -# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ---- -# ---- We do this so cloud_utils can be looked up in the following order: -# ---- 1) Sources directory -# ---- 2) waf configured PYTHONDIR -# ---- 3) System Python path -for pythonpath in ( - "@PYTHONDIR@", - os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"), - ): - if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath) -# ---- End snippet of code ---- -import cloud_utils -from cloud_utils import stderr - -E_GENERIC= 1 -E_NOKVM = 2 -E_NODEFROUTE = 3 -E_DHCP = 4 -E_NOPERSISTENTNET = 5 -E_NETRECONFIGFAILED = 6 -E_VIRTRECONFIGFAILED = 7 -E_FWRECONFIGFAILED = 8 -E_CPRECONFIGFAILED = 9 -E_CPFAILEDTOSTART = 10 -E_NOFQDN = 11 - -def bail(errno=E_GENERIC,message=None,*args): - if message: stderr(message,*args) - stderr("Cloud Console Proxy setup aborted") - sys.exit(errno) - - -#---------------- boilerplate for python 2.4 support - - -# CENTOS does not have this -- we have to put this here -try: - from subprocess import check_call - from subprocess import CalledProcessError -except ImportError: - def check_call(*popenargs, **kwargs): - import subprocess - retcode = subprocess.call(*popenargs, **kwargs) - cmd = kwargs.get("args") - if cmd is None: cmd = popenargs[0] - if retcode: raise CalledProcessError(retcode, cmd) - return retcode - - class CalledProcessError(Exception): - def __init__(self, returncode, cmd): - self.returncode = returncode ; self.cmd = cmd - def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) - -# ------------ end boilerplate ------------------------- - -def check_hostname(): return check_call(["hostname",'--fqdn']) - -class Command: - def __init__(self,name,parent=None): - self.__name = name - self.__parent = parent - def __getattr__(self,name): - if name == "_print": name = "print" - return Command(name,self) - def __call__(self,*args): - cmd = self.__get_recursive_name() + list(args) - #print " ",cmd - popen = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - m = popen.communicate() - ret = popen.wait() - if ret: - e = CalledProcessError(ret,cmd) - e.stdout,e.stderr = m - raise e - class CommandOutput: - def __init__(self,stdout,stderr): - self.stdout = stdout - self.stderr = stderr - return CommandOutput(*m) - def __lt__(self,other): - cmd = self.__get_recursive_name() - #print " ",cmd,"<",other - popen = subprocess.Popen(cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - m = popen.communicate(other) - ret = popen.wait() - if ret: - e = CalledProcessError(ret,cmd) - e.stdout,e.stderr = m - raise e - class CommandOutput: - def __init__(self,stdout,stderr): - self.stdout = stdout - self.stderr = stderr - return CommandOutput(*m) - - def __get_recursive_name(self,sep=None): - m = self - l = [] - while m is not None: - l.append(m.__name) - m = m.__parent - l.reverse() - if sep: return sep.join(l) - else: return l - def __str__(self): - return ''%self.__get_recursive_name(sep=" ") - - def __repr__(self): return self.__str__() - -ip = Command("ip") -service = Command("service") -chkconfig = Command("chkconfig") -ufw = Command("ufw") -iptables = Command("iptables") -augtool = Command("augtool") -ifconfig = Command("ifconfig") -uuidgen = Command("uuidgen") - -Fedora = os.path.exists("/etc/fedora-release") -CentOS = os.path.exists("/etc/centos-release") or ( os.path.exists("/etc/redhat-release") and not os.path.exists("/etc/fedora-release") ) - -#--------------- procedure starts here ------------ - -def main(): - # parse cmd line - opts, args = getopt.getopt(sys.argv[1:], "a", ["host=", "zone=", "pod="]) - host=None - zone=None - pod=None - autoMode=False - do_check_kvm = True - for opt, arg in opts: - if opt == "--host": - if arg != "": - host = arg - elif opt == "--zone": - if arg != "": - zone = arg - elif opt == "--pod": - if arg != "": - pod = arg - elif opt == "-a": - autoMode=True - servicename = "@PACKAGE@-console-proxy" - - if autoMode: - cloud_utils.setLogFile("/var/log/cloud/setupConsoleProxy.log") - - stderr("Welcome to the Cloud Console Proxy setup") - stderr("") - - try: - check_hostname() - stderr("The hostname of this machine is properly set up") - except CalledProcessError,e: - bail(E_NOFQDN,"This machine does not have an FQDN (fully-qualified domain name) for a hostname") - - stderr("Stopping the Cloud Console Proxy") - cloud_utils.stop_service(servicename) - stderr("Cloud Console Proxy stopped") - - ports = "8002".split() - if Fedora or CentOS: - try: - o = chkconfig("--list","iptables") - if ":on" in o.stdout and os.path.exists("/etc/sysconfig/iptables"): - stderr("Setting up firewall rules to permit traffic to Cloud services") - service.iptables.start() ; print o.stdout + o.stderr - for p in ports: iptables("-I","INPUT","1","-p","tcp","--dport",p,'-j','ACCEPT') - o = service.iptables.save() ; print o.stdout + o.stderr - except CalledProcessError,e: - print e.stdout+e.stderr - bail(E_FWRECONFIGFAILED,"Firewall rules could not be set") - else: - stderr("Setting up firewall rules to permit traffic to Cloud services") - try: - for p in ports: ufw.allow(p) - stderr("Rules set") - except CalledProcessError,e: - print e.stdout+e.stderr - bail(E_FWRECONFIGFAILED,"Firewall rules could not be set") - - stderr("We are going to enable ufw now. This may disrupt network connectivity and service availability. See the ufw documentation for information on how to manage ufw firewall policies.") - try: - o = ufw.enable < "y\n" ; print o.stdout + o.stderr - except CalledProcessError,e: - print e.stdout+e.stderr - bail(E_FWRECONFIGFAILED,"Firewall could not be enabled") - - cloud_utils.setup_consoleproxy_config("@CPSYSCONFDIR@/agent.properties", host, zone, pod) - stderr("Enabling and starting the Cloud Console Proxy") - cloud_utils.enable_service(servicename) - stderr("Cloud Console Proxy restarted") - -if __name__ == "__main__": - main() - -# FIXMES: 1) nullify networkmanager on ubuntu (asking the user first) and enable the networking service permanently diff --git a/systemvm/conf.dom0/agent.properties.in b/systemvm/conf.dom0/agent.properties.in deleted file mode 100644 index 1920481c03f..00000000000 --- a/systemvm/conf.dom0/agent.properties.in +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Sample configuration file for VMOPS console proxy - -instance=ConsoleProxy -consoleproxy.httpListenPort=8002 - -#resource= the java class, which agent load to execute -resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource - -#host= The IP address of management server -host=localhost - -#port = The port management server listening on, default is 8250 -port=8250 - -#pod= The pod, which agent belonged to -pod=default - -#zone= The zone, which agent belonged to -zone=default - -#private.network.device= the private nic device -# if this is commented, it is autodetected on service startup -# private.network.device=cloudbr0 - -#public.network.device= the public nic device -# if this is commented, it is autodetected on service startup -# public.network.device=cloudbr0 - -#guid= a GUID to identify the agent diff --git a/systemvm/conf.dom0/consoleproxy.properties.in b/systemvm/conf.dom0/consoleproxy.properties.in deleted file mode 100644 index a3cddbcab96..00000000000 --- a/systemvm/conf.dom0/consoleproxy.properties.in +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -consoleproxy.tcpListenPort=0 -consoleproxy.httpListenPort=80 -consoleproxy.httpCmdListenPort=8001 -consoleproxy.jarDir=./applet/ -consoleproxy.viewerLinger=180 -consoleproxy.reconnectMaxRetry=5 diff --git a/systemvm/conf.dom0/log4j-cloud.xml.in b/systemvm/conf.dom0/log4j-cloud.xml.in deleted file mode 100644 index 0d78a950df9..00000000000 --- a/systemvm/conf.dom0/log4j-cloud.xml.in +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/systemvm/conf/agent.properties.ssvm b/systemvm/conf/agent.properties.ssvm deleted file mode 100644 index 2f87b88dba1..00000000000 --- a/systemvm/conf/agent.properties.ssvm +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#mount.path=~/secondary-storage/ -resource=org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource -testCifsMount=cifs://192.168.1.1/CSHV3?user=administrator&password=1pass%40word1 -#testLocalRoot=test diff --git a/systemvm/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/systemvm/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in deleted file mode 100644 index 3ec4d0655cd..00000000000 --- a/systemvm/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# chkconfig: 35 99 10 -# description: Cloud Console Proxy - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well - -. /etc/rc.d/init.d/functions - -# set environment variables - -SHORTNAME=`basename $0` -PIDFILE=@PIDDIR@/"$SHORTNAME".pid -LOCKFILE=@LOCKDIR@/"$SHORTNAME" -LOGFILE=@CPLOG@ -PROGNAME="Cloud Console Proxy" - -unset OPTIONS -[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME" -DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize -PROG=@LIBEXECDIR@/console-proxy-runner - -start() { - echo -n $"Starting $PROGNAME: " - if hostname --fqdn >/dev/null 2>&1 ; then - daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \ - -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS - RETVAL=$? - echo - else - failure - echo - echo The host name does not resolve properly to an IP address. Cannot start "$PROGNAME". > /dev/stderr - RETVAL=9 - fi - [ $RETVAL = 0 ] && touch ${LOCKFILE} - return $RETVAL -} - -stop() { - echo -n $"Stopping $PROGNAME: " - killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} -} - - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p ${PIDFILE} $SHORTNAME - RETVAL=$? - ;; - restart) - stop - sleep 3 - start - ;; - condrestart) - if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then - stop - sleep 3 - start - fi - ;; - *) - echo $"Usage: $SHORTNAME {start|stop|restart|condrestart|status|help}" - RETVAL=3 -esac - -exit $RETVAL - diff --git a/systemvm/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/systemvm/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in deleted file mode 100644 index 3ec4d0655cd..00000000000 --- a/systemvm/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# chkconfig: 35 99 10 -# description: Cloud Console Proxy - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well - -. /etc/rc.d/init.d/functions - -# set environment variables - -SHORTNAME=`basename $0` -PIDFILE=@PIDDIR@/"$SHORTNAME".pid -LOCKFILE=@LOCKDIR@/"$SHORTNAME" -LOGFILE=@CPLOG@ -PROGNAME="Cloud Console Proxy" - -unset OPTIONS -[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME" -DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize -PROG=@LIBEXECDIR@/console-proxy-runner - -start() { - echo -n $"Starting $PROGNAME: " - if hostname --fqdn >/dev/null 2>&1 ; then - daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \ - -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS - RETVAL=$? - echo - else - failure - echo - echo The host name does not resolve properly to an IP address. Cannot start "$PROGNAME". > /dev/stderr - RETVAL=9 - fi - [ $RETVAL = 0 ] && touch ${LOCKFILE} - return $RETVAL -} - -stop() { - echo -n $"Stopping $PROGNAME: " - killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} -} - - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p ${PIDFILE} $SHORTNAME - RETVAL=$? - ;; - restart) - stop - sleep 3 - start - ;; - condrestart) - if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then - stop - sleep 3 - start - fi - ;; - *) - echo $"Usage: $SHORTNAME {start|stop|restart|condrestart|status|help}" - RETVAL=3 -esac - -exit $RETVAL - diff --git a/systemvm/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/systemvm/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in deleted file mode 100644 index 3ec4d0655cd..00000000000 --- a/systemvm/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# chkconfig: 35 99 10 -# description: Cloud Console Proxy - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well - -. /etc/rc.d/init.d/functions - -# set environment variables - -SHORTNAME=`basename $0` -PIDFILE=@PIDDIR@/"$SHORTNAME".pid -LOCKFILE=@LOCKDIR@/"$SHORTNAME" -LOGFILE=@CPLOG@ -PROGNAME="Cloud Console Proxy" - -unset OPTIONS -[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME" -DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize -PROG=@LIBEXECDIR@/console-proxy-runner - -start() { - echo -n $"Starting $PROGNAME: " - if hostname --fqdn >/dev/null 2>&1 ; then - daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \ - -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS - RETVAL=$? - echo - else - failure - echo - echo The host name does not resolve properly to an IP address. Cannot start "$PROGNAME". > /dev/stderr - RETVAL=9 - fi - [ $RETVAL = 0 ] && touch ${LOCKFILE} - return $RETVAL -} - -stop() { - echo -n $"Stopping $PROGNAME: " - killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} -} - - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p ${PIDFILE} $SHORTNAME - RETVAL=$? - ;; - restart) - stop - sleep 3 - start - ;; - condrestart) - if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then - stop - sleep 3 - start - fi - ;; - *) - echo $"Usage: $SHORTNAME {start|stop|restart|condrestart|status|help}" - RETVAL=3 -esac - -exit $RETVAL - diff --git a/systemvm/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in b/systemvm/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in deleted file mode 100755 index 0c7be737353..00000000000 --- a/systemvm/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash - -# chkconfig: 35 99 10 -# description: Cloud Console Proxy - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well - -. /lib/lsb/init-functions -. /etc/default/rcS - -# set environment variables - -SHORTNAME=`basename $0` -PIDFILE=@PIDDIR@/"$SHORTNAME".pid -LOCKFILE=@LOCKDIR@/"$SHORTNAME" -LOGFILE=@CPLOG@ -PROGNAME="Cloud Console Proxy" - -unset OPTIONS -[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source @SYSCONFDIR@/default/"$SHORTNAME" -DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize -PROG=@LIBEXECDIR@/console-proxy-runner - -start() { - log_daemon_msg $"Starting $PROGNAME" "$SHORTNAME" - if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then - log_progress_msg "apparently already running" - log_end_msg 0 - exit 0 - fi - if hostname --fqdn >/dev/null 2>&1 ; then - true - else - log_failure_msg "The host name does not resolve properly to an IP address. Cannot start $PROGNAME" - log_end_msg 1 - exit 1 - fi - - if start-stop-daemon --start --quiet \ - --pidfile "$PIDFILE" \ - --exec "$DAEMONIZE" -- -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS - RETVAL=$? - then - rc=0 - sleep 1 - if ! kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then - log_failure_msg "$PROG failed to start" - rc=1 - fi - else - rc=1 - fi - - if [ $rc -eq 0 ]; then - log_end_msg 0 - else - log_end_msg 1 - rm -f "$PIDFILE" - fi -} - -stop() { - echo -n $"Stopping $PROGNAME" "$SHORTNAME" - start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE" - log_end_msg $? - rm -f "$PIDFILE" -} - - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status_of_proc -p "$PIDFILE" "$PROG" "$SHORTNAME" - RETVAL=$? - ;; - restart) - stop - sleep 3 - start - ;; - *) - echo $"Usage: $SHORTNAME {start|stop|restart|status|help}" - RETVAL=3 -esac - -exit $RETVAL - diff --git a/systemvm/libexec/console-proxy-runner.in b/systemvm/libexec/console-proxy-runner.in deleted file mode 100755 index 4f18aab36e5..00000000000 --- a/systemvm/libexec/console-proxy-runner.in +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -#run.sh runs the agent client. - -cd `dirname "$0"` - -SYSTEMJARS="@SYSTEMJARS@" -SCP=$(build-classpath $SYSTEMJARS) ; if [ $? != 0 ] ; then SCP="@SYSTEMCLASSPATH@" ; fi -DCP="@DEPSCLASSPATH@" -ACP="@AGENTCLASSPATH@" -export CLASSPATH=$SCP:$DCP:$ACP:@CPSYSCONFDIR@ -for jarfile in "@PREMIUMJAVADIR@"/* ; do - if [ ! -e "$jarfile" ] ; then continue ; fi - CLASSPATH=$jarfile:$CLASSPATH -done -for plugin in "@PLUGINJAVADIR@"/* ; do - if [ ! -e "$plugin" ] ; then continue ; fi - CLASSPATH=$plugin:$CLASSPATH -done -export CLASSPATH - -set -e -cd "@CPLIBDIR@" -echo Current directory is "$PWD" -echo CLASSPATH to run the console proxy: "$CLASSPATH" - -export PATH=/sbin:/usr/sbin:"$PATH" -SERVICEARGS= -for x in private public ; do - configuration=`grep -q "^$x.network.device" "@CPSYSCONFDIR@"/agent.properties || true` - if [ -n "$CONFIGURATION" ] ; then - echo "Using manually-configured network device $CONFIGURATION" - else - defaultroute=`ip route | grep ^default | cut -d ' ' -f 5` - test -n "$defaultroute" - echo "Using auto-discovered network device $defaultroute which is the default route" - SERVICEARGS="$SERVICEARGS $x.network.device="$defaultroute - fi -done - -function termagent() { - if [ "$agentpid" != "" ] ; then - echo Killing VMOps Console Proxy "(PID $agentpid)" with SIGTERM >&2 - kill -TERM $agentpid - echo Waiting for agent to exit >&2 - wait $agentpid - ex=$? - echo Agent exited with return code $ex >&2 - else - echo Agent PID is unknown >&2 - fi -} - -trap termagent TERM -while true ; do - java -Xms128M -Xmx384M -cp "$CLASSPATH" "$@" com.cloud.agent.AgentShell $SERVICEARGS & - agentpid=$! - echo "Console Proxy started. PID: $!" >&2 - wait $agentpid - ex=$? - if [ $ex -gt 128 ]; then - echo "wait on console proxy process interrupted by SIGTERM" >&2 - exit $ex - fi - echo "Console proxy exited with return code $ex" >&2 - if [ $ex -eq 0 ] || [ $ex -eq 1 ] || [ $ex -eq 66 ] || [ $ex -gt 128 ]; then - echo "Exiting..." > /dev/stderr - exit $ex - fi - echo "Restarting console proxy..." > /dev/stderr - sleep 1 -done diff --git a/systemvm/patches/debian/README b/systemvm/patches/debian/README deleted file mode 100644 index 5d79c3538a1..00000000000 --- a/systemvm/patches/debian/README +++ /dev/null @@ -1,34 +0,0 @@ -#################################################### - Note there is a new systemvm build script based on - Veewee(Vagrant) under tools/appliance. -#################################################### - -1. The buildsystemvm.sh script builds a 32-bit system vm disk based on the Debian Squeeze distro. This system vm can boot on any hypervisor thanks to the pvops support in the kernel. It is fully automated -2. The files under config/ are the specific tweaks to the default Debian configuration that are required for CloudStack operation. -3. The variables at the top of the buildsystemvm.sh script can be customized: - IMAGENAME=systemvm # dont touch this - LOCATION=/var/lib/images/systemvm # - MOUNTPOINT=/mnt/$IMAGENAME/ # this is where the image is mounted on your host while the vm image is built - IMAGELOC=$LOCATION/$IMAGENAME.img - PASSWORD=password # password for the vm - APT_PROXY= #you can put in an APT cacher such as apt-cacher-ng - HOSTNAME=systemvm # dont touch this - SIZE=2000 # dont touch this for now - DEBIAN_MIRROR=ftp.us.debian.org/debian - MINIMIZE=true # if this is true, a lot of docs, fonts, locales and apt cache is wiped out - -4. The systemvm includes the (non-free) Sun JRE. You can put in the standard debian jre-headless package instead but it pulls in X and bloats the image. -5. You need to be 'root' to run the buildsystemvm.sh script -6. The image is a raw image. You can run the convert.sh tool to produce images suitable for Citrix Xenserver, VMWare and KVM. - * Conversion to Citrix Xenserver VHD format requires the vhd-util tool. You can use the - -- checked in config/bin/vhd-util) OR - -- build the vhd-util tool yourself as follows: - a. The xen repository has a tool called vhd-util that compiles and runs on any linux system (http://xenbits.xensource.com/xen-4.0-testing.hg?file/8e8dd38374e9/tools/blktap2/vhd/ or full Xen source at http://www.xen.org/products/xen_source.html). - b. Apply this patch: http://lists.xensource.com/archives/cgi-bin/mesg.cgi?a=xen-devel&i=006101cb22f6%242004dd40%24600e97c0%24%40zhuo%40cloudex.cn. - c. Build the vhd-util tool - cd tools/blktap2 - make - sudo make install - * Conversion to ova (VMWare) requires the ovf tool, available from - http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/ovf - * Conversion to QCOW2 requires qemu-img diff --git a/systemvm/patches/debian/config.dat b/systemvm/patches/debian/config.dat deleted file mode 100644 index b16638f742e..00000000000 --- a/systemvm/patches/debian/config.dat +++ /dev/null @@ -1,398 +0,0 @@ -Name: adduser/homedir-permission -Template: adduser/homedir-permission -Value: true -Owners: adduser - -Name: ca-certificates/enable_crts -Template: ca-certificates/enable_crts -Value: brasil.gov.br/brasil.gov.br.crt, cacert.org/cacert.org.crt, cacert.org/class3.crt, cacert.org/root.crt, debconf.org/ca.crt, gouv.fr/cert_igca_dsa.crt, gouv.fr/cert_igca_rsa.crt, mozilla/ABAecom_=sub.__Am._Bankers_Assn.=_Root_CA.crt, mozilla/AddTrust_External_Root.crt, mozilla/AddTrust_Low-Value_Services_Root.crt, mozilla/AddTrust_Public_Services_Root.crt, mozilla/AddTrust_Qualified_Certificates_Root.crt, mozilla/America_Online_Root_Certification_Authority_1.crt, mozilla/America_Online_Root_Certification_Authority_2.crt, mozilla/AOL_Time_Warner_Root_Certification_Authority_1.crt, mozilla/AOL_Time_Warner_Root_Certification_Authority_2.crt, mozilla/Baltimore_CyberTrust_Root.crt, mozilla/beTRUSTed_Root_CA-Baltimore_Implementation.crt, mozilla/beTRUSTed_Root_CA.crt, mozilla/beTRUSTed_Root_CA_-_Entrust_Implementation.crt, mozilla/beTRUSTed_Root_CA_-_RSA_Implementation.crt, mozilla/Camerfirma_Chambers_of_Commerce_Root.crt, mozilla/Camerfirma_Global_Chambersign_Root.crt, mozilla/Certplus_Class_2_Primary_CA.crt, mozilla/Certum_Root_CA.crt, mozilla/Comodo_AAA_Services_root.crt, mozilla/COMODO_Certification_Authority.crt, mozilla/Comodo_Secure_Services_root.crt, mozilla/Comodo_Trusted_Services_root.crt, mozilla/DigiCert_Assured_ID_Root_CA.crt, mozilla/DigiCert_Global_Root_CA.crt, mozilla/DigiCert_High_Assurance_EV_Root_CA.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_1.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_2.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_3.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_4.crt, mozilla/DST_ACES_CA_X6.crt, mozilla/DST_Root_CA_X3.crt, mozilla/Entrust.net_Global_Secure_Personal_CA.crt, mozilla/Entrust.net_Global_Secure_Server_CA.crt, mozilla/Entrust.net_Premium_2048_Secure_Server_CA.crt, mozilla/Entrust.net_Secure_Personal_CA.crt, mozilla/Entrust.net_Secure_Server_CA.crt, mozilla/Entrust_Root_Certification_Authority.crt, mozilla/Equifax_Secure_CA.crt, mozilla/Equifax_Secure_eBusiness_CA_1.crt, mozilla/Equifax_Secure_eBusiness_CA_2.crt, mozilla/Equifax_Secure_Global_eBusiness_CA.crt, mozilla/Firmaprofesional_Root_CA.crt, mozilla/GeoTrust_Global_CA_2.crt, mozilla/GeoTrust_Global_CA.crt, mozilla/GeoTrust_Primary_Certification_Authority.crt, mozilla/GeoTrust_Universal_CA_2.crt, mozilla/GeoTrust_Universal_CA.crt, mozilla/GlobalSign_Root_CA.crt, mozilla/GlobalSign_Root_CA_-_R2.crt, mozilla/Go_Daddy_Class_2_CA.crt, mozilla/GTE_CyberTrust_Global_Root.crt, mozilla/GTE_CyberTrust_Root_CA.crt, mozilla/IPS_Chained_CAs_root.crt, mozilla/IPS_CLASE1_root.crt, mozilla/IPS_CLASE3_root.crt, mozilla/IPS_CLASEA1_root.crt, mozilla/IPS_CLASEA3_root.crt, mozilla/IPS_Servidores_root.crt, mozilla/IPS_Timestamping_root.crt, mozilla/NetLock_Business_=Class_B=_Root.crt, mozilla/NetLock_Express_=Class_C=_Root.crt, mozilla/NetLock_Notary_=Class_A=_Root.crt, mozilla/NetLock_Qualified_=Class_QA=_Root.crt, mozilla/QuoVadis_Root_CA_2.crt, mozilla/QuoVadis_Root_CA_3.crt, mozilla/QuoVadis_Root_CA.crt, mozilla/RSA_Root_Certificate_1.crt, mozilla/RSA_Security_1024_v3.crt, mozilla/RSA_Security_2048_v3.crt, mozilla/Secure_Global_CA.crt, mozilla/SecureTrust_CA.crt, mozilla/Security_Communication_Root_CA.crt, mozilla/Sonera_Class_1_Root_CA.crt, mozilla/Sonera_Class_2_Root_CA.crt, mozilla/Staat_der_Nederlanden_Root_CA.crt, mozilla/Starfield_Class_2_CA.crt, mozilla/StartCom_Certification_Authority.crt, mozilla/StartCom_Ltd..crt, mozilla/Swisscom_Root_CA_1.crt, mozilla/SwissSign_Gold_CA_-_G2.crt, mozilla/SwissSign_Platinum_CA_-_G2.crt, mozilla/SwissSign_Silver_CA_-_G2.crt, mozilla/Taiwan_GRCA.crt, mozilla/TC_TrustCenter__Germany__Class_2_CA.crt, mozilla/TC_TrustCenter__Germany__Class_3_CA.crt, mozilla/TDC_Internet_Root_CA.crt, mozilla/TDC_OCES_Root_CA.crt, mozilla/Thawte_Personal_Basic_CA.crt, mozilla/Thawte_Personal_Freemail_CA.crt, mozilla/Thawte_Personal_Premium_CA.crt, mozilla/Thawte_Premium_Server_CA.crt, mozilla/thawte_Primary_Root_CA.crt, mozilla/Thawte_Server_CA.crt, mozilla/Thawte_Time_Stamping_CA.crt, mozilla/TURKTRUST_Certificate_Services_Provider_Root_1.crt, mozilla/TURKTRUST_Certificate_Services_Provider_Root_2.crt, mozilla/UTN_DATACorp_SGC_Root_CA.crt, mozilla/UTN_USERFirst_Email_Root_CA.crt, mozilla/UTN_USERFirst_Hardware_Root_CA.crt, mozilla/UTN-USER_First-Network_Applications.crt, mozilla/UTN_USERFirst_Object_Root_CA.crt, mozilla/ValiCert_Class_1_VA.crt, mozilla/ValiCert_Class_2_VA.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.crt, mozilla/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.crt, mozilla/Verisign_Class_4_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_4_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_RSA_Secure_Server_CA.crt, mozilla/Verisign_Time_Stamping_Authority_CA.crt, mozilla/Visa_eCommerce_Root.crt, mozilla/Visa_International_Global_Root_2.crt, mozilla/Wells_Fargo_Root_CA.crt, mozilla/XRamp_Global_CA_Root.crt, quovadis.bm/QuoVadis_Root_Certification_Authority.crt, signet.pl/signet_ca1_pem.crt, signet.pl/signet_ca2_pem.crt, signet.pl/signet_ca3_pem.crt, signet.pl/signet_ocspklasa2_pem.crt, signet.pl/signet_ocspklasa3_pem.crt, signet.pl/signet_pca2_pem.crt, signet.pl/signet_pca3_pem.crt, signet.pl/signet_rootca_pem.crt, signet.pl/signet_tsa1_pem.crt, spi-inc.org/spi-ca-2003.crt, spi-inc.org/spi-cacert-2008.crt, telesec.de/deutsche-telekom-root-ca-2.crt -Owners: ca-certificates -Variables: - enable_crts = brasil.gov.br/brasil.gov.br.crt, cacert.org/cacert.org.crt, cacert.org/class3.crt, cacert.org/root.crt, debconf.org/ca.crt, gouv.fr/cert_igca_dsa.crt, gouv.fr/cert_igca_rsa.crt, mozilla/ABAecom_=sub.__Am._Bankers_Assn.=_Root_CA.crt, mozilla/AddTrust_External_Root.crt, mozilla/AddTrust_Low-Value_Services_Root.crt, mozilla/AddTrust_Public_Services_Root.crt, mozilla/AddTrust_Qualified_Certificates_Root.crt, mozilla/America_Online_Root_Certification_Authority_1.crt, mozilla/America_Online_Root_Certification_Authority_2.crt, mozilla/AOL_Time_Warner_Root_Certification_Authority_1.crt, mozilla/AOL_Time_Warner_Root_Certification_Authority_2.crt, mozilla/Baltimore_CyberTrust_Root.crt, mozilla/beTRUSTed_Root_CA-Baltimore_Implementation.crt, mozilla/beTRUSTed_Root_CA.crt, mozilla/beTRUSTed_Root_CA_-_Entrust_Implementation.crt, mozilla/beTRUSTed_Root_CA_-_RSA_Implementation.crt, mozilla/Camerfirma_Chambers_of_Commerce_Root.crt, mozilla/Camerfirma_Global_Chambersign_Root.crt, mozilla/Certplus_Class_2_Primary_CA.crt, mozilla/Certum_Root_CA.crt, mozilla/Comodo_AAA_Services_root.crt, mozilla/COMODO_Certification_Authority.crt, mozilla/Comodo_Secure_Services_root.crt, mozilla/Comodo_Trusted_Services_root.crt, mozilla/DigiCert_Assured_ID_Root_CA.crt, mozilla/DigiCert_Global_Root_CA.crt, mozilla/DigiCert_High_Assurance_EV_Root_CA.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_1.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_2.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_3.crt, mozilla/Digital_Signature_Trust_Co._Global_CA_4.crt, mozilla/DST_ACES_CA_X6.crt, mozilla/DST_Root_CA_X3.crt, mozilla/Entrust.net_Global_Secure_Personal_CA.crt, mozilla/Entrust.net_Global_Secure_Server_CA.crt, mozilla/Entrust.net_Premium_2048_Secure_Server_CA.crt, mozilla/Entrust.net_Secure_Personal_CA.crt, mozilla/Entrust.net_Secure_Server_CA.crt, mozilla/Entrust_Root_Certification_Authority.crt, mozilla/Equifax_Secure_CA.crt, mozilla/Equifax_Secure_eBusiness_CA_1.crt, mozilla/Equifax_Secure_eBusiness_CA_2.crt, mozilla/Equifax_Secure_Global_eBusiness_CA.crt, mozilla/Firmaprofesional_Root_CA.crt, mozilla/GeoTrust_Global_CA_2.crt, mozilla/GeoTrust_Global_CA.crt, mozilla/GeoTrust_Primary_Certification_Authority.crt, mozilla/GeoTrust_Universal_CA_2.crt, mozilla/GeoTrust_Universal_CA.crt, mozilla/GlobalSign_Root_CA.crt, mozilla/GlobalSign_Root_CA_-_R2.crt, mozilla/Go_Daddy_Class_2_CA.crt, mozilla/GTE_CyberTrust_Global_Root.crt, mozilla/GTE_CyberTrust_Root_CA.crt, mozilla/IPS_Chained_CAs_root.crt, mozilla/IPS_CLASE1_root.crt, mozilla/IPS_CLASE3_root.crt, mozilla/IPS_CLASEA1_root.crt, mozilla/IPS_CLASEA3_root.crt, mozilla/IPS_Servidores_root.crt, mozilla/IPS_Timestamping_root.crt, mozilla/NetLock_Business_=Class_B=_Root.crt, mozilla/NetLock_Express_=Class_C=_Root.crt, mozilla/NetLock_Notary_=Class_A=_Root.crt, mozilla/NetLock_Qualified_=Class_QA=_Root.crt, mozilla/QuoVadis_Root_CA_2.crt, mozilla/QuoVadis_Root_CA_3.crt, mozilla/QuoVadis_Root_CA.crt, mozilla/RSA_Root_Certificate_1.crt, mozilla/RSA_Security_1024_v3.crt, mozilla/RSA_Security_2048_v3.crt, mozilla/Secure_Global_CA.crt, mozilla/SecureTrust_CA.crt, mozilla/Security_Communication_Root_CA.crt, mozilla/Sonera_Class_1_Root_CA.crt, mozilla/Sonera_Class_2_Root_CA.crt, mozilla/Staat_der_Nederlanden_Root_CA.crt, mozilla/Starfield_Class_2_CA.crt, mozilla/StartCom_Certification_Authority.crt, mozilla/StartCom_Ltd..crt, mozilla/Swisscom_Root_CA_1.crt, mozilla/SwissSign_Gold_CA_-_G2.crt, mozilla/SwissSign_Platinum_CA_-_G2.crt, mozilla/SwissSign_Silver_CA_-_G2.crt, mozilla/Taiwan_GRCA.crt, mozilla/TC_TrustCenter__Germany__Class_2_CA.crt, mozilla/TC_TrustCenter__Germany__Class_3_CA.crt, mozilla/TDC_Internet_Root_CA.crt, mozilla/TDC_OCES_Root_CA.crt, mozilla/Thawte_Personal_Basic_CA.crt, mozilla/Thawte_Personal_Freemail_CA.crt, mozilla/Thawte_Personal_Premium_CA.crt, mozilla/Thawte_Premium_Server_CA.crt, mozilla/thawte_Primary_Root_CA.crt, mozilla/Thawte_Server_CA.crt, mozilla/Thawte_Time_Stamping_CA.crt, mozilla/TURKTRUST_Certificate_Services_Provider_Root_1.crt, mozilla/TURKTRUST_Certificate_Services_Provider_Root_2.crt, mozilla/UTN_DATACorp_SGC_Root_CA.crt, mozilla/UTN_USERFirst_Email_Root_CA.crt, mozilla/UTN_USERFirst_Hardware_Root_CA.crt, mozilla/UTN-USER_First-Network_Applications.crt, mozilla/UTN_USERFirst_Object_Root_CA.crt, mozilla/ValiCert_Class_1_VA.crt, mozilla/ValiCert_Class_2_VA.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.crt, mozilla/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.crt, mozilla/Verisign_Class_4_Public_Primary_Certification_Authority_-_G2.crt, mozilla/Verisign_Class_4_Public_Primary_Certification_Authority_-_G3.crt, mozilla/Verisign_RSA_Secure_Server_CA.crt, mozilla/Verisign_Time_Stamping_Authority_CA.crt, mozilla/Visa_eCommerce_Root.crt, mozilla/Visa_International_Global_Root_2.crt, mozilla/Wells_Fargo_Root_CA.crt, mozilla/XRamp_Global_CA_Root.crt, quovadis.bm/QuoVadis_Root_Certification_Authority.crt, signet.pl/signet_ca1_pem.crt, signet.pl/signet_ca2_pem.crt, signet.pl/signet_ca3_pem.crt, signet.pl/signet_ocspklasa2_pem.crt, signet.pl/signet_ocspklasa3_pem.crt, signet.pl/signet_pca2_pem.crt, signet.pl/signet_pca3_pem.crt, signet.pl/signet_rootca_pem.crt, signet.pl/signet_tsa1_pem.crt, spi-inc.org/spi-ca-2003.crt, spi-inc.org/spi-cacert-2008.crt, telesec.de/deutsche-telekom-root-ca-2.crt - -Name: ca-certificates/new_crts -Template: ca-certificates/new_crts -Owners: ca-certificates -Variables: - new_crts = - -Name: ca-certificates/trust_new_crts -Template: ca-certificates/trust_new_crts -Value: yes -Owners: ca-certificates - -Name: debconf-apt-progress/info -Template: debconf-apt-progress/info -Owners: debconf - -Name: debconf-apt-progress/media-change -Template: debconf-apt-progress/media-change -Owners: debconf - -Name: debconf-apt-progress/preparing -Template: debconf-apt-progress/preparing -Owners: debconf - -Name: debconf-apt-progress/title -Template: debconf-apt-progress/title -Owners: debconf - -Name: debconf/frontend -Template: debconf/frontend -Value: noninteractive -Owners: debconf - -Name: debconf/priority -Template: debconf/priority -Value: high -Owners: debconf - -Name: dhcp3-client/dhclient-needs-restarting -Template: dhcp3-client/dhclient-needs-restarting -Owners: dhcp3-client - -Name: dhcp3-client/dhclient-script_moved -Template: dhcp3-client/dhclient-script_moved -Owners: dhcp3-client - -Name: glibc/restart-failed -Template: glibc/restart-failed -Owners: libc6 - -Name: glibc/restart-services -Template: glibc/restart-services -Owners: libc6 - -Name: glibc/upgrade -Template: glibc/upgrade -Owners: libc6 - -Name: libpam-modules/disable-screensaver -Template: libpam-modules/disable-screensaver -Owners: libpam-modules - -Name: libpam0g/restart-failed -Template: libpam0g/restart-failed -Owners: libpam0g - -Name: libpam0g/restart-services -Template: libpam0g/restart-services -Owners: libpam0g - -Name: libpam0g/xdm-needs-restart -Template: libpam0g/xdm-needs-restart -Owners: libpam0g - -Name: libssl0.9.8/restart-failed -Template: libssl0.9.8/restart-failed -Owners: libssl0.9.8 - -Name: libssl0.9.8/restart-services -Template: libssl0.9.8/restart-services -Owners: libssl0.9.8 - -Name: linux-base/disk-id-convert-auto -Template: linux-base/disk-id-convert-auto -Owners: linux-base - -Name: linux-base/disk-id-convert-plan -Template: linux-base/disk-id-convert-plan -Owners: linux-base - -Name: linux-base/disk-id-convert-plan-no-relabel -Template: linux-base/disk-id-convert-plan-no-relabel -Owners: linux-base - -Name: linux-base/disk-id-manual -Template: linux-base/disk-id-manual -Owners: linux-base - -Name: linux-base/disk-id-manual-boot-loader -Template: linux-base/disk-id-manual-boot-loader -Owners: linux-base - -Name: linux-image-2.6.32-bpo.5-686/postinst/bootloader-error-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/postinst/bootloader-error-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-686/postinst/bootloader-test-error-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/postinst/bootloader-test-error-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-686/postinst/depmod-error-initrd-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/postinst/depmod-error-initrd-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-686/postinst/missing-firmware-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/postinst/missing-firmware-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-686/prerm/removing-running-kernel-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/prerm/removing-running-kernel-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-686/prerm/would-invalidate-boot-loader-2.6.32-bpo.5-686 -Template: linux-image-2.6.32-bpo.5-686/prerm/would-invalidate-boot-loader-2.6.32-bpo.5-686 -Owners: linux-image-2.6.32-bpo.5-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/postinst/bootloader-error-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/postinst/bootloader-error-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/postinst/bootloader-test-error-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/postinst/bootloader-test-error-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/postinst/depmod-error-initrd-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/postinst/depmod-error-initrd-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/postinst/missing-firmware-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/postinst/missing-firmware-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/prerm/removing-running-kernel-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/prerm/removing-running-kernel-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: linux-image-2.6.32-bpo.5-xen-686/prerm/would-invalidate-boot-loader-2.6.32-bpo.5-xen-686 -Template: linux-image-2.6.32-bpo.5-xen-686/prerm/would-invalidate-boot-loader-2.6.32-bpo.5-xen-686 -Owners: linux-image-2.6.32-bpo.5-xen-686 - -Name: locales/default_environment_locale -Template: locales/default_environment_locale -Value: en_US.UTF-8 -Owners: locales -Variables: - locales = en_US.UTF-8 - -Name: locales/locales_to_be_generated -Template: locales/locales_to_be_generated -Value: en_US.UTF-8 UTF-8 -Owners: locales -Variables: - locales = aa_DJ ISO-8859-1, aa_DJ.UTF-8 UTF-8, aa_ER UTF-8, aa_ER@saaho UTF-8, aa_ET UTF-8, af_ZA ISO-8859-1, af_ZA.UTF-8 UTF-8, am_ET UTF-8, an_ES ISO-8859-15, an_ES.UTF-8 UTF-8, ar_AE ISO-8859-6, ar_AE.UTF-8 UTF-8, ar_BH ISO-8859-6, ar_BH.UTF-8 UTF-8, ar_DZ ISO-8859-6, ar_DZ.UTF-8 UTF-8, ar_EG ISO-8859-6, ar_EG.UTF-8 UTF-8, ar_IN UTF-8, ar_IQ ISO-8859-6, ar_IQ.UTF-8 UTF-8, ar_JO ISO-8859-6, ar_JO.UTF-8 UTF-8, ar_KW ISO-8859-6, ar_KW.UTF-8 UTF-8, ar_LB ISO-8859-6, ar_LB.UTF-8 UTF-8, ar_LY ISO-8859-6, ar_LY.UTF-8 UTF-8, ar_MA ISO-8859-6, ar_MA.UTF-8 UTF-8, ar_OM ISO-8859-6, ar_OM.UTF-8 UTF-8, ar_QA ISO-8859-6, ar_QA.UTF-8 UTF-8, ar_SA ISO-8859-6, ar_SA.UTF-8 UTF-8, ar_SD ISO-8859-6, ar_SD.UTF-8 UTF-8, ar_SY ISO-8859-6, ar_SY.UTF-8 UTF-8, ar_TN ISO-8859-6, ar_TN.UTF-8 UTF-8, ar_YE ISO-8859-6, ar_YE.UTF-8 UTF-8, as_IN.UTF-8 UTF-8, ast_ES ISO-8859-15, ast_ES.UTF-8 UTF-8, az_AZ.UTF-8 UTF-8, be_BY CP1251, be_BY.UTF-8 UTF-8, be_BY@latin UTF-8, ber_DZ UTF-8, ber_MA UTF-8, bg_BG CP1251, bg_BG.UTF-8 UTF-8, bn_BD UTF-8, bn_IN UTF-8, br_FR ISO-8859-1, br_FR.UTF-8 UTF-8, br_FR@euro ISO-8859-15, bs_BA ISO-8859-2, bs_BA.UTF-8 UTF-8, byn_ER UTF-8, ca_AD ISO-8859-15, ca_AD.UTF-8 UTF-8, ca_ES ISO-8859-1, ca_ES.UTF-8 UTF-8, ca_ES.UTF-8@valencia UTF-8, ca_ES@euro ISO-8859-15, ca_ES@valencia ISO-8859-15, ca_FR ISO-8859-15, ca_FR.UTF-8 UTF-8, ca_IT ISO-8859-15, ca_IT.UTF-8 UTF-8, crh_UA UTF-8, cs_CZ ISO-8859-2, cs_CZ.UTF-8 UTF-8, csb_PL UTF-8, cy_GB ISO-8859-14, cy_GB.UTF-8 UTF-8, da_DK ISO-8859-1, da_DK.ISO-8859-15 ISO-8859-15, da_DK.UTF-8 UTF-8, de_AT ISO-8859-1, de_AT.UTF-8 UTF-8, de_AT@euro ISO-8859-15, de_BE ISO-8859-1, de_BE.UTF-8 UTF-8, de_BE@euro ISO-8859-15, de_CH ISO-8859-1, de_CH.UTF-8 UTF-8, de_DE ISO-8859-1, de_DE.UTF-8 UTF-8, de_DE@euro ISO-8859-15, de_LI.UTF-8 UTF-8, de_LU ISO-8859-1, de_LU.UTF-8 UTF-8, de_LU@euro ISO-8859-15, dz_BT UTF-8, el_CY ISO-8859-7, el_CY.UTF-8 UTF-8, el_GR ISO-8859-7, el_GR.UTF-8 UTF-8, en_AU ISO-8859-1, en_AU.UTF-8 UTF-8, en_BW ISO-8859-1, en_BW.UTF-8 UTF-8, en_CA ISO-8859-1, en_CA.UTF-8 UTF-8, en_DK ISO-8859-1, en_DK.ISO-8859-15 ISO-8859-15, en_DK.UTF-8 UTF-8, en_GB ISO-8859-1, en_GB.ISO-8859-15 ISO-8859-15, en_GB.UTF-8 UTF-8, en_HK ISO-8859-1, en_HK.UTF-8 UTF-8, en_IE ISO-8859-1, en_IE.UTF-8 UTF-8, en_IE@euro ISO-8859-15, en_IN UTF-8, en_NG UTF-8, en_NZ ISO-8859-1, en_NZ.UTF-8 UTF-8, en_PH ISO-8859-1, en_PH.UTF-8 UTF-8, en_SG ISO-8859-1, en_SG.UTF-8 UTF-8, en_US ISO-8859-1, en_US.ISO-8859-15 ISO-8859-15, en_US.UTF-8 UTF-8, en_ZA ISO-8859-1, en_ZA.UTF-8 UTF-8, en_ZW ISO-8859-1, en_ZW.UTF-8 UTF-8, eo ISO-8859-3, eo.UTF-8 UTF-8, es_AR ISO-8859-1, es_AR.UTF-8 UTF-8, es_BO ISO-8859-1, es_BO.UTF-8 UTF-8, es_CL ISO-8859-1, es_CL.UTF-8 UTF-8, es_CO ISO-8859-1, es_CO.UTF-8 UTF-8, es_CR ISO-8859-1, es_CR.UTF-8 UTF-8, es_DO ISO-8859-1, es_DO.UTF-8 UTF-8, es_EC ISO-8859-1, es_EC.UTF-8 UTF-8, es_ES ISO-8859-1, es_ES.UTF-8 UTF-8, es_ES@euro ISO-8859-15, es_GT ISO-8859-1, es_GT.UTF-8 UTF-8, es_HN ISO-8859-1, es_HN.UTF-8 UTF-8, es_MX ISO-8859-1, es_MX.UTF-8 UTF-8, es_NI ISO-8859-1, es_NI.UTF-8 UTF-8, es_PA ISO-8859-1, es_PA.UTF-8 UTF-8, es_PE ISO-8859-1, es_PE.UTF-8 UTF-8, es_PR ISO-8859-1, es_PR.UTF-8 UTF-8, es_PY ISO-8859-1, es_PY.UTF-8 UTF-8, es_SV ISO-8859-1, es_SV.UTF-8 UTF-8, es_US ISO-8859-1, es_US.UTF-8 UTF-8, es_UY ISO-8859-1, es_UY.UTF-8 UTF-8, es_VE ISO-8859-1, es_VE.UTF-8 UTF-8, et_EE ISO-8859-1, et_EE.ISO-8859-15 ISO-8859-15, et_EE.UTF-8 UTF-8, eu_ES ISO-8859-1, eu_ES.UTF-8 UTF-8, eu_ES@euro ISO-8859-15, eu_FR ISO-8859-1, eu_FR.UTF-8 UTF-8, eu_FR@euro ISO-8859-15, fa_IR UTF-8, fi_FI ISO-8859-1, fi_FI.UTF-8 UTF-8, fi_FI@euro ISO-8859-15, fil_PH UTF-8, fo_FO ISO-8859-1, fo_FO.UTF-8 UTF-8, fr_BE ISO-8859-1, fr_BE.UTF-8 UTF-8, fr_BE@euro ISO-8859-15, fr_CA ISO-8859-1, fr_CA.UTF-8 UTF-8, fr_CH ISO-8859-1, fr_CH.UTF-8 UTF-8, fr_FR ISO-8859-1, fr_FR.UTF-8 UTF-8, fr_FR@euro ISO-8859-15, fr_LU ISO-8859-1, fr_LU.UTF-8 UTF-8, fr_LU@euro ISO-8859-15, fur_IT UTF-8, fy_DE UTF-8, fy_NL UTF-8, ga_IE ISO-8859-1, ga_IE.UTF-8 UTF-8, ga_IE@euro ISO-8859-15, gd_GB ISO-8859-15, gd_GB.UTF-8 UTF-8, gez_ER UTF-8, gez_ER@abegede UTF-8, gez_ET UTF-8, gez_ET@abegede UTF-8, gl_ES ISO-8859-1, gl_ES.UTF-8 UTF-8, gl_ES@euro ISO-8859-15, gu_IN UTF-8, gv_GB ISO-8859-1, gv_GB.UTF-8 UTF-8, ha_NG UTF-8, he_IL ISO-8859-8, he_IL.UTF-8 UTF-8, hi_IN UTF-8, hr_HR ISO-8859-2, hr_HR.UTF-8 UTF-8, hsb_DE ISO-8859-2, hsb_DE.UTF-8 UTF-8, hu_HU ISO-8859-2, hu_HU.UTF-8 UTF-8, hy_AM UTF-8, hy_AM.ARMSCII-8 ARMSCII-8, ia UTF-8, id_ID ISO-8859-1, id_ID.UTF-8 UTF-8, ig_NG UTF-8, ik_CA UTF-8, is_IS ISO-8859-1, is_IS.UTF-8 UTF-8, it_CH ISO-8859-1, it_CH.UTF-8 UTF-8, it_IT ISO-8859-1, it_IT.UTF-8 UTF-8, it_IT@euro ISO-8859-15, iu_CA UTF-8, iw_IL ISO-8859-8, iw_IL.UTF-8 UTF-8, ja_JP.EUC-JP EUC-JP, ja_JP.UTF-8 UTF-8, ka_GE GEORGIAN-PS, ka_GE.UTF-8 UTF-8, kk_KZ PT154, kk_KZ.UTF-8 UTF-8, kl_GL ISO-8859-1, kl_GL.UTF-8 UTF-8, km_KH UTF-8, kn_IN UTF-8, ko_KR.EUC-KR EUC-KR, ko_KR.UTF-8 UTF-8, ks_IN UTF-8, ku_TR ISO-8859-9, ku_TR.UTF-8 UTF-8, kw_GB ISO-8859-1, kw_GB.UTF-8 UTF-8, ky_KG UTF-8, lg_UG ISO-8859-10, lg_UG.UTF-8 UTF-8, li_BE UTF-8, li_NL UTF-8, lo_LA UTF-8, lt_LT ISO-8859-13, lt_LT.UTF-8 UTF-8, lv_LV ISO-8859-13, lv_LV.UTF-8 UTF-8, mai_IN UTF-8, mg_MG ISO-8859-15, mg_MG.UTF-8 UTF-8, mi_NZ ISO-8859-13, mi_NZ.UTF-8 UTF-8, mk_MK ISO-8859-5, mk_MK.UTF-8 UTF-8, ml_IN UTF-8, mn_MN UTF-8, mr_IN UTF-8, ms_MY ISO-8859-1, ms_MY.UTF-8 UTF-8, mt_MT ISO-8859-3, mt_MT.UTF-8 UTF-8, nb_NO ISO-8859-1, nb_NO.UTF-8 UTF-8, nds_DE UTF-8, nds_NL UTF-8, ne_NP UTF-8, nl_BE ISO-8859-1, nl_BE.UTF-8 UTF-8, nl_BE@euro ISO-8859-15, nl_NL ISO-8859-1, nl_NL.UTF-8 UTF-8, nl_NL@euro ISO-8859-15, nn_NO ISO-8859-1, nn_NO.UTF-8 UTF-8, nr_ZA UTF-8, nso_ZA UTF-8, oc_FR ISO-8859-1, oc_FR.UTF-8 UTF-8, om_ET UTF-8, om_KE ISO-8859-1, om_KE.UTF-8 UTF-8, or_IN UTF-8, pa_IN UTF-8, pa_PK UTF-8, pap_AN UTF-8, pl_PL ISO-8859-2, pl_PL.UTF-8 UTF-8, pt_BR ISO-8859-1, pt_BR.UTF-8 UTF-8, pt_PT ISO-8859-1, pt_PT.UTF-8 UTF-8, pt_PT@euro ISO-8859-15, ro_RO ISO-8859-2, ro_RO.UTF-8 UTF-8, ru_RU ISO-8859-5, ru_RU.CP1251 CP1251, ru_RU.KOI8-R KOI8-R, ru_RU.UTF-8 UTF-8, ru_UA KOI8-U, ru_UA.UTF-8 UTF-8, rw_RW UTF-8, sa_IN UTF-8, sc_IT UTF-8, se_NO UTF-8, si_LK UTF-8, sid_ET UTF-8, sk_SK ISO-8859-2, sk_SK.UTF-8 UTF-8, sl_SI ISO-8859-2, sl_SI.UTF-8 UTF-8, so_DJ ISO-8859-1, so_DJ.UTF-8 UTF-8, so_ET UTF-8, so_KE ISO-8859-1, so_KE.UTF-8 UTF-8, so_SO ISO-8859-1, so_SO.UTF-8 UTF-8, sq_AL ISO-8859-1, sq_AL.UTF-8 UTF-8, sr_ME UTF-8, sr_RS UTF-8, sr_RS@latin UTF-8, ss_ZA UTF-8, st_ZA ISO-8859-1, st_ZA.UTF-8 UTF-8, sv_FI ISO-8859-1, sv_FI.UTF-8 UTF-8, sv_FI@euro ISO-8859-15, sv_SE ISO-8859-1, sv_SE.ISO-8859-15 ISO-8859-15, sv_SE.UTF-8 UTF-8, ta_IN UTF-8, te_IN UTF-8, tg_TJ KOI8-T, tg_TJ.UTF-8 UTF-8, th_TH TIS-620, th_TH.UTF-8 UTF-8, ti_ER UTF-8, ti_ET UTF-8, tig_ER UTF-8, tk_TM UTF-8, tl_PH ISO-8859-1, tl_PH.UTF-8 UTF-8, tn_ZA UTF-8, tr_CY ISO-8859-9, tr_CY.UTF-8 UTF-8, tr_TR ISO-8859-9, tr_TR.UTF-8 UTF-8, ts_ZA UTF-8, tt_RU.UTF-8 UTF-8, tt_RU@iqtelif.UTF-8 UTF-8, ug_CN UTF-8, uk_UA KOI8-U, uk_UA.UTF-8 UTF-8, ur_PK UTF-8, uz_UZ ISO-8859-1, uz_UZ.UTF-8 UTF-8, uz_UZ@cyrillic UTF-8, ve_ZA UTF-8, vi_VN UTF-8, vi_VN.TCVN TCVN5712-1, wa_BE ISO-8859-1, wa_BE.UTF-8 UTF-8, wa_BE@euro ISO-8859-15, wo_SN UTF-8, xh_ZA ISO-8859-1, xh_ZA.UTF-8 UTF-8, yi_US CP1255, yi_US.UTF-8 UTF-8, yo_NG UTF-8, zh_CN GB2312, zh_CN.GB18030 GB18030, zh_CN.GBK GBK, zh_CN.UTF-8 UTF-8, zh_HK BIG5-HKSCS, zh_HK.UTF-8 UTF-8, zh_SG GB2312, zh_SG.GBK GBK, zh_SG.UTF-8 UTF-8, zh_TW BIG5, zh_TW.EUC-TW EUC-TW, zh_TW.UTF-8 UTF-8, zu_ZA ISO-8859-1, zu_ZA.UTF-8 UTF-8 - -Name: openswan/create_rsa_key -Template: openswan/create_rsa_key -Value: true -Owners: openswan -Flags: seen - -Name: openswan/enable-oe -Template: openswan/enable-oe -Value: false -Owners: openswan -Flags: seen - -Name: openswan/existing_x509_certificate -Template: openswan/existing_x509_certificate -Value: false -Owners: openswan -Flags: seen - -Name: openswan/existing_x509_certificate_filename -Template: openswan/existing_x509_certificate_filename -Owners: openswan - -Name: openswan/existing_x509_key_filename -Template: openswan/existing_x509_key_filename -Owners: openswan - -Name: openswan/restart -Template: openswan/restart -Value: true -Owners: openswan - -Name: openswan/rsa_key_length -Template: openswan/rsa_key_length -Value: 2048 -Owners: openswan - -Name: openswan/rsa_key_type -Template: openswan/rsa_key_type -Value: x509 -Owners: openswan -Flags: seen - -Name: openswan/start_level -Template: openswan/start_level -Value: earliest -Owners: openswan - -Name: openswan/x509_common_name -Template: openswan/x509_common_name -Value: -Owners: openswan - -Name: openswan/x509_country_code -Template: openswan/x509_country_code -Value: AT -Owners: openswan - -Name: openswan/x509_email_address -Template: openswan/x509_email_address -Value: -Owners: openswan - -Name: openswan/x509_locality_name -Template: openswan/x509_locality_name -Value: -Owners: openswan - -Name: openswan/x509_organization_name -Template: openswan/x509_organization_name -Value: -Owners: openswan - -Name: openswan/x509_organizational_unit -Template: openswan/x509_organizational_unit -Value: -Owners: openswan - -Name: openswan/x509_self_signed -Template: openswan/x509_self_signed -Value: true -Owners: openswan -Flags: seen - -Name: openswan/x509_state_name -Template: openswan/x509_state_name -Value: -Owners: openswan - -Name: portmap/loopback -Template: portmap/loopback -Value: false -Owners: portmap - -Name: shared/accepted-sun-dlj-v1-1 -Template: shared/accepted-sun-dlj-v1-1 -Value: true -Owners: sun-java6-bin, sun-java6-jre -Flags: seen - -Name: shared/error-sun-dlj-v1-1 -Template: shared/error-sun-dlj-v1-1 -Owners: sun-java6-bin, sun-java6-jre - -Name: shared/kernel-image/really-run-bootloader -Template: shared/kernel-image/really-run-bootloader -Owners: linux-image-2.6.32-bpo.5-686, linux-image-2.6.32-bpo.5-xen-686 - -Name: shared/present-sun-dlj-v1-1 -Template: shared/present-sun-dlj-v1-1 -Value: true -Owners: sun-java6-bin, sun-java6-jre -Flags: seen - -Name: ssh/disable_cr_auth -Template: ssh/disable_cr_auth -Owners: openssh-server - -Name: ssh/encrypted_host_key_but_no_keygen -Template: ssh/encrypted_host_key_but_no_keygen -Owners: openssh-server - -Name: ssh/new_config -Template: ssh/new_config -Owners: openssh-server - -Name: ssh/use_old_init_script -Template: ssh/use_old_init_script -Value: true -Owners: openssh-server -Flags: seen - -Name: ssh/vulnerable_host_keys -Template: ssh/vulnerable_host_keys -Owners: openssh-server - -Name: sun-java6-jre/jcepolicy -Template: sun-java6-jre/jcepolicy -Owners: sun-java6-jre - -Name: sun-java6-jre/stopthread -Template: sun-java6-jre/stopthread -Owners: sun-java6-jre - -Name: tzdata/Areas -Template: tzdata/Areas -Value: Etc -Owners: tzdata -Flags: seen - -Name: tzdata/Zones/Africa -Template: tzdata/Zones/Africa -Owners: tzdata - -Name: tzdata/Zones/America -Template: tzdata/Zones/America -Owners: tzdata - -Name: tzdata/Zones/Antarctica -Template: tzdata/Zones/Antarctica -Owners: tzdata - -Name: tzdata/Zones/Arctic -Template: tzdata/Zones/Arctic -Owners: tzdata - -Name: tzdata/Zones/Asia -Template: tzdata/Zones/Asia -Owners: tzdata - -Name: tzdata/Zones/Atlantic -Template: tzdata/Zones/Atlantic -Owners: tzdata - -Name: tzdata/Zones/Australia -Template: tzdata/Zones/Australia -Owners: tzdata - -Name: tzdata/Zones/Etc -Template: tzdata/Zones/Etc -Value: UTC -Owners: tzdata -Flags: seen - -Name: tzdata/Zones/Europe -Template: tzdata/Zones/Europe -Owners: tzdata - -Name: tzdata/Zones/Indian -Template: tzdata/Zones/Indian -Owners: tzdata - -Name: tzdata/Zones/Pacific -Template: tzdata/Zones/Pacific -Owners: tzdata - -Name: tzdata/Zones/SystemV -Template: tzdata/Zones/SystemV -Owners: tzdata - -Name: ucf/changeprompt -Template: ucf/changeprompt -Owners: ucf - -Name: ucf/changeprompt_threeway -Template: ucf/changeprompt_threeway -Owners: ucf - -Name: ucf/show_diff -Template: ucf/show_diff -Owners: ucf - -Name: ucf/title -Template: ucf/title -Owners: ucf - -Name: udev/new_kernel_needed -Template: udev/new_kernel_needed -Owners: udev - -Name: udev/reboot_needed -Template: udev/reboot_needed -Owners: udev - diff --git a/systemvm/patches/debian/config/etc/chef/node.json b/systemvm/patches/debian/config/etc/chef/node.json deleted file mode 100644 index 1b23e334d41..00000000000 --- a/systemvm/patches/debian/config/etc/chef/node.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "run_list": [ - "recipe[csip::default]" - ] -} diff --git a/systemvm/patches/debian/config/etc/chef/solo.rb b/systemvm/patches/debian/config/etc/chef/solo.rb deleted file mode 100644 index 3207dd17f8e..00000000000 --- a/systemvm/patches/debian/config/etc/chef/solo.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -data_bags_path "/var/chef/data_bags" -cookbook_path "/var/chef/cookbooks" -log_level :debug -log_location STDOUT diff --git a/systemvm/patches/debian/config/opt/cloud/templates/README b/systemvm/patches/debian/config/opt/cloud/templates/README deleted file mode 100644 index ffd68a9ae6d..00000000000 --- a/systemvm/patches/debian/config/opt/cloud/templates/README +++ /dev/null @@ -1,2 +0,0 @@ -These are the templates for the redundant router -and redundant vpc_router diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/acl0001.json b/systemvm/patches/debian/config/opt/cloud/testdata/acl0001.json deleted file mode 100644 index 4a07b405a54..00000000000 --- a/systemvm/patches/debian/config/opt/cloud/testdata/acl0001.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "eth2": { - "device": "eth2", - "egress_rules": [ - { - "allowed": false, - "cidr": "10.0.6.0/8", - "first_port": 60, - "last_port": 60, - "type": "tcp" - } - ], - "ingress_rules": [ - { - "allowed": true, - "cidr": "10.0.1.0/8", - "protocol": 41, - "type": "protocol" - }, - { - "allowed": true, - "cidr": "10.0.4.0/8", - "type": "all" - }, - { - "allowed": true, - "cidr": "10.0.3.0/8", - "icmp_code": -1, - "icmp_type": -1, - "type": "icmp" - }, - { - "allowed": true, - "cidr": "10.0.2.0/8", - "first_port": 40, - "last_port": 40, - "type": "udp" - }, - { - "allowed": true, - "cidr": "10.0.1.0/8", - "first_port": 30, - "last_port": 30, - "type": "tcp" - } - ], - "mac_address": "02:00:0d:7b:00:04", - "nic_ip": "172.16.1.1", - "nic_netmask": "24", - "private_gateway_acl": false, - "type": "networkacl" - }, - "id": "networkacl" -} diff --git a/systemvm/patches/debian/config/root/redundant_router/arping_gateways.sh.templ b/systemvm/patches/debian/config/root/redundant_router/arping_gateways.sh.templ deleted file mode 100644 index 931c95901c8..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/arping_gateways.sh.templ +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist -while read i -do - ip addr show $i|grep "inet " > /tmp/iplist_$i - while read line - do - ip=`echo $line|cut -d " " -f 2|cut -d "/" -f 1` - arping -I $i -A $ip -c 1 >> [RROUTER_LOG] 2>&1 - arping -I $i -A $ip -c 1 >> [RROUTER_LOG] 2>&1 - done < /tmp/iplist_$i -done < /tmp/iflist -sleep 1 diff --git a/systemvm/patches/debian/config/root/redundant_router/backup.sh.templ b/systemvm/patches/debian/config/root/redundant_router/backup.sh.templ deleted file mode 100644 index 32c811b26d4..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/backup.sh.templ +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -sleep 1 - -source /root/func.sh - -lock="biglock" -locked=$(getLockFile $lock) -if [ "$locked" != "1" ] -then - exit 1 -fi - -echo To backup called >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1 -echo Disable public ip $? >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1 -[RROUTER_BIN_PATH]/primary-backup.sh backup >> [RROUTER_LOG] 2>&1 -echo Switch conntrackd mode backup $? >> [RROUTER_LOG] -echo Status: BACKUP >> [RROUTER_LOG] - -releaseLockFile $lock $locked -exit 0 diff --git a/systemvm/patches/debian/config/root/redundant_router/check_bumpup.sh b/systemvm/patches/debian/config/root/redundant_router/check_bumpup.sh deleted file mode 100644 index 7682bad5f63..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/check_bumpup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -cat /tmp/rrouter_bumped diff --git a/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ b/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ deleted file mode 100755 index 4253b291296..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -ROUTER_BIN_PATH=/ramdisk/rrouter -STRIKE_FILE="$ROUTER_BIN_PATH/keepalived.strikes" - -if [ -e [RROUTER_BIN_PATH]/keepalived.ts2 ] -then - lasttime=$(cat [RROUTER_BIN_PATH]/keepalived.ts2) - thistime=$(cat [RROUTER_BIN_PATH]/keepalived.ts) - diff=$(($thistime - $lasttime)) - s=0 - if [ $diff -lt 30 ] - then - if [ -e $STRIKE_FILE ] - then - s=`cat $STRIKE_FILE 2>/dev/null` - fi - s=$(($s+1)) - echo $s > $STRIKE_FILE - else - if [ -e $STRIKE_FILE ] - then - rm $STRIKE_FILE - else - echo keepalived.strikes file does not exist! >> $ROUTER_LOG - fi - fi - #3 strikes rule - if [ $s -gt 2 ] - then - echo Keepalived process is dead! >> [RROUTER_LOG] - [RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1 - [RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1 - [RROUTER_BIN_PATH]/primary-backup.sh fault >> [RROUTER_LOG] 2>&1 - service keepalived stop >> [RROUTER_LOG] 2>&1 - service conntrackd stop >> [RROUTER_LOG] 2>&1 - pkill -9 keepalived >> [RROUTER_LOG] 2>&1 - pkill -9 conntrackd >> [RROUTER_LOG] 2>&1 - echo Status: FAULT \(keepalived process is dead\) >> [RROUTER_LOG] - exit - fi -fi - -cp [RROUTER_BIN_PATH]/keepalived.ts [RROUTER_BIN_PATH]/keepalived.ts2 diff --git a/systemvm/patches/debian/config/root/redundant_router/checkrouter.sh.templ b/systemvm/patches/debian/config/root/redundant_router/checkrouter.sh.templ deleted file mode 100755 index fbf4f0f54d0..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/checkrouter.sh.templ +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -source /root/func.sh - -nolock=0 -if [ $# -eq 1 ] -then - if [ $1 == "--no-lock" ] - then - nolock=1 - fi -fi - -if [ $nolock -eq 0 ] -then - lock="biglock" - locked=$(getLockFile $lock) - if [ "$locked" != "1" ] - then - exit 1 - fi -fi - -bumped="Bumped: NO" -if [ -e /tmp/rrouter_bumped ] -then - bumped="Bumped: YES" -fi - -stat=`tail -n 1 [RROUTER_LOG] | grep "Status"` -if [ $? -eq 0 ] -then - echo "$stat&$bumped" -fi - -if [ $nolock -eq 0 ] -then - unlock_exit $? $lock $locked -fi diff --git a/systemvm/patches/debian/config/root/redundant_router/conntrackd.conf.templ b/systemvm/patches/debian/config/root/redundant_router/conntrackd.conf.templ deleted file mode 100644 index 091de105625..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/conntrackd.conf.templ +++ /dev/null @@ -1,401 +0,0 @@ -# -# Synchronizer settings -# -Sync { - Mode FTFW { - # - # Size of the resend queue (in objects). This is the maximum - # number of objects that can be stored waiting to be confirmed - # via acknoledgment. If you keep this value low, the daemon - # will have less chances to recover state-changes under message - # omission. On the other hand, if you keep this value high, - # the daemon will consume more memory to store dead objects. - # Default is 131072 objects. - # - # ResendQueueSize 131072 - - # - # This parameter allows you to set an initial fixed timeout - # for the committed entries when this node goes from backup - # to primary. This mechanism provides a way to purge entries - # that were not recovered appropriately after the specified - # fixed timeout. If you set a low value, TCP entries in - # Established states with no traffic may hang. For example, - # an SSH connection without KeepAlive enabled. If not set, - # the daemon uses an approximate timeout value calculation - # mechanism. By default, this option is not set. - # - # CommitTimeout 180 - - # - # If the firewall replica goes from primary to backup, - # the conntrackd -t command is invoked in the script. - # This command schedules a flush of the table in N seconds. - # This is useful to purge the connection tracking table of - # zombie entries and avoid clashes with old entries if you - # trigger several consecutive hand-overs. Default is 60 seconds. - # - # PurgeTimeout 60 - - # Set the acknowledgement window size. If you decrease this - # value, the number of acknowlegdments increases. More - # acknowledgments means more overhead as conntrackd has to - # handle more control messages. On the other hand, if you - # increase this value, the resend queue gets more populated. - # This results in more overhead in the queue releasing. - # The following value is based on some practical experiments - # measuring the cycles spent by the acknowledgment handling - # with oprofile. If not set, default window size is 300. - # - # ACKWindowSize 300 - - # - # This clause allows you to disable the external cache. Thus, - # the state entries are directly injected into the kernel - # conntrack table. As a result, you save memory in user-space - # but you consume slots in the kernel conntrack table for - # backup state entries. Moreover, disabling the external cache - # means more CPU consumption. You need a Linux kernel - # >= 2.6.29 to use this feature. By default, this clause is - # set off. If you are installing conntrackd for first time, - # please read the user manual and I encourage you to consider - # using the fail-over scripts instead of enabling this option! - # - # DisableExternalCache Off - } - - # - # Multicast IP and interface where messages are - # broadcasted (dedicated link). IMPORTANT: Make sure - # that iptables accepts traffic for destination - # 225.0.0.50, eg: - # - # iptables -I INPUT -d 225.0.0.50 -j ACCEPT - # iptables -I OUTPUT -d 225.0.0.50 -j ACCEPT - # - Multicast { - # - # Multicast address: The address that you use as destination - # in the synchronization messages. You do not have to add - # this IP to any of your existing interfaces. If any doubt, - # do not modify this value. - # - IPv4_address 225.0.0.50 - - # - # The multicast group that identifies the cluster. If any - # doubt, do not modify this value. - # - Group 3780 - - # - # IP address of the interface that you are going to use to - # send the synchronization messages. Remember that you must - # use a dedicated link for the synchronization messages. - # - IPv4_interface [LINK_IP] - - # - # The name of the interface that you are going to use to - # send the synchronization messages. - # - Interface [LINK_IF] - - # The multicast sender uses a buffer to enqueue the packets - # that are going to be transmitted. The default size of this - # socket buffer is available at /proc/sys/net/core/wmem_default. - # This value determines the chances to have an overrun in the - # sender queue. The overrun results packet loss, thus, losing - # state information that would have to be retransmitted. If you - # notice some packet loss, you may want to increase the size - # of the sender buffer. The default size is usually around - # ~100 KBytes which is fairly small for busy firewalls. - # - SndSocketBuffer 1249280 - - # The multicast receiver uses a buffer to enqueue the packets - # that the socket is pending to handle. The default size of this - # socket buffer is available at /proc/sys/net/core/rmem_default. - # This value determines the chances to have an overrun in the - # receiver queue. The overrun results packet loss, thus, losing - # state information that would have to be retransmitted. If you - # notice some packet loss, you may want to increase the size of - # the receiver buffer. The default size is usually around - # ~100 KBytes which is fairly small for busy firewalls. - # - RcvSocketBuffer 1249280 - - # - # Enable/Disable message checksumming. This is a good - # property to achieve fault-tolerance. In case of doubt, do - # not modify this value. - # - Checksum on - } - # - # You can specify more than one dedicated link. Thus, if one dedicated - # link fails, conntrackd can fail-over to another. Note that adding - # more than one dedicated link does not mean that state-updates will - # be sent to all of them. There is only one active dedicated link at - # a given moment. The `Default' keyword indicates that this interface - # will be selected as the initial dedicated link. You can have - # up to 4 redundant dedicated links. Note: Use different multicast - # groups for every redundant link. - # - # Multicast Default { - # IPv4_address 225.0.0.51 - # Group 3781 - # IPv4_interface 192.168.100.101 - # Interface eth3 - # # SndSocketBuffer 1249280 - # # RcvSocketBuffer 1249280 - # Checksum on - # } - - # - # You can use Unicast UDP instead of Multicast to propagate events. - # Note that you cannot use unicast UDP and Multicast at the same - # time, you can only select one. - # - # UDP { - # - # UDP address that this firewall uses to listen to events. - # - # IPv4_address 192.168.2.100 - # - # or you may want to use an IPv6 address: - # - # IPv6_address fe80::215:58ff:fe28:5a27 - - # - # Destination UDP address that receives events, ie. the other - # firewall's dedicated link address. - # - # IPv4_Destination_Address 192.168.2.101 - # - # or you may want to use an IPv6 address: - # - # IPv6_Destination_Address fe80::2d0:59ff:fe2a:775c - - # - # UDP port used - # - # Port 3780 - - # - # The name of the interface that you are going to use to - # send the synchronization messages. - # - # Interface eth2 - - # - # The sender socket buffer size - # - # SndSocketBuffer 1249280 - - # - # The receiver socket buffer size - # - # RcvSocketBuffer 1249280 - - # - # Enable/Disable message checksumming. - # - # Checksum on - # } - -} - -# -# General settings -# -General { - # - # Set the nice value of the daemon, this value goes from -20 - # (most favorable scheduling) to 19 (least favorable). Using a - # very low value reduces the chances to lose state-change events. - # Default is 0 but this example file sets it to most favourable - # scheduling as this is generally a good idea. See man nice(1) for - # more information. - # - Nice -20 - - # - # Select a different scheduler for the daemon, you can select between - # RR and FIFO and the process priority (minimum is 0, maximum is 99). - # See man sched_setscheduler(2) for more information. Using a RT - # scheduler reduces the chances to overrun the Netlink buffer. - # - # Scheduler { - # Type FIFO - # Priority 99 - # } - - # - # Number of buckets in the cache hashtable. The bigger it is, - # the closer it gets to O(1) at the cost of consuming more memory. - # Read some documents about tuning hashtables for further reference. - # - HashSize 32768 - - # - # Maximum number of conntracks, it should be double of: - # $ cat /proc/sys/net/netfilter/nf_conntrack_max - # since the daemon may keep some dead entries cached for possible - # retransmission during state synchronization. - # - HashLimit 131072 - - # - # Logfile: on (/var/log/conntrackd.log), off, or a filename - # Default: off - # - LogFile on - - # - # Syslog: on, off or a facility name (daemon (default) or local0..7) - # Default: off - # - #Syslog on - - # - # Lockfile - # - LockFile /var/lock/conntrack.lock - - # - # Unix socket configuration - # - UNIX { - Path /var/run/conntrackd.ctl - Backlog 20 - } - - # - # Netlink event socket buffer size. If you do not specify this clause, - # the default buffer size value in /proc/net/core/rmem_default is - # used. This default value is usually around 100 Kbytes which is - # fairly small for busy firewalls. This leads to event message dropping - # and high CPU consumption. This example configuration file sets the - # size to 2 MBytes to avoid this sort of problems. - # - NetlinkBufferSize 2097152 - - # - # The daemon doubles the size of the netlink event socket buffer size - # if it detects netlink event message dropping. This clause sets the - # maximum buffer size growth that can be reached. This example file - # sets the size to 8 MBytes. - # - NetlinkBufferSizeMaxGrowth 8388608 - - # - # If the daemon detects that Netlink is dropping state-change events, - # it automatically schedules a resynchronization against the Kernel - # after 30 seconds (default value). Resynchronizations are expensive - # in terms of CPU consumption since the daemon has to get the full - # kernel state-table and purge state-entries that do not exist anymore. - # Be careful of setting a very small value here. You have the following - # choices: On (enabled, use default 30 seconds value), Off (disabled) - # or Value (in seconds, to set a specific amount of time). If not - # specified, the daemon assumes that this option is enabled. - # - # NetlinkOverrunResync On - - # - # If you want reliable event reporting over Netlink, set on this - # option. If you set on this clause, it is a good idea to set off - # NetlinkOverrunResync. This option is off by default and you need - # a Linux kernel >= 2.6.31. - # - # NetlinkEventsReliable Off - - # - # By default, the daemon receives state updates following an - # event-driven model. You can modify this behaviour by switching to - # polling mode with the PollSecs clause. This clause tells conntrackd - # to dump the states in the kernel every N seconds. With regards to - # synchronization mode, the polling mode can only guarantee that - # long-lifetime states are recovered. The main advantage of this method - # is the reduction in the state replication at the cost of reducing the - # chances of recovering connections. - # - # PollSecs 15 - - # - # The daemon prioritizes the handling of state-change events coming - # from the core. With this clause, you can set the maximum number of - # state-change events (those coming from kernel-space) that the daemon - # will handle after which it will handle other events coming from the - # network or userspace. A low value improves interactivity (in terms of - # real-time behaviour) at the cost of extra CPU consumption. - # Default (if not set) is 100. - # - # EventIterationLimit 100 - - # - # Event filtering: This clause allows you to filter certain traffic, - # There are currently three filter-sets: Protocol, Address and - # State. The filter is attached to an action that can be: Accept or - # Ignore. Thus, you can define the event filtering policy of the - # filter-sets in positive or negative logic depending on your needs. - # You can select if conntrackd filters the event messages from - # user-space or kernel-space. The kernel-space event filtering - # saves some CPU cycles by avoiding the copy of the event message - # from kernel-space to user-space. The kernel-space event filtering - # is prefered, however, you require a Linux kernel >= 2.6.29 to - # filter from kernel-space. If you want to select kernel-space - # event filtering, use the keyword 'Kernelspace' instead of - # 'Userspace'. - # - Filter From Userspace { - # - # Accept only certain protocols: You may want to replicate - # the state of flows depending on their layer 4 protocol. - # - Protocol Accept { - TCP - SCTP - DCCP - # UDP - # ICMP # This requires a Linux kernel >= 2.6.31 - } - - # - # Ignore traffic for a certain set of IP's: Usually all the - # IP assigned to the firewall since local traffic must be - # ignored, only forwarded connections are worth to replicate. - # Note that these values depends on the local IPs that are - # assigned to the firewall. - # - Address Ignore { - IPv4_address 127.0.0.1 # loopback - IPv4_address [IGNORE_IP1] - IPv4_address [IGNORE_IP2] - IPv4_address [IGNORE_IP3] - #IPv4_address 192.168.0.100 # virtual IP 1 - #IPv4_address 192.168.1.100 # virtual IP 2 - #IPv4_address 192.168.0.1 - #IPv4_address 192.168.1.1 - #IPv4_address 192.168.100.100 # dedicated link ip - # - # You can also specify networks in format IP/cidr. - # IPv4_address 192.168.0.0/24 - # - # You can also specify an IPv6 address - # IPv6_address ::1 - } - - # - # Uncomment this line below if you want to filter by flow state. - # This option introduces a trade-off in the replication: it - # reduces CPU consumption at the cost of having lazy backup - # firewall replicas. The existing TCP states are: SYN_SENT, - # SYN_RECV, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, LAST_ACK, - # TIME_WAIT, CLOSED, LISTEN. - # - # State Accept { - # ESTABLISHED CLOSED TIME_WAIT CLOSE_WAIT for TCP - # } - } -} diff --git a/systemvm/patches/debian/config/root/redundant_router/disable_pubip.sh b/systemvm/patches/debian/config/root/redundant_router/disable_pubip.sh deleted file mode 100644 index ee4e894ba69..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/disable_pubip.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist -while read i -do - ifconfig $i down -done < /tmp/iflist diff --git a/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ b/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ deleted file mode 100644 index a59cd66220e..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist -ip addr show eth2 | grep "inet" 2>&1 > /dev/null -is_init=$? - -set -e - -while read i -do - # if eth2'ip has already been configured, we would use ifconfig rather than ifdown/ifup - if [ "$i" == "eth2" -a "$is_init" != "0" ] - then - ifdown $i - ifup $i - else - ifconfig $i down - ifconfig $i up - fi -done < /tmp/iflist -ip route add default via [GATEWAY] dev eth2 - -while read line -do -dev=$(echo $line | awk '{print $1'}) -gw=$(echo $line | awk '{print $2'}) - -if [ "$dev" == "eth2" ] -then - continue; -fi -ip route add default via $gw table Table_$dev proto static - -done < /var/cache/cloud/ifaceGwIp diff --git a/systemvm/patches/debian/config/root/redundant_router/fault.sh.templ b/systemvm/patches/debian/config/root/redundant_router/fault.sh.templ deleted file mode 100644 index c008a9cb449..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/fault.sh.templ +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -source /root/func.sh - -lock="biglock" -locked=$(getLockFile $lock) -if [ "$locked" != "1" ] -then - exit 1 -fi - -echo To fault called >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1 -echo Disable public ip >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1 -echo Stop services $? >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/primary-backup.sh fault >> [RROUTER_LOG] 2>&1 -echo Switch conntrackd mode fault $? >> [RROUTER_LOG] -echo Status: FAULT >> [RROUTER_LOG] - -releaseLockFile $lock $locked diff --git a/systemvm/patches/debian/config/root/redundant_router/heartbeat.sh.templ b/systemvm/patches/debian/config/root/redundant_router/heartbeat.sh.templ deleted file mode 100755 index e064c1a2cf3..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/heartbeat.sh.templ +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -t=$(date +%s) -echo $t > [RROUTER_BIN_PATH]/keepalived.ts diff --git a/systemvm/patches/debian/config/root/redundant_router/keepalived.conf.templ b/systemvm/patches/debian/config/root/redundant_router/keepalived.conf.templ deleted file mode 100644 index a4969a5b698..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/keepalived.conf.templ +++ /dev/null @@ -1,57 +0,0 @@ -! Licensed to the Apache Software Foundation (ASF) under one -! or more contributor license agreements. See the NOTICE file -! distributed with this work for additional information -! regarding copyright ownership. The ASF licenses this file -! to you under the Apache License, Version 2.0 (the -! "License"); you may not use this file except in compliance -! with the License. You may obtain a copy of the License at -! -! http://www.apache.org/licenses/LICENSE-2.0 -! -! Unless required by applicable law or agreed to in writing, -! software distributed under the License is distributed on an -! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -! KIND, either express or implied. See the License for the -! specific language governing permissions and limitations -! under the License. - -global_defs { - router_id [ROUTER_ID] -} - -vrrp_script check_bumpup { - script "[RROUTER_BIN_PATH]/check_bumpup.sh" - interval 5 - weight [DELTA] -} - -vrrp_script heartbeat { - script "[RROUTER_BIN_PATH]/heartbeat.sh" - interval 10 -} - -vrrp_instance inside_network { - state BACKUP - interface eth0 - virtual_router_id 51 - priority [PRIORITY] - - advert_int 1 - authentication { - auth_type PASS - auth_pass WORD - } - - virtual_ipaddress { - [ROUTER_IP] brd [BOARDCAST] dev eth0 - } - - track_script { - check_bumpup - heartbeat - } - - notify_master "[RROUTER_BIN_PATH]/master.sh" - notify_backup "[RROUTER_BIN_PATH]/backup.sh" - notify_fault "[RROUTER_BIN_PATH]/fault.sh" -} diff --git a/systemvm/patches/debian/config/root/redundant_router/master.sh.templ b/systemvm/patches/debian/config/root/redundant_router/master.sh.templ deleted file mode 100644 index 11ca6284f65..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/master.sh.templ +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -source /root/func.sh - -lock="biglock" -locked=$(getLockFile $lock) -if [ "$locked" != "1" ] -then - exit 1 -fi - -echo To master called >> [RROUTER_LOG] -[RROUTER_BIN_PATH]/enable_pubip.sh >> [RROUTER_LOG] 2>&1 -ret=$? -if [ $ret -eq 0 ] -then - [RROUTER_BIN_PATH]/services.sh restart >> [RROUTER_LOG] 2>&1 - ret=$? -fi -last_msg=`tail -n 1 [RROUTER_LOG]` -echo Enable public ip returned $ret >> [RROUTER_LOG] -if [ $ret -ne 0 ] -then - echo Fail to enable public ip! >> [RROUTER_LOG] - [RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1 - [RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1 - service keepalived stop >> [RROUTER_LOG] 2>&1 - service conntrackd stop >> [RROUTER_LOG] 2>&1 - echo Status: FAULT \($last_msg\) >> [RROUTER_LOG] - releaseLockFile $lock $locked - exit -fi -[RROUTER_BIN_PATH]/primary-backup.sh primary >> [RROUTER_LOG] 2>&1 -ret=$? -echo Switch conntrackd mode primary returned $ret >> [RROUTER_LOG] -if [ $ret -ne 0 ] -then - echo Fail to switch conntrackd mode, but try to continue working >> [RROUTER_LOG] -fi -[RROUTER_BIN_PATH]/arping_gateways.sh -echo Status: MASTER >> [RROUTER_LOG] - -releaseLockFile $lock $locked -exit 0 diff --git a/systemvm/patches/debian/config/root/redundant_router/primary-backup.sh.templ b/systemvm/patches/debian/config/root/redundant_router/primary-backup.sh.templ deleted file mode 100644 index 4eb9eafe4fd..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/primary-backup.sh.templ +++ /dev/null @@ -1,126 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -CONNTRACKD_BIN=/usr/sbin/conntrackd -CONNTRACKD_LOCK=/var/lock/conntrack.lock -CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf -CONNTRACKD_LOG=[RROUTER_LOG] - -case "$1" in - primary) - # - # commit the external cache into the kernel table - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -c" - fi - - # - # flush the internal and the external caches - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -f" - fi - - # - # resynchronize my internal cache to the kernel table - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -R" - fi - - # - # send a bulk update to backups - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -B" - fi - echo Conntrackd switch to primary done >> $CONNTRACKD_LOG - ;; - backup) - # - # is conntrackd running? request some statistics to check it - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -s - if [ $? -eq 1 ] - then - # - # something's wrong, do we have a lock file? - # - if [ -f $CONNTRACKD_LOCK ] - then - logger "WARNING: conntrackd was not cleanly stopped." - logger "If you suspect that it has crashed:" - logger "1) Enable coredumps" - logger "2) Try to reproduce the problem" - logger "3) Post the coredump to netfilter-devel@vger.kernel.org" - rm -f $CONNTRACKD_LOCK - fi - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -d - if [ $? -eq 1 ] - then - logger "ERROR: cannot launch conntrackd" - exit 1 - fi - fi - # - # shorten kernel conntrack timers to remove the zombie entries. - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -t - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -t" - fi - - # - # request resynchronization with master firewall replica (if any) - # Note: this does nothing in the alarm approach. - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -n - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -n" - fi - echo Conntrackd switch to backup done >> $CONNTRACKD_LOG - ;; - fault) - # - # shorten kernel conntrack timers to remove the zombie entries. - # - $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -t - if [ $? -eq 1 ] - then - logger "ERROR: failed to invoke conntrackd -t" - fi - echo Conntrackd switch to fault done >> $CONNTRACKD_LOG - ;; - *) - logger "conntrackd: ERROR: unknown state transition: " $1 - echo "Usage: primary-backup.sh {primary|backup|fault}" - exit 1 - ;; -esac - -exit 0 diff --git a/systemvm/patches/debian/config/root/redundant_router/services.sh b/systemvm/patches/debian/config/root/redundant_router/services.sh deleted file mode 100644 index b7ebeed264c..00000000000 --- a/systemvm/patches/debian/config/root/redundant_router/services.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -vpn_service() { - ps aux|grep ipsec | grep -v grep > /dev/null - no_vpn=$? - if [ $no_vpn -eq 1 ] - then - return 0 - fi - r=0 - case "$1" in - stop) - service ipsec stop && \ - service xl2tpd stop - r=$? - ;; - restart) - service ipsec restart && \ - service xl2tpd restart - r=$? - ;; - esac - return $r -} - -ret=0 -case "$1" in - start) - vpn_service restart && \ - service cloud-passwd-srvr start && \ - service dnsmasq start - ret=$? - ;; - stop) - vpn_service stop && \ - service cloud-passwd-srvr stop && \ - service dnsmasq stop - ret=$? - ;; - restart) - vpn_service restart && \ - service cloud-passwd-srvr restart && \ - service dnsmasq restart - ret=$? - ;; - *) - echo "Usage: services {start|stop|restart}" - exit 1 - ;; -esac - -exit $ret diff --git a/systemvm/patches/debian/convert.sh b/systemvm/patches/debian/convert.sh deleted file mode 100755 index 27098a13445..00000000000 --- a/systemvm/patches/debian/convert.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - - - - -begin=$(date +%s) -echo "Backing up systemvm.img" -cp systemvm.img systemvm.img.tmp -echo "Converting raw image to fixed vhd" -vhd-util convert -s 0 -t 1 -i systemvm.img.tmp -o systemvm.vhd &> /dev/null -echo "Converting fixed vhd to dynamic vhd" -vhd-util convert -s 1 -t 2 -i systemvm.vhd -o systemvm.vhd &> /dev/null -echo "Compressing vhd..." -bzip2 -c systemvm.vhd > systemvm.vhd.bz2 -echo "Done VHD" - -echo "Converting raw image to qcow2" -qemu-img convert -f raw -O qcow2 systemvm.img systemvm.qcow2 -echo "Compressing qcow2..." -bzip2 -c systemvm.qcow2 > systemvm.qcow2.bz2 -echo "Done qcow2" -echo "Converting raw image to vmdk" -qemu-img convert -f raw -O vmdk systemvm.img systemvm.vmdk -echo "Done creating vmdk" -echo "Creating ova appliance " -ovftool systemvm.vmx systemvm.ova -echo "Done creating OVA" -echo "Cleaning up..." -rm -vf systemvm.vmdk -rm -vf systemvm.vhd.bak - -echo "Compressing raw image..." -bzip2 -c systemvm.img > systemvm.img.bz2 -echo "Done compressing raw image" - -echo "Generating md5sums" -md5sum systemvm.img > md5sum -md5sum systemvm.img.bz2 >> md5sum -md5sum systemvm.vhd >> md5sum -md5sum systemvm.vhd.bz2 >> md5sum -md5sum systemvm.qcow2 >> md5sum -md5sum systemvm.qcow2.bz2 >> md5sum -md5sum systemvm.ova >> md5sum -fin=$(date +%s) -t=$((fin-begin)) -echo "Finished compressing/converting image in $t seconds" diff --git a/systemvm/patches/debian/config/etc/apache2/httpd.conf b/systemvm/patches/debian/etc/apache2/httpd.conf similarity index 100% rename from systemvm/patches/debian/config/etc/apache2/httpd.conf rename to systemvm/patches/debian/etc/apache2/httpd.conf diff --git a/systemvm/patches/debian/config/etc/apache2/vhost.template b/systemvm/patches/debian/etc/apache2/vhost.template similarity index 99% rename from systemvm/patches/debian/config/etc/apache2/vhost.template rename to systemvm/patches/debian/etc/apache2/vhost.template index 7b89c3b5b46..f393db55df3 100644 --- a/systemvm/patches/debian/config/etc/apache2/vhost.template +++ b/systemvm/patches/debian/etc/apache2/vhost.template @@ -235,4 +235,3 @@ Listen 10.1.1.1:80 Listen 10.1.1.1:443 - diff --git a/systemvm/patches/debian/config/etc/cloud-nic.rules b/systemvm/patches/debian/etc/cloud-nic.rules similarity index 98% rename from systemvm/patches/debian/config/etc/cloud-nic.rules rename to systemvm/patches/debian/etc/cloud-nic.rules index 56e74ec4e9d..e34e0c242c0 100644 --- a/systemvm/patches/debian/config/etc/cloud-nic.rules +++ b/systemvm/patches/debian/etc/cloud-nic.rules @@ -1,2 +1 @@ SUBSYSTEM=="net" KERNEL=="eth*" RUN+="/opt/cloud/bin/cloud-nic.sh $env{ACTION} %k" - diff --git a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl b/systemvm/patches/debian/etc/dnsmasq.conf.tmpl similarity index 99% rename from systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl rename to systemvm/patches/debian/etc/dnsmasq.conf.tmpl index 403e2041975..4e9d2496293 100644 --- a/systemvm/patches/debian/config/etc/dnsmasq.conf.tmpl +++ b/systemvm/patches/debian/etc/dnsmasq.conf.tmpl @@ -172,11 +172,11 @@ dhcp-hostsfile=/etc/dhcphosts.txt #dhcp-range=1234::2, 1234::500, 64, 12h # Do Router Advertisements, BUT NOT DHCP for this subnet. -#dhcp-range=1234::, ra-only +#dhcp-range=1234::, ra-only # Do Router Advertisements, BUT NOT DHCP for this subnet, also try and -# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack -# hosts. Use the DHCPv4 lease to derive the name, network segment and +# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack +# hosts. Use the DHCPv4 lease to derive the name, network segment and # MAC address and assume that the host will also have an # IPv6 address calculated using the SLAAC alogrithm. #dhcp-range=1234::, ra-names @@ -199,9 +199,9 @@ dhcp-hostsfile=/etc/dhcphosts.txt #dhcp-range=1234::, ra-stateless, ra-names # Do router advertisements for all subnets where we're doing DHCPv6 -# Unless overriden by ra-stateless, ra-names, et al, the router +# Unless overriden by ra-stateless, ra-names, et al, the router # advertisements will have the M and O bits set, so that the clients -# get addresses and configuration from DHCPv6, and the A bit reset, so the +# get addresses and configuration from DHCPv6, and the A bit reset, so the # clients don't use SLAAC addresses. #enable-ra @@ -267,11 +267,11 @@ dhcp-hostsfile=/etc/dhcphosts.txt # any machine with Ethernet address starting 11:22:33: #dhcp-host=11:22:33:*:*:*,set:red -# Give a fixed IPv6 address and name to client with +# Give a fixed IPv6 address and name to client with # DUID 00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2 # Note the MAC addresses CANNOT be used to identify DHCPv6 clients. # Note also the they [] around the IPv6 address are obilgatory. -#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5] +#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5] # Ignore any clients which are not specified in dhcp-host lines # or /etc/ethers. Equivalent to ISC "deny unknown-clients". @@ -329,7 +329,7 @@ dhcp-ignore=tag:!known # Send DHCPv6 option. Note [] around IPv6 addresses. #dhcp-option=option6:dns-server,[1234::77],[1234::88] -# Send DHCPv6 option for namservers as the machine running +# Send DHCPv6 option for namservers as the machine running # dnsmasq and another. #dhcp-option=option6:dns-server,[::],[1234::88] diff --git a/systemvm/patches/debian/config/etc/haproxy/haproxy.cfg b/systemvm/patches/debian/etc/haproxy/haproxy.cfg similarity index 98% rename from systemvm/patches/debian/config/etc/haproxy/haproxy.cfg rename to systemvm/patches/debian/etc/haproxy/haproxy.cfg index 0adbfc6f3bb..63da1ea694d 100644 --- a/systemvm/patches/debian/config/etc/haproxy/haproxy.cfg +++ b/systemvm/patches/debian/etc/haproxy/haproxy.cfg @@ -4,7 +4,7 @@ global user haproxy group haproxy daemon - + defaults log global mode tcp @@ -20,8 +20,8 @@ defaults timeout connect 5000 timeout client 50000 timeout server 50000 - - + + listen cloud-default bind 0.0.0.0:35999 option transparent diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/etc/init.d/cloud-early-config similarity index 100% rename from systemvm/patches/debian/config/etc/init.d/cloud-early-config rename to systemvm/patches/debian/etc/init.d/cloud-early-config diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-passwd-srvr b/systemvm/patches/debian/etc/init.d/cloud-passwd-srvr similarity index 99% rename from systemvm/patches/debian/config/etc/init.d/cloud-passwd-srvr rename to systemvm/patches/debian/etc/init.d/cloud-passwd-srvr index 05e2f37a336..ffd0ec8d206 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-passwd-srvr +++ b/systemvm/patches/debian/etc/init.d/cloud-passwd-srvr @@ -104,12 +104,12 @@ case "$1" in start) start ;; stop) stop - ;; + ;; status) status - ;; + ;; restart) stop start - ;; + ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-consoleproxy b/systemvm/patches/debian/etc/iptables/iptables-consoleproxy similarity index 84% rename from systemvm/patches/debian/config/etc/iptables/iptables-consoleproxy rename to systemvm/patches/debian/etc/iptables/iptables-consoleproxy index ae5d14d8461..9a1c9855eed 100644 --- a/systemvm/patches/debian/config/etc/iptables/iptables-consoleproxy +++ b/systemvm/patches/debian/etc/iptables/iptables-consoleproxy @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,12 +24,12 @@ COMMIT :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] --A INPUT -i lo -j ACCEPT --A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i lo -j ACCEPT +-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp --icmp-type 13 -j DROP --A INPUT -p icmp -j ACCEPT +-A INPUT -p icmp -j ACCEPT -A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 3922 -j ACCEPT -A INPUT -i eth0 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT -A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-dhcpsrvr b/systemvm/patches/debian/etc/iptables/iptables-dhcpsrvr similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/iptables-dhcpsrvr rename to systemvm/patches/debian/etc/iptables/iptables-dhcpsrvr index b49b6b2f244..9851ee7dbd9 100644 --- a/systemvm/patches/debian/config/etc/iptables/iptables-dhcpsrvr +++ b/systemvm/patches/debian/etc/iptables/iptables-dhcpsrvr @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-elbvm b/systemvm/patches/debian/etc/iptables/iptables-elbvm similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/iptables-elbvm rename to systemvm/patches/debian/etc/iptables/iptables-elbvm index 17baef57481..21c5d4be36c 100755 --- a/systemvm/patches/debian/config/etc/iptables/iptables-elbvm +++ b/systemvm/patches/debian/etc/iptables/iptables-elbvm @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -31,4 +31,3 @@ COMMIT -A INPUT -i lo -j ACCEPT -A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT COMMIT - diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-ilbvm b/systemvm/patches/debian/etc/iptables/iptables-ilbvm similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/iptables-ilbvm rename to systemvm/patches/debian/etc/iptables/iptables-ilbvm index 8d5ca651c75..05e7f5bdab0 100755 --- a/systemvm/patches/debian/config/etc/iptables/iptables-ilbvm +++ b/systemvm/patches/debian/etc/iptables/iptables-ilbvm @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -30,4 +30,3 @@ COMMIT -A INPUT -i lo -j ACCEPT -A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT COMMIT - diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-router b/systemvm/patches/debian/etc/iptables/iptables-router similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/iptables-router rename to systemvm/patches/debian/etc/iptables/iptables-router index b49b6b2f244..9851ee7dbd9 100644 --- a/systemvm/patches/debian/config/etc/iptables/iptables-router +++ b/systemvm/patches/debian/etc/iptables/iptables-router @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-secstorage b/systemvm/patches/debian/etc/iptables/iptables-secstorage similarity index 81% rename from systemvm/patches/debian/config/etc/iptables/iptables-secstorage rename to systemvm/patches/debian/etc/iptables/iptables-secstorage index 31399241126..019aaa0bfb4 100755 --- a/systemvm/patches/debian/config/etc/iptables/iptables-secstorage +++ b/systemvm/patches/debian/etc/iptables/iptables-secstorage @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,12 +25,12 @@ COMMIT :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] :HTTP - [0:0] --A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth3 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i lo -j ACCEPT +-A INPUT -i eth3 -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i lo -j ACCEPT -A INPUT -p icmp --icmp-type 13 -j DROP --A INPUT -p icmp -j ACCEPT +-A INPUT -p icmp -j ACCEPT -A INPUT -i eth0 -p tcp -m state --state NEW --dport 3922 -j ACCEPT COMMIT diff --git a/systemvm/patches/debian/config/etc/iptables/iptables-vpcrouter b/systemvm/patches/debian/etc/iptables/iptables-vpcrouter similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/iptables-vpcrouter rename to systemvm/patches/debian/etc/iptables/iptables-vpcrouter index 1c40493917b..e6237c5a1cd 100644 --- a/systemvm/patches/debian/config/etc/iptables/iptables-vpcrouter +++ b/systemvm/patches/debian/etc/iptables/iptables-vpcrouter @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/patches/debian/config/etc/iptables/rt_tables_init b/systemvm/patches/debian/etc/iptables/rt_tables_init similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/rt_tables_init rename to systemvm/patches/debian/etc/iptables/rt_tables_init index c7f086bdaed..9a265c1d62d 100644 --- a/systemvm/patches/debian/config/etc/iptables/rt_tables_init +++ b/systemvm/patches/debian/etc/iptables/rt_tables_init @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/systemvm/patches/debian/config/etc/iptables/rules b/systemvm/patches/debian/etc/iptables/rules similarity index 99% rename from systemvm/patches/debian/config/etc/iptables/rules rename to systemvm/patches/debian/etc/iptables/rules index 7c577615167..ecd905dbc87 100644 --- a/systemvm/patches/debian/config/etc/iptables/rules +++ b/systemvm/patches/debian/etc/iptables/rules @@ -7,7 +7,7 @@ # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -39,4 +39,3 @@ COMMIT -A FORWARD -i eth0 -o eth2 -j ACCEPT -A FORWARD -i eth2 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT COMMIT - diff --git a/systemvm/patches/debian/config/etc/logrotate.conf b/systemvm/patches/debian/etc/logrotate.conf similarity index 99% rename from systemvm/patches/debian/config/etc/logrotate.conf rename to systemvm/patches/debian/etc/logrotate.conf index a44abf9a39b..d213d4e9ce8 100644 --- a/systemvm/patches/debian/config/etc/logrotate.conf +++ b/systemvm/patches/debian/etc/logrotate.conf @@ -23,4 +23,3 @@ include /etc/logrotate.d create 0600 root utmp rotate 1 } - diff --git a/systemvm/patches/debian/config/etc/logrotate.d/apache2 b/systemvm/patches/debian/etc/logrotate.d/apache2 similarity index 100% rename from systemvm/patches/debian/config/etc/logrotate.d/apache2 rename to systemvm/patches/debian/etc/logrotate.d/apache2 diff --git a/systemvm/patches/debian/config/etc/logrotate.d/cloud b/systemvm/patches/debian/etc/logrotate.d/cloud similarity index 100% rename from systemvm/patches/debian/config/etc/logrotate.d/cloud rename to systemvm/patches/debian/etc/logrotate.d/cloud diff --git a/systemvm/patches/debian/config/etc/logrotate.d/conntrackd b/systemvm/patches/debian/etc/logrotate.d/conntrackd similarity index 100% rename from systemvm/patches/debian/config/etc/logrotate.d/conntrackd rename to systemvm/patches/debian/etc/logrotate.d/conntrackd diff --git a/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq b/systemvm/patches/debian/etc/logrotate.d/dnsmasq similarity index 99% rename from systemvm/patches/debian/config/etc/logrotate.d/dnsmasq rename to systemvm/patches/debian/etc/logrotate.d/dnsmasq index 8a797e98d2f..27b6ebc9447 100644 --- a/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq +++ b/systemvm/patches/debian/etc/logrotate.d/dnsmasq @@ -10,4 +10,3 @@ endscript create 0640 dnsmasq root } - diff --git a/systemvm/patches/debian/config/etc/logrotate.d/haproxy b/systemvm/patches/debian/etc/logrotate.d/haproxy similarity index 100% rename from systemvm/patches/debian/config/etc/logrotate.d/haproxy rename to systemvm/patches/debian/etc/logrotate.d/haproxy diff --git a/systemvm/patches/debian/config/etc/logrotate.d/ppp b/systemvm/patches/debian/etc/logrotate.d/ppp similarity index 98% rename from systemvm/patches/debian/config/etc/logrotate.d/ppp rename to systemvm/patches/debian/etc/logrotate.d/ppp index ce02c174e56..37af2f2b1f7 100644 --- a/systemvm/patches/debian/config/etc/logrotate.d/ppp +++ b/systemvm/patches/debian/etc/logrotate.d/ppp @@ -6,4 +6,3 @@ compress nocreate } - diff --git a/systemvm/patches/debian/config/etc/logrotate.d/rsyslog b/systemvm/patches/debian/etc/logrotate.d/rsyslog similarity index 100% rename from systemvm/patches/debian/config/etc/logrotate.d/rsyslog rename to systemvm/patches/debian/etc/logrotate.d/rsyslog diff --git a/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf b/systemvm/patches/debian/etc/modprobe.d/aesni_intel.conf similarity index 100% rename from systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf rename to systemvm/patches/debian/etc/modprobe.d/aesni_intel.conf diff --git a/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf b/systemvm/patches/debian/etc/modprobe.d/pcspkr.conf similarity index 100% rename from systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf rename to systemvm/patches/debian/etc/modprobe.d/pcspkr.conf diff --git a/systemvm/patches/debian/config/etc/profile.d/cloud.sh b/systemvm/patches/debian/etc/profile.d/cloud.sh similarity index 99% rename from systemvm/patches/debian/config/etc/profile.d/cloud.sh rename to systemvm/patches/debian/etc/profile.d/cloud.sh index 844527fb23b..fdc160037c4 100755 --- a/systemvm/patches/debian/config/etc/profile.d/cloud.sh +++ b/systemvm/patches/debian/etc/profile.d/cloud.sh @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - + if [ "`id -u`" -eq 0 ]; then PATH=${PATH}:/opt/cloud/bin diff --git a/systemvm/patches/debian/config/etc/rc.local b/systemvm/patches/debian/etc/rc.local similarity index 100% rename from systemvm/patches/debian/config/etc/rc.local rename to systemvm/patches/debian/etc/rc.local diff --git a/systemvm/patches/debian/config/etc/rsyslog.conf b/systemvm/patches/debian/etc/rsyslog.conf similarity index 100% rename from systemvm/patches/debian/config/etc/rsyslog.conf rename to systemvm/patches/debian/etc/rsyslog.conf diff --git a/systemvm/patches/debian/config/etc/ssh/sshd_config b/systemvm/patches/debian/etc/ssh/sshd_config similarity index 96% rename from systemvm/patches/debian/config/etc/ssh/sshd_config rename to systemvm/patches/debian/etc/ssh/sshd_config index 75f30cc1f36..4931cdb028a 100644 --- a/systemvm/patches/debian/config/etc/ssh/sshd_config +++ b/systemvm/patches/debian/etc/ssh/sshd_config @@ -43,8 +43,8 @@ PermitRootLogin yes #MaxAuthTries 6 #RSAAuthentication yes -#PubkeyAuthentication yes -#AuthorizedKeysFile .ssh/authorized_keys +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no @@ -77,8 +77,8 @@ GSSAPIAuthentication no #GSSAPICleanupCredentials yes GSSAPICleanupCredentials yes -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass @@ -90,8 +90,8 @@ GSSAPICleanupCredentials yes UsePAM yes # Accept locale-related environment variables -AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES -AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT +AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES +AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL #AllowTcpForwarding yes #GatewayPorts no @@ -101,7 +101,7 @@ AcceptEnv LC_IDENTIFICATION LC_ALL #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes -#TCPKeepAlive yes +TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no diff --git a/systemvm/patches/debian/config/etc/sysctl.conf b/systemvm/patches/debian/etc/sysctl.conf similarity index 97% rename from systemvm/patches/debian/config/etc/sysctl.conf rename to systemvm/patches/debian/etc/sysctl.conf index 91baa5d31ed..8e6d7520006 100644 --- a/systemvm/patches/debian/config/etc/sysctl.conf +++ b/systemvm/patches/debian/etc/sysctl.conf @@ -1,4 +1,4 @@ -# Kernel sysctl configuration file +# Kernel sysctl configuration file # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details. diff --git a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf b/systemvm/patches/debian/etc/vpcdnsmasq.conf similarity index 97% rename from systemvm/patches/debian/config/etc/vpcdnsmasq.conf rename to systemvm/patches/debian/etc/vpcdnsmasq.conf index 7c29e65d269..1a4b0c29552 100644 --- a/systemvm/patches/debian/config/etc/vpcdnsmasq.conf +++ b/systemvm/patches/debian/etc/vpcdnsmasq.conf @@ -48,7 +48,7 @@ resolv-file=/etc/dnsmasq-resolv.conf # non-public domains. #server=/localnet/192.168.0.1 -# Example of routing PTR queries to nameservers: this will send all +# Example of routing PTR queries to nameservers: this will send all # address->name queries for 192.168.3/24 to nameserver 10.1.2.3 #server=/3.168.192.in-addr.arpa/10.1.2.3 @@ -186,7 +186,7 @@ expand-hosts # Ignore any clients which are specified in dhcp-host lines # or /etc/ethers. Equivalent to ISC "deny unkown-clients". -# This relies on the special "known" tag which is set when +# This relies on the special "known" tag which is set when # a host is matched. #dhcp-ignore=#known @@ -210,11 +210,11 @@ expand-hosts # Send options to hosts which ask for a DHCP lease. # See RFC 2132 for details of available options. -# Common options can be given to dnsmasq by name: +# Common options can be given to dnsmasq by name: # run "dnsmasq --help dhcp" to get a list. # Note that all the common settings, such as netmask and # broadcast address, DNS server and default route, are given -# sane defaults by dnsmasq. You very likely will not need +# sane defaults by dnsmasq. You very likely will not need # any dhcp-options. If you use Windows clients and Samba, there # are some options which are recommended, they are detailed at the # end of this section. @@ -228,7 +228,7 @@ expand-hosts # Override the default route supplied by dnsmasq and send no default # route at all. Note that this only works for the options sent by -# default (1, 3, 6, 12, 28) the same line will send a zero-length option +# default (1, 3, 6, 12, 28) the same line will send a zero-length option # for all other option numbers. #dhcp-option=3 @@ -279,10 +279,10 @@ dhcp-option=15,"2.vmops-test.vmops.com" # Send RFC-3442 classless static routes (note the netmask encoding) #dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8 -# Send vendor-class specific options encapsulated in DHCP option 43. +# Send vendor-class specific options encapsulated in DHCP option 43. # The meaning of the options is defined by the vendor-class so # options are sent only when the client supplied vendor class -# matches the class given here. (A substring match is OK, so "MSFT" +# matches the class given here. (A substring match is OK, so "MSFT" # matches "MSFT" and "MSFT 5.0"). This example sets the # mtftp address to 0.0.0.0 for PXEClients. #dhcp-option=vendor:PXEClient,1,0.0.0.0 @@ -299,7 +299,7 @@ dhcp-option=vendor:MSFT,2,1i # Send options to PXELinux. Note that we need to send the options even # though they don't appear in the parameter request list, so we need -# to use dhcp-option-force here. +# to use dhcp-option-force here. # See http://syslinux.zytor.com/pxe.php#special for details. # Magic number - needed before anything else is recognised #dhcp-option-force=208,f1:00:74:7e @@ -310,7 +310,7 @@ dhcp-option=vendor:MSFT,2,1i # Reboot time. (Note 'i' to send 32-bit value) #dhcp-option-force=211,30i -# Set the boot filename for BOOTP. You will only need +# Set the boot filename for BOOTP. You will only need # this is you want to boot machines over the network and you will need # a TFTP server; either dnsmasq's built in TFTP server or an # external one. (See below for how to enable the TFTP server.) @@ -353,9 +353,9 @@ leasefile-ro #dhcp-authoritative # Run an executable when a DHCP lease is created or destroyed. -# The arguments sent to the script are "add" or "del", +# The arguments sent to the script are "add" or "del", # then the MAC address, the IP address and finally the hostname -# if there is one. +# if there is one. #dhcp-script=/bin/echo # Set the cachesize here. diff --git a/systemvm/patches/debian/config/opt/cloud/bin/baremetal-vr.py b/systemvm/patches/debian/opt/cloud/bin/baremetal-vr.py similarity index 97% rename from systemvm/patches/debian/config/opt/cloud/bin/baremetal-vr.py rename to systemvm/patches/debian/opt/cloud/bin/baremetal-vr.py index 51ab5822353..e5b6aca51d6 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/baremetal-vr.py +++ b/systemvm/patches/debian/opt/cloud/bin/baremetal-vr.py @@ -1,161 +1,161 @@ -#Licensed to the Apache Software Foundation (ASF) under one -#or more contributor license agreements. See the NOTICE file -#distributed with this work for additional information -#regarding copyright ownership. The ASF licenses this file -#to you under the Apache License, Version 2.0 (the -#"License"); you may not use this file except in compliance -#with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, -#software distributed under the License is distributed on an -#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -#KIND, either express or implied. See the License for the -#specific language governing permissions and limitations -#under the License. - -__author__ = 'frank' - -import subprocess -import urllib -import hmac -import hashlib -import base64 -import traceback -import logging - -from flask import Flask - -app = Flask(__name__) - -logger = logging.getLogger('baremetal-vr') -hdlr = logging.FileHandler('/var/log/baremetal-vr.log') -formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') -hdlr.setFormatter(formatter) -logger.addHandler(hdlr) -logger.setLevel(logging.WARNING) - -class ShellCmd(object): - ''' - classdocs - ''' - def __init__(self, cmd, workdir=None, pipe=True): - ''' - Constructor - ''' - self.cmd = cmd - if pipe: - self.process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, executable='/bin/sh', cwd=workdir) - else: - self.process = subprocess.Popen(cmd, shell=True, executable='/bin/sh', cwd=workdir) - - self.stdout = None - self.stderr = None - self.return_code = None - - def __call__(self, is_exception=True): - (self.stdout, self.stderr) = self.process.communicate() - if is_exception and self.process.returncode != 0: - err = [] - err.append('failed to execute shell command: %s' % self.cmd) - err.append('return code: %s' % self.process.returncode) - err.append('stdout: %s' % self.stdout) - err.append('stderr: %s' % self.stderr) - raise Exception('\n'.join(err)) - - self.return_code = self.process.returncode - return self.stdout - -def shell(cmd): - return ShellCmd(cmd)() - - -class Server(object): - CMDLINE = '/var/cache/cloud/cmdline' - def __init__(self): - self.apikey = None - self.secretkey = None - self.mgmtIp = None - self.mgmtPort = None - - def _get_credentials(self): - if not self.apikey or not self.secretkey: - with open(self.CMDLINE, 'r') as fd: - cmdline = fd.read() - for p in cmdline.split(): - if 'baremetalnotificationsecuritykey' in p: - self.secretkey = p.split("=")[1] - if 'baremetalnotificationapikey' in p: - self.apikey = p.split("=")[1] - - if not self.apikey: - raise Exception('cannot find baremetalnotificationapikey in %s' % Server.CMDLINE) - if not self.secretkey: - raise Exception('cannot find baremetalnotificationsecuritykey in %s' % Server.CMDLINE) - - return self.apikey, self.secretkey - - def _get_mgmt_ip(self): - if not self.mgmtIp: - with open(self.CMDLINE, 'r') as fd: - cmdline = fd.read() - for p in cmdline.split(): - if 'host' in p: - self.mgmtIp = p.split("=")[1] - break - - if not self.mgmtIp: - raise Exception('cannot find host in %s' % Server.CMDLINE) - - return self.mgmtIp - - def _get_mgmt_port(self): - if not self.mgmtPort: - with open(self.CMDLINE, 'r') as fd: - cmdline = fd.read() - for p in cmdline.split(): - if 'port' in p: - self.mgmtPort = p.split("=")[1] - break - - if not self.mgmtIp: - raise Exception('cannot find port in %s' % Server.CMDLINE) - - return self.mgmtPort - - def _make_sign(self, mac): - apikey, secretkey = self._get_credentials() - reqs = { - "apiKey": apikey, - "command": 'notifyBaremetalProvisionDone', - "mac": mac - } - - request = zip(reqs.keys(), reqs.values()) - request.sort(key=lambda x: str.lower(x[0])) - hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request]) - sig = urllib.quote_plus(base64.encodestring(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip()) - return sig - - def notify_provisioning_done(self, mac): - sig = self._make_sign(mac) - cmd = 'http://%s:%s/client/api?command=notifyBaremetalProvisionDone&mac=%s&apiKey=%s&signature=%s' % (self._get_mgmt_ip(), self._get_mgmt_port(), mac, self.apikey, sig) - shell("curl -X GET '%s'" % cmd) - return '' - -server = None - -@app.route('/baremetal/provisiondone/', methods=['GET']) -def notify_provisioning_done(mac): - try: - return server.notify_provisioning_done(mac) - except: - logger.warn(traceback.format_exc()) - return '' - - -if __name__ == '__main__': - server = Server() - shell("iptables-save | grep -- '-A INPUT -i eth0 -p tcp -m tcp --dport 10086 -j ACCEPT' > /dev/null || iptables -I INPUT -i eth0 -p tcp -m tcp --dport 10086 -j ACCEPT") - app.run(host='0.0.0.0', port=10086, debug=True) +#Licensed to the Apache Software Foundation (ASF) under one +#or more contributor license agreements. See the NOTICE file +#distributed with this work for additional information +#regarding copyright ownership. The ASF licenses this file +#to you under the Apache License, Version 2.0 (the +#"License"); you may not use this file except in compliance +#with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, +#software distributed under the License is distributed on an +#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +#KIND, either express or implied. See the License for the +#specific language governing permissions and limitations +#under the License. + +__author__ = 'frank' + +import subprocess +import urllib +import hmac +import hashlib +import base64 +import traceback +import logging + +from flask import Flask + +app = Flask(__name__) + +logger = logging.getLogger('baremetal-vr') +hdlr = logging.FileHandler('/var/log/baremetal-vr.log') +formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') +hdlr.setFormatter(formatter) +logger.addHandler(hdlr) +logger.setLevel(logging.WARNING) + +class ShellCmd(object): + ''' + classdocs + ''' + def __init__(self, cmd, workdir=None, pipe=True): + ''' + Constructor + ''' + self.cmd = cmd + if pipe: + self.process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, executable='/bin/sh', cwd=workdir) + else: + self.process = subprocess.Popen(cmd, shell=True, executable='/bin/sh', cwd=workdir) + + self.stdout = None + self.stderr = None + self.return_code = None + + def __call__(self, is_exception=True): + (self.stdout, self.stderr) = self.process.communicate() + if is_exception and self.process.returncode != 0: + err = [] + err.append('failed to execute shell command: %s' % self.cmd) + err.append('return code: %s' % self.process.returncode) + err.append('stdout: %s' % self.stdout) + err.append('stderr: %s' % self.stderr) + raise Exception('\n'.join(err)) + + self.return_code = self.process.returncode + return self.stdout + +def shell(cmd): + return ShellCmd(cmd)() + + +class Server(object): + CMDLINE = '/var/cache/cloud/cmdline' + def __init__(self): + self.apikey = None + self.secretkey = None + self.mgmtIp = None + self.mgmtPort = None + + def _get_credentials(self): + if not self.apikey or not self.secretkey: + with open(self.CMDLINE, 'r') as fd: + cmdline = fd.read() + for p in cmdline.split(): + if 'baremetalnotificationsecuritykey' in p: + self.secretkey = p.split("=")[1] + if 'baremetalnotificationapikey' in p: + self.apikey = p.split("=")[1] + + if not self.apikey: + raise Exception('cannot find baremetalnotificationapikey in %s' % Server.CMDLINE) + if not self.secretkey: + raise Exception('cannot find baremetalnotificationsecuritykey in %s' % Server.CMDLINE) + + return self.apikey, self.secretkey + + def _get_mgmt_ip(self): + if not self.mgmtIp: + with open(self.CMDLINE, 'r') as fd: + cmdline = fd.read() + for p in cmdline.split(): + if 'host' in p: + self.mgmtIp = p.split("=")[1] + break + + if not self.mgmtIp: + raise Exception('cannot find host in %s' % Server.CMDLINE) + + return self.mgmtIp + + def _get_mgmt_port(self): + if not self.mgmtPort: + with open(self.CMDLINE, 'r') as fd: + cmdline = fd.read() + for p in cmdline.split(): + if 'port' in p: + self.mgmtPort = p.split("=")[1] + break + + if not self.mgmtIp: + raise Exception('cannot find port in %s' % Server.CMDLINE) + + return self.mgmtPort + + def _make_sign(self, mac): + apikey, secretkey = self._get_credentials() + reqs = { + "apiKey": apikey, + "command": 'notifyBaremetalProvisionDone', + "mac": mac + } + + request = zip(reqs.keys(), reqs.values()) + request.sort(key=lambda x: str.lower(x[0])) + hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request]) + sig = urllib.quote_plus(base64.encodestring(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip()) + return sig + + def notify_provisioning_done(self, mac): + sig = self._make_sign(mac) + cmd = 'http://%s:%s/client/api?command=notifyBaremetalProvisionDone&mac=%s&apiKey=%s&signature=%s' % (self._get_mgmt_ip(), self._get_mgmt_port(), mac, self.apikey, sig) + shell("curl -X GET '%s'" % cmd) + return '' + +server = None + +@app.route('/baremetal/provisiondone/', methods=['GET']) +def notify_provisioning_done(mac): + try: + return server.notify_provisioning_done(mac) + except: + logger.warn(traceback.format_exc()) + return '' + + +if __name__ == '__main__': + server = Server() + shell("iptables-save | grep -- '-A INPUT -i eth0 -p tcp -m tcp --dport 10086 -j ACCEPT' > /dev/null || iptables -I INPUT -i eth0 -p tcp -m tcp --dport 10086 -j ACCEPT") + app.run(host='0.0.0.0', port=10086, debug=True) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/baremetal_snat.sh b/systemvm/patches/debian/opt/cloud/bin/baremetal_snat.sh similarity index 98% rename from systemvm/patches/debian/config/opt/cloud/bin/baremetal_snat.sh rename to systemvm/patches/debian/opt/cloud/bin/baremetal_snat.sh index 22e56692d7d..2092ded4e4e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/baremetal_snat.sh +++ b/systemvm/patches/debian/opt/cloud/bin/baremetal_snat.sh @@ -48,7 +48,6 @@ fi rule="-A FORWARD -d $internal_server_ip/32 -i eth0 -o eth1 -j ACCEPT" iptables-save | grep -- "$rule" > /dev/null -if [ $? -ne 0 ]; then +if [ $? -ne 0 ]; then iptables -I FORWARD -d $internal_server_ip/32 -i eth0 -o eth1 -j ACCEPT fi - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/bumpup_priority.sh b/systemvm/patches/debian/opt/cloud/bin/bumpup_priority.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/bumpup_priority.sh rename to systemvm/patches/debian/opt/cloud/bin/bumpup_priority.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checkbatchs2svpn.sh b/systemvm/patches/debian/opt/cloud/bin/checkbatchs2svpn.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/checkbatchs2svpn.sh rename to systemvm/patches/debian/opt/cloud/bin/checkbatchs2svpn.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh b/systemvm/patches/debian/opt/cloud/bin/checkrouter.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh rename to systemvm/patches/debian/opt/cloud/bin/checkrouter.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checks2svpn.sh b/systemvm/patches/debian/opt/cloud/bin/checks2svpn.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/checks2svpn.sh rename to systemvm/patches/debian/opt/cloud/bin/checks2svpn.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cloud-nic.sh b/systemvm/patches/debian/opt/cloud/bin/cloud-nic.sh similarity index 97% rename from systemvm/patches/debian/config/opt/cloud/bin/cloud-nic.sh rename to systemvm/patches/debian/opt/cloud/bin/cloud-nic.sh index 871b789e7e5..ad7e6e5f9f7 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cloud-nic.sh +++ b/systemvm/patches/debian/opt/cloud/bin/cloud-nic.sh @@ -46,7 +46,7 @@ unplug_nic() { rule=$(echo $rule | sed 's/\-A/\-D/') sudo iptables -t mangle $rule done - sudo iptables -t mangle -X VPN_STATS_$dev 2>/dev/null + sudo iptables -t mangle -X VPN_STATS_$dev 2>/dev/null # remove rules on this dev iptables-save -t mangle | grep $dev | grep "\-A" | while read rule do diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/opt/cloud/bin/configure.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/configure.py rename to systemvm/patches/debian/opt/cloud/bin/configure.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsAddress.py similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsAddress.py index 071a7b2ec48..d190a723f0c 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/patches/debian/opt/cloud/bin/cs/CsAddress.py @@ -717,4 +717,3 @@ class CsRpsrfs: if count < 2: logging.debug("Single CPU machine") return count - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsApp.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsApp.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsApp.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsConfig.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsConfig.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsDatabag.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsDatabag.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsDhcp.py similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsDhcp.py index 3c267a0aca1..fbd1e053ce6 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py +++ b/systemvm/patches/debian/opt/cloud/bin/cs/CsDhcp.py @@ -161,4 +161,3 @@ class CsDhcp(CsDataBag): def add_host(self, ip, hosts): self.hosts[ip] = hosts - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsFile.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsFile.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsGuestNetwork.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsGuestNetwork.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsHelper.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsHelper.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsLoadBalancer.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsLoadBalancer.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsLoadBalancer.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsLoadBalancer.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsMonitor.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsMonitor.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsMonitor.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsMonitor.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsNetfilter.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsNetfilter.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsNetfilter.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsNetfilter.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsProcess.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsProcess.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsProcess.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsProcess.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsRedundant.py similarity index 98% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsRedundant.py index f8d2bc25665..99c7458d32e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/patches/debian/opt/cloud/bin/cs/CsRedundant.py @@ -74,8 +74,8 @@ class CsRedundant(object): def _redundant_off(self): CsHelper.service("conntrackd", "stop") CsHelper.service("keepalived", "stop") - CsHelper.umount_tmpfs(self.CS_RAMDISK_DIR) - CsHelper.rmdir(self.CS_RAMDISK_DIR) + #CsHelper.umount_tmpfs(self.CS_RAMDISK_DIR) + #CsHelper.rmdir(self.CS_RAMDISK_DIR) CsHelper.rm(self.CONNTRACKD_CONF) CsHelper.rm(self.KEEPALIVED_CONF) @@ -103,16 +103,16 @@ class CsRedundant(object): if devUp: logging.info("Device %s is present, let's start keepalive now." % dev) isDeviceReady = True - + if not isDeviceReady: logging.info("Guest network not configured yet, let's stop router redundancy for now.") CsHelper.service("conntrackd", "stop") CsHelper.service("keepalived", "stop") return - CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False) - CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR) - CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False) + #CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False) + #CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR) + #CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False) for s in self.CS_TEMPLATES: d = s if s.endswith(".templ"): @@ -150,7 +150,7 @@ class CsRedundant(object): # conntrackd configuration conntrackd_template_conf = "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ") conntrackd_temp_bkp = "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ.bkp") - + CsHelper.copy(conntrackd_template_conf, conntrackd_temp_bkp) conntrackd_tmpl = CsFile(conntrackd_template_conf) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRoute.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsRoute.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsRoute.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsRoute.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRule.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsRule.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsRule.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsRule.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py b/systemvm/patches/debian/opt/cloud/bin/cs/CsStaticRoutes.py similarity index 95% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py rename to systemvm/patches/debian/opt/cloud/bin/cs/CsStaticRoutes.py index 57b259aabc4..df98b2e03ce 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsStaticRoutes.py +++ b/systemvm/patches/debian/opt/cloud/bin/cs/CsStaticRoutes.py @@ -17,8 +17,9 @@ # specific language governing permissions and limitations # under the License. +import logging +import CsHelper from CsDatabag import CsDataBag -from CsRedundant import * class CsStaticRoutes(CsDataBag): @@ -39,4 +40,4 @@ class CsStaticRoutes(CsDataBag): result = CsHelper.execute(command) if not result: route_command = "ip route add %s via %s" % (route['network'], route['gateway']) - CsHelper.execute(route_command) \ No newline at end of file + CsHelper.execute(route_command) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/__init__.py b/systemvm/patches/debian/opt/cloud/bin/cs/__init__.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs/__init__.py rename to systemvm/patches/debian/opt/cloud/bin/cs/__init__.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py b/systemvm/patches/debian/opt/cloud/bin/cs_cmdline.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py rename to systemvm/patches/debian/opt/cloud/bin/cs_cmdline.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py b/systemvm/patches/debian/opt/cloud/bin/cs_dhcp.py similarity index 91% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py rename to systemvm/patches/debian/opt/cloud/bin/cs_dhcp.py index b1fb5934070..04e9b1c8ef8 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py +++ b/systemvm/patches/debian/opt/cloud/bin/cs_dhcp.py @@ -32,8 +32,7 @@ def merge(dbag, data): break if remove_key is not None: del(dbag[remove_key]) - + dbag[data['ipv4_address']] = data return dbag - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_firewallrules.py b/systemvm/patches/debian/opt/cloud/bin/cs_firewallrules.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_firewallrules.py rename to systemvm/patches/debian/opt/cloud/bin/cs_firewallrules.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_forwardingrules.py b/systemvm/patches/debian/opt/cloud/bin/cs_forwardingrules.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_forwardingrules.py rename to systemvm/patches/debian/opt/cloud/bin/cs_forwardingrules.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_guestnetwork.py b/systemvm/patches/debian/opt/cloud/bin/cs_guestnetwork.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_guestnetwork.py rename to systemvm/patches/debian/opt/cloud/bin/cs_guestnetwork.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py b/systemvm/patches/debian/opt/cloud/bin/cs_ip.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py rename to systemvm/patches/debian/opt/cloud/bin/cs_ip.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_loadbalancer.py b/systemvm/patches/debian/opt/cloud/bin/cs_loadbalancer.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_loadbalancer.py rename to systemvm/patches/debian/opt/cloud/bin/cs_loadbalancer.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_monitorservice.py b/systemvm/patches/debian/opt/cloud/bin/cs_monitorservice.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_monitorservice.py rename to systemvm/patches/debian/opt/cloud/bin/cs_monitorservice.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_network_acl.py b/systemvm/patches/debian/opt/cloud/bin/cs_network_acl.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_network_acl.py rename to systemvm/patches/debian/opt/cloud/bin/cs_network_acl.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_remoteaccessvpn.py b/systemvm/patches/debian/opt/cloud/bin/cs_remoteaccessvpn.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_remoteaccessvpn.py rename to systemvm/patches/debian/opt/cloud/bin/cs_remoteaccessvpn.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_site2sitevpn.py b/systemvm/patches/debian/opt/cloud/bin/cs_site2sitevpn.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_site2sitevpn.py rename to systemvm/patches/debian/opt/cloud/bin/cs_site2sitevpn.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py b/systemvm/patches/debian/opt/cloud/bin/cs_staticroutes.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_staticroutes.py rename to systemvm/patches/debian/opt/cloud/bin/cs_staticroutes.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_vmdata.py b/systemvm/patches/debian/opt/cloud/bin/cs_vmdata.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_vmdata.py rename to systemvm/patches/debian/opt/cloud/bin/cs_vmdata.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_vmp.py b/systemvm/patches/debian/opt/cloud/bin/cs_vmp.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_vmp.py rename to systemvm/patches/debian/opt/cloud/bin/cs_vmp.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_vpnusers.py b/systemvm/patches/debian/opt/cloud/bin/cs_vpnusers.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/cs_vpnusers.py rename to systemvm/patches/debian/opt/cloud/bin/cs_vpnusers.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/dnsmasq.sh b/systemvm/patches/debian/opt/cloud/bin/dnsmasq.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/dnsmasq.sh rename to systemvm/patches/debian/opt/cloud/bin/dnsmasq.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh b/systemvm/patches/debian/opt/cloud/bin/edithosts.sh similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh rename to systemvm/patches/debian/opt/cloud/bin/edithosts.sh index ab3f539848d..6f66331c88e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh +++ b/systemvm/patches/debian/opt/cloud/bin/edithosts.sh @@ -17,7 +17,7 @@ # under the License. - + # edithosts.sh -- edit the dhcphosts file on the routing domain usage() { diff --git a/systemvm/patches/debian/config/opt/cloud/bin/getRouterAlerts.sh b/systemvm/patches/debian/opt/cloud/bin/getRouterAlerts.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/getRouterAlerts.sh rename to systemvm/patches/debian/opt/cloud/bin/getRouterAlerts.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/get_template_version.sh b/systemvm/patches/debian/opt/cloud/bin/get_template_version.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/get_template_version.sh rename to systemvm/patches/debian/opt/cloud/bin/get_template_version.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ilb.sh b/systemvm/patches/debian/opt/cloud/bin/ilb.sh similarity index 93% rename from systemvm/patches/debian/config/opt/cloud/bin/ilb.sh rename to systemvm/patches/debian/opt/cloud/bin/ilb.sh index 86c261e89d1..9c762778392 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/ilb.sh +++ b/systemvm/patches/debian/opt/cloud/bin/ilb.sh @@ -34,7 +34,7 @@ usage() { fw_remove_backup() { logger -t cloud "$(basename $0): Entering fw_remove_backup" local lb_vif_list=eth0 - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -F back_load_balancer_$vif 2> /dev/null sudo iptables -D INPUT -i $vif -p tcp -j back_load_balancer_$vif 2> /dev/null sudo iptables -X back_load_balancer_$vif 2> /dev/null @@ -47,7 +47,7 @@ fw_remove_backup() { fw_restore() { logger -t cloud "$(basename $0): Entering fw_restore" local lb_vif_list="eth0" - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -F load_balancer_$vif 2> /dev/null sudo iptables -D INPUT -i $vif -p tcp -j load_balancer_$vif 2> /dev/null sudo iptables -X load_balancer_$vif 2> /dev/null @@ -65,23 +65,23 @@ fw_entry() { local added=$1 local removed=$2 local stats=$3 - + if [ "$added" == "none" ] then - added="" + added="" fi - + if [ "$removed" == "none" ] then - removed="" + removed="" fi - + local a=$(echo $added | cut -d, -f1- --output-delimiter=" ") local r=$(echo $removed | cut -d, -f1- --output-delimiter=" ") -# back up the iptable rules by renaming before creating new. +# back up the iptable rules by renaming before creating new. local lb_vif_list=eth0 - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -E load_balancer_$vif back_load_balancer_$vif 2> /dev/null sudo iptables -N load_balancer_$vif 2> /dev/null sudo iptables -A INPUT -i $vif -p tcp -j load_balancer_$vif @@ -93,21 +93,21 @@ fw_entry() { for i in $a do local pubIp=$(echo $i | cut -d: -f1) - local dport=$(echo $i | cut -d: -f2) + local dport=$(echo $i | cut -d: -f2) local lb_vif_list="eth0" - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -A load_balancer_$vif -p tcp -d $pubIp --dport $dport -j ACCEPT if [ $? -gt 0 ] then return 1 fi - done + done done local pubIp=$(echo $stats | cut -d: -f1) - local dport=$(echo $stats | cut -d: -f2) + local dport=$(echo $stats | cut -d: -f2) local cidrs=$(echo $stats | cut -d: -f3 | sed 's/-/,/') sudo iptables -A lb_stats -s $cidrs -p tcp -m state --state NEW -d $pubIp --dport $dport -j ACCEPT - + return 0 } @@ -123,7 +123,7 @@ restore_lb() { logger -t cloud "Restoring HA Proxy to previous state" # Copy the old version of haproxy.cfg into the file that reconfigLB.sh uses cp /etc/haproxy/haproxy.cfg.old /etc/haproxy/haproxy.cfg.new - + if [ $? -eq 0 ] then # Run reconfigLB.sh again @@ -195,7 +195,7 @@ logger -t cloud "HAProxy reconfigured successfully, configuring firewall" # iptables entry to ensure that haproxy receives traffic fw_entry $addedIps $removedIps $statsIp - + if [ $? -gt 0 ] then logger -t cloud "Failed to apply firewall rules for internal load balancing, reverting HA Proxy config" @@ -211,5 +211,5 @@ else logger -t cloud "Firewall configured successfully, deleting backup firewall config" fw_remove_backup fi - + unlock_exit 0 $lock $locked diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh b/systemvm/patches/debian/opt/cloud/bin/ipassoc.sh similarity index 97% rename from systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh rename to systemvm/patches/debian/opt/cloud/bin/ipassoc.sh index ad50d4e32e9..e2f95a3af11 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh +++ b/systemvm/patches/debian/opt/cloud/bin/ipassoc.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. - + # $Id: ipassoc.sh 9804 2010-06-22 18:36:49Z alex $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/network/domr/ipassoc.sh $ # ipassoc.sh -- associate/disassociate a public ip with an instance @@ -73,7 +73,7 @@ del_fw_chain_for_ip () { logger -t cloud "$(basename $0): destroying firewall chain for $pubIp" sudo iptables -t mangle -D PREROUTING -d $pubIp -j FIREWALL_$pubIp sudo iptables -t mangle -F FIREWALL_$pubIp - sudo iptables -t mangle -X FIREWALL_$pubIp + sudo iptables -t mangle -X FIREWALL_$pubIp return $? fi # firewall chain got created as a result of testing for the chain, cleanup @@ -89,7 +89,7 @@ del_vpn_chain_for_ip () { logger -t cloud "$(basename $0): destroying vpn chain for $pubIp" sudo iptables -t mangle -D PREROUTING -d $pubIp -j VPN_$pubIp sudo iptables -t mangle -F VPN_$pubIp - sudo iptables -t mangle -X VPN_$pubIp + sudo iptables -t mangle -X VPN_$pubIp return $? fi # vpn chain got created as a result of testing for the chain, cleanup @@ -112,7 +112,7 @@ remove_routing() { # rules and routes will be deleted for the last ip of the interface. sudo ip rule delete fwmark $tableNo table $tableName sudo ip rule delete table $tableName - sudo ip route flush table $tableName + sudo ip route flush table $tableName sudo ip route flush cache logger -t cloud "$(basename $0):Remove routing $pubIp - routes and rules deleted" fi @@ -127,10 +127,10 @@ copy_routes_from_main() { local eth1Mask=$(ip route list scope link dev eth1 | awk '{print $1}') local ethMask=$(getcidr $ethDev) -# eth0,eth1 and other know routes will be skipped, so as main routing table will decide the route. This will be useful if the interface is down and up. - sudo ip route add throw $eth0Mask table $tableName proto static - sudo ip route add throw $eth1Mask table $tableName proto static - sudo ip route add throw $ethMask table $tableName proto static +# eth0,eth1 and other know routes will be skipped, so as main routing table will decide the route. This will be useful if the interface is down and up. + sudo ip route add throw $eth0Mask table $tableName proto static + sudo ip route add throw $eth1Mask table $tableName proto static + sudo ip route add throw $ethMask table $tableName proto static return 0; } @@ -168,7 +168,7 @@ add_routing() { local rulePresent=$(ip rule show | grep $ethMask) if [ "$rulePresent" == "" ] then -# rules will be added while adding the first ip of the interface +# rules will be added while adding the first ip of the interface sudo ip rule add from $ethMask table $tableName sudo ip rule add fwmark $tableNo table $tableName logger -t cloud "$(basename $0):Add routing $pubIp rules added" @@ -209,7 +209,7 @@ add_first_ip() { local mask=$(echo $1 | awk -F'/' '{print $2}') sudo ip link show $ethDev | grep "state DOWN" > /dev/null local old_state=$? - + ip_addr_add $ethDev $pubIp sudo iptables -D FORWARD -i $ethDev -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT @@ -255,7 +255,7 @@ remove_first_ip() { sudo iptables -D FORWARD -i $ethDev -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -D FORWARD -i eth0 -o $ethDev -j FW_OUTBOUND remove_snat $1 - + sudo ip addr del dev $ethDev "$ipNoMask/$mask" if [ $? -gt 0 -a $? -ne 2 ] then @@ -297,7 +297,7 @@ add_an_ip () { fi add_routing $1 return $? - + } remove_an_ip () { @@ -394,11 +394,11 @@ do publicIp="$OPTARG" ;; c) cflag=1 - ethDev="$OPTARG" - ;; + ethDev="$OPTARG" + ;; g) gflag=1 - defaultGwIP="$OPTARG" - ;; + defaultGwIP="$OPTARG" + ;; n) nflag=1 ;; ?) usage @@ -414,7 +414,7 @@ then unlock_exit 2 $lock $locked fi -if [ "$lflag$cflag" != "11" ] +if [ "$lflag$cflag" != "11" ] then usage unlock_exit 2 $lock $locked @@ -432,14 +432,14 @@ if [ "$fflag" == "1" ] && [ "$Aflag" == "1" ] then add_first_ip $publicIp && add_vpn_chain_for_ip $publicIp && - add_fw_chain_for_ip $publicIp + add_fw_chain_for_ip $publicIp unlock_exit $? $lock $locked fi if [ "$Aflag" == "1" ] -then +then add_an_ip $publicIp && - add_fw_chain_for_ip $publicIp + add_fw_chain_for_ip $publicIp unlock_exit $? $lock $locked fi @@ -454,9 +454,8 @@ fi if [ "$Dflag" == "1" ] then remove_an_ip $publicIp && - del_fw_chain_for_ip $publicIp + del_fw_chain_for_ip $publicIp unlock_exit $? $lock $locked fi unlock_exit 0 $lock $locked - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ipsectunnel.sh b/systemvm/patches/debian/opt/cloud/bin/ipsectunnel.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/ipsectunnel.sh rename to systemvm/patches/debian/opt/cloud/bin/ipsectunnel.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/line_edit.py b/systemvm/patches/debian/opt/cloud/bin/line_edit.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/line_edit.py rename to systemvm/patches/debian/opt/cloud/bin/line_edit.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/loadbalancer.sh b/systemvm/patches/debian/opt/cloud/bin/loadbalancer.sh similarity index 92% rename from systemvm/patches/debian/config/opt/cloud/bin/loadbalancer.sh rename to systemvm/patches/debian/opt/cloud/bin/loadbalancer.sh index e22bf94f0c7..34b3bf72543 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/loadbalancer.sh +++ b/systemvm/patches/debian/opt/cloud/bin/loadbalancer.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. - + # $Id: loadbalancer.sh 9947 2010-06-25 19:34:24Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/patches/xenserver/root/loadbalancer.sh $ # loadbalancer.sh -- reconfigure loadbalancer rules @@ -41,40 +41,40 @@ usage() { ip_entry() { local added=$1 local removed=$2 - + if [ "$added" == "none" ] then - added="" + added="" fi - + if [ "$removed" == "none" ] then - removed="" + removed="" fi - + local a=$(echo $added | cut -d, -f1- --output-delimiter=" ") local r=$(echo $removed | cut -d, -f1- --output-delimiter=" ") - + for i in $a do local pubIp=$(echo $i | cut -d: -f1) - logger -t cloud "Adding public ip $pubIp for load balancing" - for vif in $VIF_LIST; do + logger -t cloud "Adding public ip $pubIp for load balancing" + for vif in $VIF_LIST; do sudo ip addr add dev $vif $pubIp/32 #ignore error since it is because the ip is already there - done + done done for i in $r do - logger -t cloud "Removing public ips for deleted loadbalancers" + logger -t cloud "Removing public ips for deleted loadbalancers" local pubIp=$(echo $i | cut -d: -f1) - logger -t cloud "Removing public ip $pubIp for deleted loadbalancers" - for vif in $VIF_LIST; do - sudo ip addr del $pubIp/32 dev $vif + logger -t cloud "Removing public ip $pubIp for deleted loadbalancers" + for vif in $VIF_LIST; do + sudo ip addr del $pubIp/32 dev $vif done done - + return 0 } get_lb_vif_list() { @@ -85,7 +85,7 @@ get_lb_vif_list() { } fw_remove_backup() { local lb_vif_list=$(get_lb_vif_list) - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -F back_load_balancer_$vif 2> /dev/null sudo iptables -D INPUT -i $vif -p tcp -j back_load_balancer_$vif 2> /dev/null sudo iptables -X back_load_balancer_$vif 2> /dev/null @@ -96,7 +96,7 @@ fw_remove_backup() { } fw_restore() { local lb_vif_list=$(get_lb_vif_list) - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -F load_balancer_$vif 2> /dev/null sudo iptables -D INPUT -i $vif -p tcp -j load_balancer_$vif 2> /dev/null sudo iptables -X load_balancer_$vif 2> /dev/null @@ -112,23 +112,23 @@ fw_entry() { local added=$1 local removed=$2 local stats=$3 - + if [ "$added" == "none" ] then - added="" + added="" fi - + if [ "$removed" == "none" ] then - removed="" + removed="" fi - + local a=$(echo $added | cut -d, -f1- --output-delimiter=" ") local r=$(echo $removed | cut -d, -f1- --output-delimiter=" ") -# back up the iptable rules by renaming before creating new. +# back up the iptable rules by renaming before creating new. local lb_vif_list=$(get_lb_vif_list) - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do sudo iptables -E load_balancer_$vif back_load_balancer_$vif 2> /dev/null sudo iptables -N load_balancer_$vif 2> /dev/null sudo iptables -A INPUT -i $vif -p tcp -j load_balancer_$vif @@ -140,38 +140,38 @@ fw_entry() { for i in $a do local pubIp=$(echo $i | cut -d: -f1) - local dport=$(echo $i | cut -d: -f2) + local dport=$(echo $i | cut -d: -f2) local lb_vif_list=$(get_lb_vif_list) - for vif in $lb_vif_list; do + for vif in $lb_vif_list; do #TODO : The below delete will be used only when we upgrade the from older verion to the newer one , the below delete become obsolute in the future. sudo iptables -D INPUT -i $vif -p tcp -d $pubIp --dport $dport -j ACCEPT 2> /dev/null sudo iptables -A load_balancer_$vif -p tcp -d $pubIp --dport $dport -j ACCEPT - + if [ $? -gt 0 ] then return 1 fi - done + done done local pubIp=$(echo $stats | cut -d: -f1) - local dport=$(echo $stats | cut -d: -f2) + local dport=$(echo $stats | cut -d: -f2) local cidrs=$(echo $stats | cut -d: -f3 | sed 's/-/,/') sudo iptables -A lb_stats -s $cidrs -p tcp -m state --state NEW -d $pubIp --dport $dport -j ACCEPT - + #TODO : The below delete in the for-loop will be used only when we upgrade the from older verion to the newer one , the below delete become obsolute in the future. for i in $r do local pubIp=$(echo $i | cut -d: -f1) - local dport=$(echo $i | cut -d: -f2) - - for vif in $VIF_LIST; do + local dport=$(echo $i | cut -d: -f2) + + for vif in $VIF_LIST; do sudo iptables -D INPUT -i $vif -p tcp -d $pubIp --dport $dport -j ACCEPT 2> /dev/null done done - + return 0 } @@ -187,7 +187,7 @@ restore_lb() { logger -t cloud "Restoring HA Proxy to previous state" # Copy the old version of haproxy.cfg into the file that reconfigLB.sh uses cp /etc/haproxy/haproxy.cfg.old /etc/haproxy/haproxy.cfg.new - + if [ $? -eq 0 ] then # Run reconfigLB.sh again @@ -197,7 +197,7 @@ restore_lb() { get_vif_list() { local vif_list="" - for i in /sys/class/net/eth*; do + for i in /sys/class/net/eth*; do vif=$(basename $i); if [ "$vif" != "eth0" ] && [ "$vif" != "eth1" ] then @@ -208,7 +208,7 @@ get_vif_list() { then vif_list="eth0" fi - + logger -t cloud "Loadbalancer public interfaces = $vif_list" echo $vif_list } @@ -290,7 +290,7 @@ fi # iptables entry to ensure that haproxy receives traffic fw_entry $addedIps $removedIps $statsIp - + if [ $? -gt 0 ] then logger -t cloud "Failed to apply firewall rules for load balancing, reverting HA Proxy config" @@ -313,7 +313,5 @@ else # Remove backedup iptable rules fw_remove_backup fi - -unlock_exit 0 $lock $locked - +unlock_exit 0 $lock $locked diff --git a/systemvm/patches/debian/config/opt/cloud/bin/master.py b/systemvm/patches/debian/opt/cloud/bin/master.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/master.py rename to systemvm/patches/debian/opt/cloud/bin/master.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/merge.py b/systemvm/patches/debian/opt/cloud/bin/merge.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/merge.py rename to systemvm/patches/debian/opt/cloud/bin/merge.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh b/systemvm/patches/debian/opt/cloud/bin/monitor_service.sh similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh rename to systemvm/patches/debian/opt/cloud/bin/monitor_service.sh index dfc6463bab1..d9d8ec843ae 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh +++ b/systemvm/patches/debian/opt/cloud/bin/monitor_service.sh @@ -91,4 +91,3 @@ fi unlock_exit 0 $lock $locked - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/netusage.sh b/systemvm/patches/debian/opt/cloud/bin/netusage.sh similarity index 92% rename from systemvm/patches/debian/config/opt/cloud/bin/netusage.sh rename to systemvm/patches/debian/opt/cloud/bin/netusage.sh index 3cf808e5fcb..5e20b0c4d9e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/netusage.sh +++ b/systemvm/patches/debian/opt/cloud/bin/netusage.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. - + # netusage.sh -- create iptable rules to gather network stats, running within DomR @@ -121,35 +121,34 @@ do esac done -if [ "$cflag" == "1" ] +if [ "$cflag" == "1" ] then - #create_usage_rules + #create_usage_rules unlock_exit $? $lock $locked fi -if [ "$gflag" == "1" ] +if [ "$gflag" == "1" ] then - get_usage + get_usage unlock_exit $? $lock $locked fi -if [ "$rflag" == "1" ] +if [ "$rflag" == "1" ] then - reset_usage + reset_usage unlock_exit $? $lock $locked fi -if [ "$aflag" == "1" ] +if [ "$aflag" == "1" ] then - #add_public_interface $publicIf + #add_public_interface $publicIf unlock_exit $? $lock $locked fi -if [ "$dflag" == "1" ] +if [ "$dflag" == "1" ] then - #delete_public_interface $publicIf + #delete_public_interface $publicIf unlock_exit $? $lock $locked fi unlock_exit 0 $lock $locked - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/passwd_server b/systemvm/patches/debian/opt/cloud/bin/passwd_server similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/passwd_server rename to systemvm/patches/debian/opt/cloud/bin/passwd_server diff --git a/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip b/systemvm/patches/debian/opt/cloud/bin/passwd_server_ip similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip rename to systemvm/patches/debian/opt/cloud/bin/passwd_server_ip diff --git a/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py b/systemvm/patches/debian/opt/cloud/bin/passwd_server_ip.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py rename to systemvm/patches/debian/opt/cloud/bin/passwd_server_ip.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/prepare_pxe.sh b/systemvm/patches/debian/opt/cloud/bin/prepare_pxe.sh similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/prepare_pxe.sh rename to systemvm/patches/debian/opt/cloud/bin/prepare_pxe.sh index 5bc1a9380dc..9c4c18eda7b 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/prepare_pxe.sh +++ b/systemvm/patches/debian/opt/cloud/bin/prepare_pxe.sh @@ -7,9 +7,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -73,5 +73,3 @@ cp -f $mnt_path/$initrd_file_name $tmpt_dir/$initrd_file_name umount $mnt_path success - - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh b/systemvm/patches/debian/opt/cloud/bin/savepassword.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh rename to systemvm/patches/debian/opt/cloud/bin/savepassword.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/set_redundant.py b/systemvm/patches/debian/opt/cloud/bin/set_redundant.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/set_redundant.py rename to systemvm/patches/debian/opt/cloud/bin/set_redundant.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh b/systemvm/patches/debian/opt/cloud/bin/setup/common.sh similarity index 92% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/common.sh index 3b766efc389..e476745a4e1 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/setup/common.sh +++ b/systemvm/patches/debian/opt/cloud/bin/setup/common.sh @@ -621,57 +621,48 @@ setup_redundant_router() { mount tmpfs /ramdisk -t tmpfs mkdir -p /ramdisk/rrouter ip route delete default - cp /root/redundant_router/keepalived.conf.templ /etc/keepalived/keepalived.conf - cp /root/redundant_router/conntrackd.conf.templ /etc/conntrackd/conntrackd.conf - cp /root/redundant_router/enable_pubip.sh.templ $rrouter_bin_path/enable_pubip.sh - cp /root/redundant_router/master.sh.templ $rrouter_bin_path/master.sh - cp /root/redundant_router/backup.sh.templ $rrouter_bin_path/backup.sh - cp /root/redundant_router/fault.sh.templ $rrouter_bin_path/fault.sh - cp /root/redundant_router/primary-backup.sh.templ $rrouter_bin_path/primary-backup.sh - cp /root/redundant_router/heartbeat.sh.templ $rrouter_bin_path/heartbeat.sh - cp /root/redundant_router/check_heartbeat.sh.templ $rrouter_bin_path/check_heartbeat.sh - cp /root/redundant_router/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh - cp /root/redundant_router/check_bumpup.sh $rrouter_bin_path/ - cp /root/redundant_router/disable_pubip.sh $rrouter_bin_path/ - cp /root/redundant_router/checkrouter.sh.templ /opt/cloud/bin/checkrouter.sh - cp /root/redundant_router/services.sh $rrouter_bin_path/ + + # Seed keepalived + cp /opt/cloud/templates/keepalived.conf.templ /etc/keepalived/keepalived.conf # changes! sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf - sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf + sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf #fixme, multiple ips? sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf sed -i "s/\[PRIORITY\]/$ROUTER_PR/g" /etc/keepalived/keepalived.conf + sed -i "s/\[PASS\]/$VM_PASSWORD/g" /etc/keepalived/keepalived.conf #FIXME, router password? sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" /etc/keepalived/keepalived.conf sed -i "s/\[DELTA\]/2/g" /etc/keepalived/keepalived.conf - sed -i "s/\[LINK_IF\]/eth0/g" /etc/conntrackd/conntrackd.conf - sed -i "s/\[LINK_IP\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf - sed -i "s/\[IGNORE_IP1\]/$GUEST_GW/g" /etc/conntrackd/conntrackd.conf - sed -i "s/\[IGNORE_IP2\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf - sed -i "s/\[IGNORE_IP3\]/$ETH1_IP/g" /etc/conntrackd/conntrackd.conf - sed -i "s/\[ETH2IP\]/$ETH2_IP/g" $rrouter_bin_path/enable_pubip.sh - sed -i "s/\[ETH2MASK\]/$ETH2_MASK/g" $rrouter_bin_path/enable_pubip.sh - sed -i "s/\[GATEWAY\]/$GW/g" $rrouter_bin_path/enable_pubip.sh - sed -i "s/\[GATEWAY\]/$GW/g" $rrouter_bin_path/master.sh - sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/master.sh - sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/backup.sh - sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/fault.sh - sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/heartbeat.sh - sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/check_heartbeat.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/master.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/backup.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/fault.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /opt/cloud/bin/checkrouter.sh + sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived if [ $ADVERT_INT ] then sed -i "s/advert_int 1/advert_int $ADVERT_INT/g" /etc/keepalived/keepalived.conf fi + + # Seed conntrackd + cp /opt/cloud/templates/conntrackd.conf.templ /etc/conntrackd/conntrackd.conf + sed -i "s/\[LINK_IF\]/eth0/g" /etc/conntrackd/conntrackd.conf + sed -i "s/\[LINK_IP\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf + sed -i "s/\[IGNORE_IP1\]/$GUEST_GW/g" /etc/conntrackd/conntrackd.conf # checkme? + sed -i "s/\[IGNORE_IP2\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf + sed -i "s/\[IGNORE_IP3\]/$ETH1_IP/g" /etc/conntrackd/conntrackd.conf + + # ramdisk scripts + cp /opt/cloud/templates/heartbeat.sh.templ $rrouter_bin_path/heartbeat.sh + cp /opt/cloud/templates/check_heartbeat.sh.templ $rrouter_bin_path/check_heartbeat.sh + cp /opt/cloud/templates/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh + cp /opt/cloud/templates/check_bumpup.sh $rrouter_bin_path/ + cp /opt/cloud/templates/checkrouter.sh.templ /opt/cloud/bin/checkrouter.sh # changes! + #sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /opt/cloud/bin/checkrouter.sh + + sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/heartbeat.sh + sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/check_heartbeat.sh + sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh + sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh chmod a+x $rrouter_bin_path/*.sh - sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived + crontab -l|grep "check_heartbeat.sh" if [ $? -ne 0 ] then - (crontab -l; echo -e "SHELL=/bin/bash\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n*/1 * * * * $rrouter_bin_path/check_heartbeat.sh 2>&1 > /dev/null") | crontab + (crontab -l; echo -e "SHELL=/bin/bash\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n* * * * * $rrouter_bin_path/check_heartbeat.sh 2>&1 > /dev/null") | crontab fi } diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh b/systemvm/patches/debian/opt/cloud/bin/setup/consoleproxy.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/consoleproxy.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/consoleproxy.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/default.sh b/systemvm/patches/debian/opt/cloud/bin/setup/default.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/default.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/default.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/dhcpsrvr.sh b/systemvm/patches/debian/opt/cloud/bin/setup/dhcpsrvr.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/dhcpsrvr.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/dhcpsrvr.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/elbvm.sh b/systemvm/patches/debian/opt/cloud/bin/setup/elbvm.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/elbvm.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/elbvm.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/ilbvm.sh b/systemvm/patches/debian/opt/cloud/bin/setup/ilbvm.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/ilbvm.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/ilbvm.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/patchsystemvm.sh b/systemvm/patches/debian/opt/cloud/bin/setup/patchsystemvm.sh similarity index 95% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/patchsystemvm.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/patchsystemvm.sh index 43c3c927e4f..d09cc03c949 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/setup/patchsystemvm.sh +++ b/systemvm/patches/debian/opt/cloud/bin/setup/patchsystemvm.sh @@ -46,9 +46,9 @@ TYPE=$2 echo "Patching systemvm for cloud service with mount=$PATCH_MOUNT for type=$TYPE" >> $logfile -if [ "$TYPE" == "consoleproxy" ] || [ "$TYPE" == "secstorage" ] && [ -f ${PATCH_MOUNT}/systemvm.zip ] +if [ "$TYPE" == "consoleproxy" ] || [ "$TYPE" == "secstorage" ] && [ -f ${PATCH_MOUNT}/agent.zip ] then - patch_systemvm ${PATCH_MOUNT}/systemvm.zip + patch_systemvm ${PATCH_MOUNT}/agent.zip if [ $? -gt 0 ] then echo "Failed to apply patch systemvm\n" >> $logfile diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/router.sh b/systemvm/patches/debian/opt/cloud/bin/setup/router.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/router.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/router.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh b/systemvm/patches/debian/opt/cloud/bin/setup/secstorage.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/secstorage.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/secstorage.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/setup/vpcrouter.sh b/systemvm/patches/debian/opt/cloud/bin/setup/vpcrouter.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/setup/vpcrouter.sh rename to systemvm/patches/debian/opt/cloud/bin/setup/vpcrouter.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py b/systemvm/patches/debian/opt/cloud/bin/update_config.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/update_config.py rename to systemvm/patches/debian/opt/cloud/bin/update_config.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vmdata.py b/systemvm/patches/debian/opt/cloud/bin/vmdata.py similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/vmdata.py rename to systemvm/patches/debian/opt/cloud/bin/vmdata.py diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_func.sh b/systemvm/patches/debian/opt/cloud/bin/vpc_func.sh similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/vpc_func.sh rename to systemvm/patches/debian/opt/cloud/bin/vpc_func.sh index 2f8835120e4..8edcba6fd12 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/vpc_func.sh +++ b/systemvm/patches/debian/opt/cloud/bin/vpc_func.sh @@ -30,7 +30,7 @@ getEthByIp (){ fi done return 1 -} +} getVPCcidr () { CMDLINE=$(cat /var/cache/cloud/cmdline) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_netusage.sh b/systemvm/patches/debian/opt/cloud/bin/vpc_netusage.sh similarity index 93% rename from systemvm/patches/debian/config/opt/cloud/bin/vpc_netusage.sh rename to systemvm/patches/debian/opt/cloud/bin/vpc_netusage.sh index 7aa75cbdfbf..5f5dc3ed080 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/vpc_netusage.sh +++ b/systemvm/patches/debian/opt/cloud/bin/vpc_netusage.sh @@ -35,19 +35,19 @@ usage() { create_usage_rules () { iptables-save|grep "NETWORK_STATS_$ethDev" > /dev/null if [ $? -gt 0 ] - then + then iptables -N NETWORK_STATS_$ethDev > /dev/null; iptables -I FORWARD -j NETWORK_STATS_$ethDev > /dev/null; iptables -A NETWORK_STATS_$ethDev -o $ethDev -s $vcidr > /dev/null; iptables -A NETWORK_STATS_$ethDev -i $ethDev -d $vcidr > /dev/null; - fi + fi return $? } create_vpn_usage_rules () { iptables-save|grep "VPN_STATS_$ethDev" > /dev/null if [ $? -gt 0 ] - then + then iptables -t mangle -N VPN_STATS_$ethDev > /dev/null; iptables -t mangle -I FORWARD -j VPN_STATS_$ethDev > /dev/null; iptables -t mangle -A VPN_STATS_$ethDev -o $ethDev -m mark --mark $vpnoutmark > /dev/null; @@ -110,7 +110,7 @@ do n) nflag=1 ;; d) dflag=1 - ;; + ;; i) #Do nothing, since it's parameter for host script ;; ?) usage @@ -120,37 +120,37 @@ do done ethDev=$(getEthByIp $publicIp) -if [ "$cflag" == "1" ] +if [ "$cflag" == "1" ] then if [ "$ethDev" != "" ] then create_usage_rules create_vpn_usage_rules unlock_exit 0 $lock $locked - fi + fi fi -if [ "$gflag" == "1" ] +if [ "$gflag" == "1" ] then - get_usage + get_usage unlock_exit $? $lock $locked fi -if [ "$nflag" == "1" ] +if [ "$nflag" == "1" ] then - #get_vpn_usage + #get_vpn_usage unlock_exit $? $lock $locked fi -if [ "$dflag" == "1" ] +if [ "$dflag" == "1" ] then #remove_usage_rules unlock_exit 0 $lock $locked fi -if [ "$rflag" == "1" ] +if [ "$rflag" == "1" ] then - reset_usage + reset_usage unlock_exit $? $lock $locked fi diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_passwd_server b/systemvm/patches/debian/opt/cloud/bin/vpc_passwd_server similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/vpc_passwd_server rename to systemvm/patches/debian/opt/cloud/bin/vpc_passwd_server diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_snat.sh b/systemvm/patches/debian/opt/cloud/bin/vpc_snat.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/vpc_snat.sh rename to systemvm/patches/debian/opt/cloud/bin/vpc_snat.sh diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_staticroute.sh b/systemvm/patches/debian/opt/cloud/bin/vpc_staticroute.sh similarity index 97% rename from systemvm/patches/debian/config/opt/cloud/bin/vpc_staticroute.sh rename to systemvm/patches/debian/opt/cloud/bin/vpc_staticroute.sh index 2a9f50a27cd..4721f5d882e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/vpc_staticroute.sh +++ b/systemvm/patches/debian/opt/cloud/bin/vpc_staticroute.sh @@ -72,7 +72,7 @@ static_route() { local gateway=$(echo $rule | cut -d: -f2) local cidr=$(echo $rule | cut -d: -f3) logger -t cloud "$(basename $0): static route: public ip=$ip \ - gateway=$gateway cidr=$cidr" + gateway=$gateway cidr=$cidr" local dev=$(getEthByIp $ip) if [ $? -gt 0 ] then @@ -81,7 +81,7 @@ static_route() { sudo ip route add $cidr dev $dev via $gateway table static_route &>/dev/null result=$? logger -t cloud "$(basename $0): done static route: public ip=$ip \ - gateway=$gateway cidr=$cidr" + gateway=$gateway cidr=$cidr" return $result } @@ -131,4 +131,3 @@ else flush_table_backup fi unlock_exit $success $lock $locked - diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh b/systemvm/patches/debian/opt/cloud/bin/vr_cfg.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh rename to systemvm/patches/debian/opt/cloud/bin/vr_cfg.sh diff --git a/systemvm/patches/debian/opt/cloud/templates/README b/systemvm/patches/debian/opt/cloud/templates/README new file mode 100644 index 00000000000..8d7df47cbad --- /dev/null +++ b/systemvm/patches/debian/opt/cloud/templates/README @@ -0,0 +1,2 @@ +These are the templates for the redundant router +and redundant vpc_router diff --git a/systemvm/patches/debian/config/opt/cloud/templates/arping_gateways.sh.templ b/systemvm/patches/debian/opt/cloud/templates/arping_gateways.sh.templ similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/templates/arping_gateways.sh.templ rename to systemvm/patches/debian/opt/cloud/templates/arping_gateways.sh.templ diff --git a/systemvm/patches/debian/config/opt/cloud/templates/check_bumpup.sh b/systemvm/patches/debian/opt/cloud/templates/check_bumpup.sh similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/templates/check_bumpup.sh rename to systemvm/patches/debian/opt/cloud/templates/check_bumpup.sh diff --git a/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ b/systemvm/patches/debian/opt/cloud/templates/check_heartbeat.sh.templ similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ rename to systemvm/patches/debian/opt/cloud/templates/check_heartbeat.sh.templ index a9cbf308119..2ab9abaa8a4 100755 --- a/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ +++ b/systemvm/patches/debian/opt/cloud/templates/check_heartbeat.sh.templ @@ -52,7 +52,7 @@ then #Set fault so we have the same effect as a KeepaliveD fault. python /opt/cloud/bin/master.py --fault - + pkill -9 keepalived >> $ROUTER_LOG 2>&1 pkill -9 conntrackd >> $ROUTER_LOG 2>&1 echo Status: FAULT \(keepalived process is dead\) >> $ROUTER_LOG diff --git a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ b/systemvm/patches/debian/opt/cloud/templates/checkrouter.sh.templ similarity index 98% rename from systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ rename to systemvm/patches/debian/opt/cloud/templates/checkrouter.sh.templ index 0ba0ee5013b..fcfc58d5b95 100755 --- a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ +++ b/systemvm/patches/debian/opt/cloud/templates/checkrouter.sh.templ @@ -34,4 +34,4 @@ else fi fi -echo "Status: ${STATUS}" \ No newline at end of file +echo "Status: ${STATUS}" diff --git a/systemvm/patches/debian/config/opt/cloud/templates/conntrackd.conf.templ b/systemvm/patches/debian/opt/cloud/templates/conntrackd.conf.templ similarity index 96% rename from systemvm/patches/debian/config/opt/cloud/templates/conntrackd.conf.templ rename to systemvm/patches/debian/opt/cloud/templates/conntrackd.conf.templ index 40f92a0d1c3..3e38af1b7d5 100644 --- a/systemvm/patches/debian/config/opt/cloud/templates/conntrackd.conf.templ +++ b/systemvm/patches/debian/opt/cloud/templates/conntrackd.conf.templ @@ -45,7 +45,7 @@ Sync { # # If the firewall replica goes from primary to backup, - # the conntrackd -t command is invoked in the script. + # the conntrackd -t command is invoked in the script. # This command schedules a flush of the table in N seconds. # This is useful to purge the connection tracking table of # zombie entries and avoid clashes with old entries if you @@ -90,7 +90,7 @@ Sync { # iptables -I OUTPUT -d 225.0.0.50 -j ACCEPT # Multicast { - # + # # Multicast address: The address that you use as destination # in the synchronization messages. You do not have to add # this IP to any of your existing interfaces. If any doubt, @@ -141,7 +141,7 @@ Sync { # RcvSocketBuffer 1249280 - # + # # Enable/Disable message checksumming. This is a good # property to achieve fault-tolerance. In case of doubt, do # not modify this value. @@ -154,8 +154,8 @@ Sync { # more than one dedicated link does not mean that state-updates will # be sent to all of them. There is only one active dedicated link at # a given moment. The `Default' keyword indicates that this interface - # will be selected as the initial dedicated link. You can have - # up to 4 redundant dedicated links. Note: Use different multicast + # will be selected as the initial dedicated link. You can have + # up to 4 redundant dedicated links. Note: Use different multicast # groups for every redundant link. # # Multicast Default { @@ -172,9 +172,9 @@ Sync { # You can use Unicast UDP instead of Multicast to propagate events. # Note that you cannot use unicast UDP and Multicast at the same # time, you can only select one. - # + # # UDP { - # + # # UDP address that this firewall uses to listen to events. # # IPv4_address 192.168.2.100 @@ -204,7 +204,7 @@ Sync { # # Interface eth2 - # + # # The sender socket buffer size # # SndSocketBuffer 1249280 @@ -214,8 +214,8 @@ Sync { # # RcvSocketBuffer 1249280 - # - # Enable/Disable message checksumming. + # + # Enable/Disable message checksumming. # # Checksum on # } @@ -255,7 +255,7 @@ General { HashSize 32768 # - # Maximum number of conntracks, it should be double of: + # Maximum number of conntracks, it should be double of: # $ cat /proc/sys/net/netfilter/nf_conntrack_max # since the daemon may keep some dead entries cached for possible # retransmission during state synchronization. @@ -276,7 +276,7 @@ General { # # Lockfile - # + # LockFile /var/lock/conntrack.lock # @@ -326,7 +326,7 @@ General { # # NetlinkEventsReliable Off - # + # # By default, the daemon receives state updates following an # event-driven model. You can modify this behaviour by switching to # polling mode with the PollSecs clause. This clause tells conntrackd @@ -355,13 +355,13 @@ General { # State. The filter is attached to an action that can be: Accept or # Ignore. Thus, you can define the event filtering policy of the # filter-sets in positive or negative logic depending on your needs. - # You can select if conntrackd filters the event messages from + # You can select if conntrackd filters the event messages from # user-space or kernel-space. The kernel-space event filtering # saves some CPU cycles by avoiding the copy of the event message # from kernel-space to user-space. The kernel-space event filtering # is prefered, however, you require a Linux kernel >= 2.6.29 to - # filter from kernel-space. If you want to select kernel-space - # event filtering, use the keyword 'Kernelspace' instead of + # filter from kernel-space. If you want to select kernel-space + # event filtering, use the keyword 'Kernelspace' instead of # 'Userspace'. # Filter From Userspace { @@ -405,7 +405,7 @@ General { # # Uncomment this line below if you want to filter by flow state. # This option introduces a trade-off in the replication: it - # reduces CPU consumption at the cost of having lazy backup + # reduces CPU consumption at the cost of having lazy backup # firewall replicas. The existing TCP states are: SYN_SENT, # SYN_RECV, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, LAST_ACK, # TIME_WAIT, CLOSED, LISTEN. diff --git a/systemvm/patches/debian/config/opt/cloud/templates/heartbeat.sh.templ b/systemvm/patches/debian/opt/cloud/templates/heartbeat.sh.templ similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/templates/heartbeat.sh.templ rename to systemvm/patches/debian/opt/cloud/templates/heartbeat.sh.templ diff --git a/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ b/systemvm/patches/debian/opt/cloud/templates/keepalived.conf.templ similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ rename to systemvm/patches/debian/opt/cloud/templates/keepalived.conf.templ index c8439391423..d14611d895a 100644 --- a/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ +++ b/systemvm/patches/debian/opt/cloud/templates/keepalived.conf.templ @@ -48,4 +48,4 @@ vrrp_instance inside_network { notify_backup "/opt/cloud/bin/master.py --backup" notify_master "/opt/cloud/bin/master.py --master" notify_fault "/opt/cloud/bin/master.py --fault" -} \ No newline at end of file +} diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/README b/systemvm/patches/debian/opt/cloud/testdata/README similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/README rename to systemvm/patches/debian/opt/cloud/testdata/README diff --git a/systemvm/patches/debian/opt/cloud/testdata/acl0001.json b/systemvm/patches/debian/opt/cloud/testdata/acl0001.json new file mode 100644 index 00000000000..ee068dc949f --- /dev/null +++ b/systemvm/patches/debian/opt/cloud/testdata/acl0001.json @@ -0,0 +1,54 @@ +{ + "eth2": { + "device": "eth2", + "egress_rules": [ + { + "allowed": false, + "cidr": "10.0.6.0/8", + "first_port": 60, + "last_port": 60, + "type": "tcp" + } + ], + "ingress_rules": [ + { + "allowed": true, + "cidr": "10.0.1.0/8", + "protocol": 41, + "type": "protocol" + }, + { + "allowed": true, + "cidr": "10.0.4.0/8", + "type": "all" + }, + { + "allowed": true, + "cidr": "10.0.3.0/8", + "icmp_code": -1, + "icmp_type": -1, + "type": "icmp" + }, + { + "allowed": true, + "cidr": "10.0.2.0/8", + "first_port": 40, + "last_port": 40, + "type": "udp" + }, + { + "allowed": true, + "cidr": "10.0.1.0/8", + "first_port": 30, + "last_port": 30, + "type": "tcp" + } + ], + "mac_address": "02:00:0d:7b:00:04", + "nic_ip": "172.16.1.1", + "nic_netmask": "24", + "private_gateway_acl": false, + "type": "networkacl" + }, + "id": "networkacl" +} diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/dhcp0001.json b/systemvm/patches/debian/opt/cloud/testdata/dhcp0001.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/dhcp0001.json rename to systemvm/patches/debian/opt/cloud/testdata/dhcp0001.json diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/gn0001.json b/systemvm/patches/debian/opt/cloud/testdata/gn0001.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/gn0001.json rename to systemvm/patches/debian/opt/cloud/testdata/gn0001.json diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/ips0001.json b/systemvm/patches/debian/opt/cloud/testdata/ips0001.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/ips0001.json rename to systemvm/patches/debian/opt/cloud/testdata/ips0001.json diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/ips0002.json b/systemvm/patches/debian/opt/cloud/testdata/ips0002.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/ips0002.json rename to systemvm/patches/debian/opt/cloud/testdata/ips0002.json diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/ips0003.json b/systemvm/patches/debian/opt/cloud/testdata/ips0003.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/ips0003.json rename to systemvm/patches/debian/opt/cloud/testdata/ips0003.json diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/s2s0001.json b/systemvm/patches/debian/opt/cloud/testdata/s2s0001.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/s2s0001.json rename to systemvm/patches/debian/opt/cloud/testdata/s2s0001.json diff --git a/systemvm/patches/debian/config/opt/cloud/bin/test.sh b/systemvm/patches/debian/opt/cloud/testdata/test.sh similarity index 99% rename from systemvm/patches/debian/config/opt/cloud/bin/test.sh rename to systemvm/patches/debian/opt/cloud/testdata/test.sh index 0ffd4e56d07..8410e241b59 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/test.sh +++ b/systemvm/patches/debian/opt/cloud/testdata/test.sh @@ -22,4 +22,3 @@ cp /opt/cloud/testdata/* /etc/cloudstack /opt/cloud/bin/update_config.py ips0001.json /opt/cloud/bin/update_config.py ips0002.json /opt/cloud/bin/update_config.py ips0003.json - diff --git a/systemvm/patches/debian/config/opt/cloud/testdata/vmp0001.json b/systemvm/patches/debian/opt/cloud/testdata/vmp0001.json similarity index 100% rename from systemvm/patches/debian/config/opt/cloud/testdata/vmp0001.json rename to systemvm/patches/debian/opt/cloud/testdata/vmp0001.json diff --git a/systemvm/patches/debian/qemuconvert.sh b/systemvm/patches/debian/qemuconvert.sh deleted file mode 100755 index dc8eb15b3ab..00000000000 --- a/systemvm/patches/debian/qemuconvert.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - - - -echo "Converting raw image to qcow2" -qemu-img convert -f raw -O qcow2 systemvm.img systemvm.qcow2 -echo "Compressing qcow2..." -bzip2 -c systemvm.qcow2 > systemvm.qcow2.bz2 -echo "Done qcow2" -echo "Converting raw image to vmdk" -qemu-img convert -f raw -O vmdk systemvm.img systemvm.vmdk -echo "Compressing vmdk..." -bzip2 -c systemvm.vmdk > systemvm.vmdk.bz2 -echo "Done vmdk" diff --git a/systemvm/patches/debian/config/root/.ssh/authorized_keys b/systemvm/patches/debian/root/.ssh/authorized_keys similarity index 100% rename from systemvm/patches/debian/config/root/.ssh/authorized_keys rename to systemvm/patches/debian/root/.ssh/authorized_keys diff --git a/systemvm/patches/debian/config/root/clearUsageRules.sh b/systemvm/patches/debian/root/clearUsageRules.sh similarity index 99% rename from systemvm/patches/debian/config/root/clearUsageRules.sh rename to systemvm/patches/debian/root/clearUsageRules.sh index 061688b7438..393bc646090 100755 --- a/systemvm/patches/debian/config/root/clearUsageRules.sh +++ b/systemvm/patches/debian/root/clearUsageRules.sh @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - + # clearUsageRules.sh - remove iptable rules for removed public interfaces # @VERSION@ diff --git a/systemvm/patches/debian/config/root/func.sh b/systemvm/patches/debian/root/func.sh similarity index 100% rename from systemvm/patches/debian/config/root/func.sh rename to systemvm/patches/debian/root/func.sh diff --git a/systemvm/patches/debian/config/root/monitorServices.py b/systemvm/patches/debian/root/monitorServices.py similarity index 99% rename from systemvm/patches/debian/config/root/monitorServices.py rename to systemvm/patches/debian/root/monitorServices.py index c1dfba21a46..75d10043816 100755 --- a/systemvm/patches/debian/config/root/monitorServices.py +++ b/systemvm/patches/debian/root/monitorServices.py @@ -378,10 +378,3 @@ def main(): if __name__ == "__main__": main() - - - - - - - diff --git a/systemvm/patches/debian/config/root/reconfigLB.sh b/systemvm/patches/debian/root/reconfigLB.sh similarity index 99% rename from systemvm/patches/debian/config/root/reconfigLB.sh rename to systemvm/patches/debian/root/reconfigLB.sh index e68cc3df492..a6419390a63 100755 --- a/systemvm/patches/debian/config/root/reconfigLB.sh +++ b/systemvm/patches/debian/root/reconfigLB.sh @@ -37,4 +37,3 @@ new_config=$1 fi exit $ret - diff --git a/systemvm/patches/debian/systemvm.vmx b/systemvm/patches/debian/systemvm.vmx deleted file mode 100644 index 9b93449d94a..00000000000 --- a/systemvm/patches/debian/systemvm.vmx +++ /dev/null @@ -1,37 +0,0 @@ -config.version = "8" -displayname = "systemvm" -ethernet0.addressType = "generated" -ethernet0.connectionType = "bridged" -ethernet0.present = "true" -ethernet0.startConnected = "true" -ethernet0.virtualDev = "e1000" -floppy0.autodetect = "false" -floppy0.fileType = "device" -floppy0.present = "true" -floppy0.startConnected = "false" -guestos = "debian5" -ide0:0.deviceType = "disk" -ide0:0.fileName = "systemvm.vmdk" -ide0:0.present = "true" -ide1:0.autodetect = "true" -ide1:0.deviceType = "atapi-cdrom" -ide1:0.present = "true" -ide1:0.startConnected = "false" -memsize = "256" -numvcpus = "1" -pciBridge0.present = "TRUE" -pciBridge4.functions = "8" -pciBridge4.present = "TRUE" -pciBridge4.virtualDev = "pcieRootPort" -pciBridge5.functions = "8" -pciBridge5.present = "TRUE" -pciBridge5.virtualDev = "pcieRootPort" -pciBridge6.functions = "8" -pciBridge6.present = "TRUE" -pciBridge6.virtualDev = "pcieRootPort" -pciBridge7.functions = "8" -pciBridge7.present = "TRUE" -pciBridge7.virtualDev = "pcieRootPort" -svga.autodetect = "true" -virtualhw.version = "7" -vmci0.present = "TRUE" diff --git a/systemvm/patches/debian/systemvm.xml b/systemvm/patches/debian/systemvm.xml deleted file mode 100644 index fffc077a27c..00000000000 --- a/systemvm/patches/debian/systemvm.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - systemvm2 - 1572864 - 1572864 - 1 - - hvm - - - - - - - - destroy - restart - restart - - - /usr/bin/qemu-kvm - - - - - - - - - - - - - - - - - diff --git a/systemvm/patches/debian/config/var/www/html/latest/.htaccess b/systemvm/patches/debian/var/www/html/latest/.htaccess similarity index 99% rename from systemvm/patches/debian/config/var/www/html/latest/.htaccess rename to systemvm/patches/debian/var/www/html/latest/.htaccess index 5c9da02887a..725e7e112a6 100644 --- a/systemvm/patches/debian/config/var/www/html/latest/.htaccess +++ b/systemvm/patches/debian/var/www/html/latest/.htaccess @@ -21,4 +21,3 @@ RewriteRule ^public-ipv4/?$ ../metadata/%{REMOTE_ADDR}/public-ipv4 [L,NC,QSA] RewriteRule ^public-keys/?$ ../metadata/%{REMOTE_ADDR}/public-keys [L,NC,QSA] RewriteRule ^service-offering/?$ ../metadata/%{REMOTE_ADDR}/service-offering [L,NC,QSA] RewriteRule ^vm-id/?$ ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA] - diff --git a/systemvm/patches/debian/config/var/www/html/userdata/.htaccess b/systemvm/patches/debian/var/www/html/userdata/.htaccess similarity index 100% rename from systemvm/patches/debian/config/var/www/html/userdata/.htaccess rename to systemvm/patches/debian/var/www/html/userdata/.htaccess diff --git a/systemvm/patches/debian/vhdconvert.sh b/systemvm/patches/debian/vhdconvert.sh deleted file mode 100755 index 0b0dbfb1724..00000000000 --- a/systemvm/patches/debian/vhdconvert.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - - - -# BUILDING vhd-util on Linux -# The xen repository has a tool called vhd-util that compiles and runs on any linux system -# (http://xenbits.xensource.com/xen-4.0-testing.hg?file/8e8dd38374e9/tools/blktap2/vhd/ or full Xen source at http://www.xen.org/products/xen_source.html). -# Apply this patch: http://lists.xensource.com/archives/cgi-bin/mesg.cgi?a=xen-devel&i=006101cb22f6%242004dd40%24600e97c0%24%40zhuo%40cloudex.cn. -# Build the vhd-util tool: -# cd tools/blktap2 -# make -# sudo make install - -echo "Backing up systemvm.img" -cp systemvm.img systemvm.img.tmp -echo "Converting raw image to fixed vhd" -vhd-util convert -s 0 -t 1 -i systemvm.img.tmp -o systemvm.vhd -echo "Converting fixed vhd to dynamic vhd" -vhd-util convert -s 1 -t 2 -i systemvm.vhd -o systemvm.vhd -echo "Compressing..." -bzip2 -c systemvm.vhd > systemvm.vhd.bz2 -echo "Done" diff --git a/systemvm/patches/debian/xe/xe-daemon b/systemvm/patches/debian/xe/xe-daemon deleted file mode 100644 index bc514d780b8..00000000000 --- a/systemvm/patches/debian/xe/xe-daemon +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -LANG="C" -export LANG - -usage() { - echo "$0 [ -p ]" >&2 - exit 1 -} - -# Parse command line opts -while [ $# -ne 0 ] ; do - arg="$1" - shift - case "$arg" in - "-p") - [ $# -eq 0 ] && usage - pidfile="$1" - shift - mkdir -p "$(dirname "$pidfile")" - echo $$ > "$pidfile" - ;; - *) - usage - ;; - esac -done - -XE_UPDATE_GUEST_ATTRS=${XE_UPDATE_GUEST_ATTRS:-/usr/sbin/xe-update-guest-attrs} -XE_DAEMON_RATE=${XE_DAEMON_RATE:-60} # run once a minute by default -XE_MEMORY_UPDATE_DIVISOR=${XE_MEMORY_UPDATE_DIVISOR:-2} # update mem stats 1/2 as often by dflt - -# Delete xenstore cache following each reboot -rm -rf /var/cache/xenstore - -MEMORY_UPDATE_COUNTER=0 -while true ; do - if [ ${MEMORY_UPDATE_COUNTER} -eq 0 ] ; then - MEMORY=--memory - MEMORY_UPDATE_COUNTER=${XE_MEMORY_UPDATE_DIVISOR} - else - MEMORY= - fi - MEMORY_UPDATE_COUNTER=$((${MEMORY_UPDATE_COUNTER} - 1)) - ${XE_UPDATE_GUEST_ATTRS} ${MEMORY} - - sleep ${XE_DAEMON_RATE} -done diff --git a/systemvm/patches/debian/xe/xe-linux-distribution b/systemvm/patches/debian/xe/xe-linux-distribution deleted file mode 100644 index 774f1c75859..00000000000 --- a/systemvm/patches/debian/xe/xe-linux-distribution +++ /dev/null @@ -1,267 +0,0 @@ -#! /bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Script to write information about the current distribution to stdout or a file. -# Information collected: -# - Distribution name -# - Distribution version (major and minor) -# - Kernel version (uname) - -LANG="C" -export LANG - - -write_to_output() -{ - local distro="$1" - local major="$2" - local minor="$3" - local name="$4" - local uname=$(uname -r) - - if [ -n "${TEST_RESULT}" ] ; then - MAJOR=$major - MINOR=$minor - DISTRO=$distro - UNAME=$uname - return 0 - fi - - echo "os_distro=\"${distro}\"" - echo "os_majorver=\"${major}\"" - echo "os_minorver=\"${minor}\"" - echo "os_uname=\"${uname}\"" - echo "os_name=\"${name}\"" - - return 0 -} - -identify_debian() -{ - local debian_version="$1" - local major - local minor - - # 3.1 - # 4.0 - # Ignores testing and unstable which contain ".*/sid". - - if [ ! -f "${debian_version}" ] ; then - return 1 - fi - - eval $(awk -F. '/^[0-9]*\.[0-9]*/ \ - { print "major="$1 ; print "minor="$2 ; exit 0 }' \ - "${debian_version}") - - if [ -z "${major}" ] && [ -z "${minor}" ] && ! grep -q /sid "${debian_version}" ; then - return 1 - fi - - write_to_output "debian" "${major}" "${minor}" "Debian $(head -n 1 $debian_version)" - - return 0 -} - -identify_redhat() -{ - redhat_release="$1" - local distro - local major - local minor - local beta - - # distro=rhel - # Red Hat Enterprise Linux AS release 3 (Taroon Update 6) - # Red Hat Enterprise Linux AS release 3 (Taroon Update 8) - # Red Hat Enterprise Linux AS release 4 (Nahant) - # Red Hat Enterprise Linux AS release 4 (Nahant Update 1) - # Red Hat Enterprise Linux AS release 4 (Nahant Update 2) - # Red Hat Enterprise Linux AS release 4 (Nahant Update 3) - # Red Hat Enterprise Linux AS release 4 (Nahant Update 4) - # Red Hat Enterprise Linux Server release 4.92 (Tikanga) - # Red Hat Enterprise Linux Server release 5 (Tikanga) - # Red Hat Enterprise Linux Server release 5.1 Beta (Tikanga) - - # distro=xe-ddk - # \@PRODUCT_BRAND\@ DDK release \@PRODUCT_VERSION\@-\@BUILD_NUMBER\@ (\@PRODUCT_NAME\@) - # Rio DDK release 0.5.6-2991c (xenenterprise) - - # distro=xe-sdk - # \@PRODUCT_BRAND\@ SDK release \@PRODUCT_VERSION\@-\@BUILD_NUMBER\@ (\@PRODUCT_NAME\@) - # Rio SDK release 0.5.6-2991c (xenenterprise) - - # distro=fedora - # Fedora Core release 3 (Heidelberg) - - # distro=centos - # CentOS release 4.0 (Final) - # CentOS release 5 (Final) - - # distro=oracle - # Enterprise Linux Enterprise Linux Server release 5 (Carthage) - - if [ ! -f "${redhat_release}" ] ; then - return 1 - fi - - eval $(sed -n \ - -e 's/^\(.*\) DDK release \(.*\)-\(.*\) (.*)$/distro=xe-ddk;major=\2;minor=\3/gp;' \ - -e 's/^\(.*\) SDK release \(.*\)-\(.*\) (.*)$/distro=xe-sdk;major=\2;minor=\3/gp;' \ - -e 's/^Red Hat Enterprise Linux .* release \([0-9]*\) (.* Update \(.*\))$/distro=rhel;major=\1;minor=\2/gp;'\ - -e 's/^Red Hat Enterprise Linux .* release \([0-9]*\) (.*)$/distro=rhel;major=\1/gp;' \ - -e 's/^Red Hat Enterprise Linux .* release \([0-9]*\)\.\([0-9]*\) \([Bb]eta \)\?(.*)$/distro=rhel;major=\1;minor=\2;beta=\3;/gp;' \ - -e 's/^Fedora.*release \([0-9]*\) (.*)$/distro=fedora;major=\1/gp;' \ - -e 's/^CentOS release \([0-9]*\)\.\([0-9]*\) (.*)/distro=centos;major=\1;minor=\2/gp;' \ - -e 's/^CentOS release \([0-9]*\) (.*)/distro=centos;major=\1/gp;' \ - -e 's/^Enterprise Linux Enterprise Linux .* release \([0-9]*\)\.\([0-9]*\) (.*)$/distro=oracle;major=\1;minor=\2;/gp;' \ - -e 's/^Enterprise Linux Enterprise Linux .* release \([0-9]*\) (.*)$/distro=oracle;major=\1/gp;' \ - "${redhat_release}") - - if [ -z "${major}" -o -z "${distro}" ] ; then - return 1 - fi - - if [ -z "${minor}" ] ; then - minor=0 - fi - - # HACK to handle RHEL betas - if [ "${distro}" == "rhel" ] && [ ${minor} -gt 90 ] ; then - major=$(expr ${major} + 1 ) - minor=0 - beta=Beta - fi - - if [ -n "${beta}" ] ; then - minor="${minor}beta" - fi - - write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${redhat_release})" - -} - -identify_sles() -{ - suse_release="$1" - local major - local minor - local _major - - # SUSE LINUX Enterprise Server 9 (i586) - # VERSION = 9 - # - # SUSE LINUX Enterprise Server 9 (i586) - # VERSION = 9 - # PATCHLEVEL = 2 - # - # SUSE LINUX Enterprise Server 9 (i586) - # VERSION = 9 - # PATCHLEVEL = 3 - # - # SUSE Linux Enterprise Server 10 (i586) - # VERSION = 10 - # - # SUSE Linux Enterprise Server 10 (i586) - # VERSION = 10 - # PATCHLEVEL = 1 - # - # SUSE Linux Enterprise Server 11 (i586) - # VERSION = 11 - # PATCHLEVEL = 0 - - if [ ! -f "${suse_release}" ] ; then - return 1 - fi - - eval $(sed -n \ - -e 's/^SUSE L\(inux\|INUX\) Enterprise Server \([0-9]*\) (.*)/_major=\2;/gp;' \ - -e 's/^VERSION = \([0-9]*\)$/major=\1;/gp;' \ - -e 's/^PATCHLEVEL = \([0-9]*\)$/minor=\1;/gp;' \ - "${suse_release}") - - if [ -z "${major}" -o -z "${_major}" ] ; then - return 1 - fi - - if [ "${major}" != "${_major}" ] ; then - return 1 - fi - - if [ -z "${minor}" ] ; then - minor=0 - fi - - write_to_output "sles" "${major}" "${minor}" "$(head -n 1 ${suse_release})" - -} - -identify_lsb() -{ - lsb_release="$1" - - if [ ! -x "${lsb_release}" ] ; then - saved_IFS=$IFS - IFS=: - for i in $PATH ; do - if [ -x "${i}/${lsb_release}" ] ; then - lsb_release="${i}/${lsb_release}" - break - fi - done - IFS=$saved_IFS - fi - - if [ ! -x "${lsb_release}" ] ; then - return 1 - fi - - distro=$(${lsb_release} --short --id | tr 'A-Z' 'a-z') - description=$(${lsb_release} --short --description | sed -e 's/^"\(.*\)"$/\1/g') - release=$(${lsb_release} --short --release) - - if [ -z "${distro}" -o -z "${release}" ] ; then - return 1 - fi - - eval $(echo $release | awk -F. -- '{ print "major=" $1 ; print "minor=" $2 }') - - if [ -z "${major}" -o -z "${distro}" ] ; then - return 1 - fi - - write_to_output "${distro}" "${major}" "${minor}" "${description}" -} - -if [ $# -eq 1 ] ; then - exec 1>"$1" -fi - -if [ -z "${TEST}" ] ; then - identify_redhat /etc/redhat-release && exit 0 - identify_sles /etc/SuSE-release && exit 0 - identify_lsb lsb_release && exit 0 - identify_debian /etc/debian_version && exit 0 - - if [ $# -eq 1 ] ; then - rm -f "$1" - fi - - exit 1 -fi diff --git a/systemvm/patches/debian/xe/xe-update-guest-attrs b/systemvm/patches/debian/xe/xe-update-guest-attrs deleted file mode 100644 index 6c605be420b..00000000000 --- a/systemvm/patches/debian/xe/xe-update-guest-attrs +++ /dev/null @@ -1,226 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Script to write information about the guest to XenStore. -# -# Information collected (if --memory NOT passed in): -# - Distribution name -# - Distribution version (major and minor) -# - Kernel version (uname) -# - IP address for each Ethernet interface -# -# Information collected (if --memory IS passed in): -# - memtotal -# - memfree -# -# Memory stats are separated out because they change all the time -# and so we may not want to update them as frequently - -LANG="C" -export LANG - - -XE_LINUX_DISTRIBUTION_CACHE=/var/cache/xe-linux-distribution - -IPADDR_RE="\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\}" - -export PATH=/usr/sbin:/usr/bin:/sbin:/bin -XENSTORE=${XENSTORE:-xenstore} - -XENSTORE_UPDATED=0 - -# parse command line opts - -MEMORY_MODE=0 # do not update memory stats -while [ $# -ge 1 ] ; do - if [ "$1" = "--memory" ] ; then - MEMORY_MODE=1 # update only memory stats - fi - shift -done - -xenstore_write_cached() { - key="$1" newval="$2" - cache=/var/cache/xenstore/$key - if [ -f $cache ] ; then - # cache exists - oldval=$(cat "$cache") - if [ "$oldval" = "$newval" ] ; then - # value unchanged - return 0 - fi - else - # cache does not exist - if [ -e $cache ] ; then - # something (directory?) in its way - rm -rf $cache - fi - fi - - # try to write and update cache if successfull - if $XENSTORE-write "$key" "$newval" ; then - mkdir -p $(dirname "$cache") - echo -n "$newval" > "$cache" - XENSTORE_UPDATED=1 - return 0 - fi - return 1 -} - -# If we detect a domain change then delete our cache and force a refresh -domid=$(xenstore-read "domid") -cache=/var/cache/xenstore/unique-domain-id -newval=$(xenstore-read "/local/domain/${domid}/unique-domain-id") -if [ -e $cache ]; then - oldval=$(cat "$cache") - if [ "$oldval" != "$newval" ]; then - # domain changed - rm -rf /var/cache/xenstore - fi -fi -mkdir -p $(dirname "$cache") -echo -n "$newval" > "$cache" - -xenstore_rm_cached() { - key="$1" - cache=/var/cache/xenstore/$key - if [ ! -e $cache ] ; then - return 1 - fi - # try to write and update cache if successfull - if $XENSTORE-rm "$key" ; then - rm -rf "$cache" - XENSTORE_UPDATED=1 - return 0 - fi - return 1 -} - -xenstore_list_interfaces_cached() { - topdir=/var/cache/xenstore/attr - if [ -d $topdir ] ; then - cd $topdir - for dir in * ; do - [ -f $dir/ip ] && echo $dir - done - fi -} - -if [ $MEMORY_MODE -eq 1 ] ; then - # Update the memory information - eval $(cat /proc/meminfo | \ - sed -n -e 's/MemTotal\: *\([0-9]*\)[^$]*/memtotal=\1/gp;' \ - -e 's/MemFree\: *\([0-9]*\)[^$]*/memfree=\1/gp;') - - xenstore_write_cached "data/meminfo_total" "${memtotal}" - xenstore_write_cached "data/meminfo_free" "${memfree}" -fi - - - -# e.g. -# $ ip addr show -# 1: lo: mtu 16436 qdisc noqueue -# link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -# inet 127.0.0.1/8 scope host lo -# inet6 ::1/128 scope host -# valid_lft forever preferred_lft forever -# 2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 -# link/ether 00:13:20:95:e8:74 brd ff:ff:ff:ff:ff:ff -# inet 172.31.0.57/20 brd 172.31.15.255 scope global eth0 -# inet6 fe80::213:20ff:fe95:e874/64 scope link -# valid_lft forever preferred_lft forever -# 3: sit0: mtu 1480 qdisc noop -# link/sit 0.0.0.0 brd 0.0.0.0 - -#eval $(ip addr show | \ -# sed -n -e 's/^[[:digit:]]*: \([a-z0-9]*\): .*/ifs="\$ifs \1"; current="\1"; /gp;' \ -# -e 's/^[[:space:]]\{4\}inet \('${IPADDR_RE}'\)\/.*/eval inet_\${current}="\1"; /gp;') - -# e.g. -# eth0 Link encap:Ethernet HWaddr 00:13:20:95:E8:74 -# inet addr:172.31.0.57 Bcast:172.31.15.255 Mask:255.255.240.0 -# inet6 addr: fe80::213:20ff:fe95:e874/64 Scope:Link -# UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 -# RX packets:98001128 errors:0 dropped:0 overruns:0 frame:0 -# TX packets:87728920 errors:0 dropped:0 overruns:0 carrier:0 -# collisions:0 txqueuelen:1000 -# RX bytes:35864034092 (33.4 GiB) TX bytes:27544025180 (25.6 GiB) -# Interrupt:177 -# -# lo Link encap:Local Loopback -# inet addr:127.0.0.1 Mask:255.0.0.0 -# inet6 addr: ::1/128 Scope:Host -# UP LOOPBACK RUNNING MTU:16436 Metric:1 -# RX packets:32928 errors:0 dropped:0 overruns:0 frame:0 -# TX packets:32928 errors:0 dropped:0 overruns:0 carrier:0 -# collisions:0 txqueuelen:0 -# RX bytes:3604609 (3.4 MiB) TX bytes:3604609 (3.4 MiB) - -eval $(/sbin/ifconfig | \ - sed -n -e '/^[0-9a-z][0-9a-z]*\:/,/^$/d' \ - -e 's/^\([0-9a-z][0-9a-z]*\) .*/ifs="\$ifs \1"; current="\1"; /gp;' \ - -e 's/ *inet addr:\('$IPADDR_RE'\) .*/eval inet_\${current}="\1"; /gp;') - -# network -for if in $ifs ; do - - [ "${if}" = "lo" ] && continue - inet=$(eval echo \${inet_${if}}) - [ -z "${inet}" ] && continue - - xenstore_write_cached "attr/${if}/ip" "${inet}" -done - -# remove any interfaces that have been unplugged or downed -for at in $(xenstore_list_interfaces_cached) ; do - for if in $ifs ; do - [ "${if}" = "${at}" ] && continue 2 - done - xenstore_rm_cached "attr/${at}" -done - -# distro -if [ -f ${XE_LINUX_DISTRIBUTION_CACHE} ] ; then - . ${XE_LINUX_DISTRIBUTION_CACHE} - for key in os_name os_majorver os_minorver os_uname os_distro ; do - new=$(eval echo \${${key}}) - [ -n "${new}" ] || continue - xenstore_write_cached "data/${key}" "${new}" - done -fi - -# whether I support ballooning or not -xenstore_write_cached "control/feature-balloon" "1" - -# whether I support ballooning or not -xenstore_write_cached "control/feature-balloon" "1" - -# build time addons -xenstore_write_cached "attr/PVAddons/MajorVersion" "5" -xenstore_write_cached "attr/PVAddons/MinorVersion" "6" -xenstore_write_cached "attr/PVAddons/MicroVersion" "0" -xenstore_write_cached "attr/PVAddons/BuildVersion" "31188" -xenstore_write_cached "attr/PVAddons/Installed" "1" - -# update xenstore if necc -if [ $XENSTORE_UPDATED -eq 1 ] ; then - xenstore_write_cached "data/updated" "$(date)" -fi - diff --git a/systemvm/test/python/TestCsAddress.py b/systemvm/patches/test/TestCsAddress.py similarity index 100% rename from systemvm/test/python/TestCsAddress.py rename to systemvm/patches/test/TestCsAddress.py diff --git a/systemvm/test/python/TestCsApp.py b/systemvm/patches/test/TestCsApp.py similarity index 100% rename from systemvm/test/python/TestCsApp.py rename to systemvm/patches/test/TestCsApp.py diff --git a/systemvm/test/python/TestCsCmdLine.py b/systemvm/patches/test/TestCsCmdLine.py similarity index 100% rename from systemvm/test/python/TestCsCmdLine.py rename to systemvm/patches/test/TestCsCmdLine.py diff --git a/systemvm/test/python/TestCsConfig.py b/systemvm/patches/test/TestCsConfig.py similarity index 100% rename from systemvm/test/python/TestCsConfig.py rename to systemvm/patches/test/TestCsConfig.py diff --git a/systemvm/test/python/TestCsDatabag.py b/systemvm/patches/test/TestCsDatabag.py similarity index 100% rename from systemvm/test/python/TestCsDatabag.py rename to systemvm/patches/test/TestCsDatabag.py diff --git a/systemvm/test/python/TestCsDhcp.py b/systemvm/patches/test/TestCsDhcp.py similarity index 100% rename from systemvm/test/python/TestCsDhcp.py rename to systemvm/patches/test/TestCsDhcp.py diff --git a/systemvm/test/python/TestCsFile.py b/systemvm/patches/test/TestCsFile.py similarity index 100% rename from systemvm/test/python/TestCsFile.py rename to systemvm/patches/test/TestCsFile.py diff --git a/systemvm/test/python/TestCsGuestNetwork.py b/systemvm/patches/test/TestCsGuestNetwork.py similarity index 100% rename from systemvm/test/python/TestCsGuestNetwork.py rename to systemvm/patches/test/TestCsGuestNetwork.py diff --git a/systemvm/test/python/TestCsHelper.py b/systemvm/patches/test/TestCsHelper.py similarity index 100% rename from systemvm/test/python/TestCsHelper.py rename to systemvm/patches/test/TestCsHelper.py diff --git a/systemvm/test/python/TestCsInterface.py b/systemvm/patches/test/TestCsInterface.py similarity index 100% rename from systemvm/test/python/TestCsInterface.py rename to systemvm/patches/test/TestCsInterface.py diff --git a/systemvm/test/python/TestCsNetfilter.py b/systemvm/patches/test/TestCsNetfilter.py similarity index 100% rename from systemvm/test/python/TestCsNetfilter.py rename to systemvm/patches/test/TestCsNetfilter.py diff --git a/systemvm/test/python/TestCsProcess.py b/systemvm/patches/test/TestCsProcess.py similarity index 100% rename from systemvm/test/python/TestCsProcess.py rename to systemvm/patches/test/TestCsProcess.py diff --git a/systemvm/test/python/TestCsRedundant.py b/systemvm/patches/test/TestCsRedundant.py similarity index 100% rename from systemvm/test/python/TestCsRedundant.py rename to systemvm/patches/test/TestCsRedundant.py diff --git a/systemvm/test/python/TestCsRoute.py b/systemvm/patches/test/TestCsRoute.py similarity index 100% rename from systemvm/test/python/TestCsRoute.py rename to systemvm/patches/test/TestCsRoute.py diff --git a/systemvm/test/python/TestCsRule.py b/systemvm/patches/test/TestCsRule.py similarity index 100% rename from systemvm/test/python/TestCsRule.py rename to systemvm/patches/test/TestCsRule.py diff --git a/systemvm/test/python/runtests.sh b/systemvm/patches/test/runtests.sh similarity index 94% rename from systemvm/test/python/runtests.sh rename to systemvm/patches/test/runtests.sh index 6d6a196f251..e64f8674a08 100644 --- a/systemvm/test/python/runtests.sh +++ b/systemvm/patches/test/runtests.sh @@ -18,7 +18,7 @@ # requires netaddr -export PYTHONPATH="../../patches/debian/config/opt/cloud/bin/" +export PYTHONPATH="../debian/opt/cloud/bin/" export PYTHONDONTWRITEBYTECODE=False pep8 --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../../patches -name \*.py` diff --git a/systemvm/patches/debian/vpn/etc/ipsec.conf b/systemvm/patches/vpn/etc/ipsec.conf similarity index 100% rename from systemvm/patches/debian/vpn/etc/ipsec.conf rename to systemvm/patches/vpn/etc/ipsec.conf diff --git a/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf b/systemvm/patches/vpn/etc/ipsec.d/l2tp.conf similarity index 100% rename from systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf rename to systemvm/patches/vpn/etc/ipsec.d/l2tp.conf diff --git a/systemvm/patches/debian/vpn/etc/ipsec.secrets b/systemvm/patches/vpn/etc/ipsec.secrets similarity index 100% rename from systemvm/patches/debian/vpn/etc/ipsec.secrets rename to systemvm/patches/vpn/etc/ipsec.secrets diff --git a/systemvm/patches/debian/vpn/etc/ppp/options.xl2tpd b/systemvm/patches/vpn/etc/ppp/options.xl2tpd similarity index 100% rename from systemvm/patches/debian/vpn/etc/ppp/options.xl2tpd rename to systemvm/patches/vpn/etc/ppp/options.xl2tpd diff --git a/systemvm/patches/debian/vpn/etc/xl2tpd/xl2tpd.conf b/systemvm/patches/vpn/etc/xl2tpd/xl2tpd.conf similarity index 100% rename from systemvm/patches/debian/vpn/etc/xl2tpd/xl2tpd.conf rename to systemvm/patches/vpn/etc/xl2tpd/xl2tpd.conf diff --git a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh b/systemvm/patches/vpn/opt/cloud/bin/vpn_l2tp.sh similarity index 98% rename from systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh rename to systemvm/patches/vpn/opt/cloud/bin/vpn_l2tp.sh index 83cf4de93f2..60ee8a6dafd 100755 --- a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh +++ b/systemvm/patches/vpn/opt/cloud/bin/vpn_l2tp.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. - + #set -x @@ -142,7 +142,7 @@ create_l2tp_ipsec_vpn_server() { ipsec_server "restart" - ipsec auto --rereadsecrets + ipsec auto --rereadsecrets ipsec auto --replace L2TP-PSK } @@ -152,7 +152,7 @@ destroy_l2tp_ipsec_vpn_server() { ipsec auto --down L2TP-PSK iptables_ "-D" $public_ip - + ipsec_server "stop" } @@ -254,6 +254,6 @@ if [ "$useradd" == "1" ]; then exit $? fi if [ "$userdel" == "1" ]; then - remove_l2tp_ipsec_user $user + remove_l2tp_ipsec_user $user exit $? fi diff --git a/systemvm/pom.xml b/systemvm/pom.xml index 4d657b72274..0ae3e029ae9 100644 --- a/systemvm/pom.xml +++ b/systemvm/pom.xml @@ -52,10 +52,10 @@ maven-assembly-plugin - systemvm + agent false - systemvm-descriptor.xml + systemvm-agent-descriptor.xml @@ -84,11 +84,11 @@ target - systemvm.zip + agent.zip - patches/debian/config/root/.ssh + patches/debian/root/.ssh authorized_keys @@ -111,31 +111,19 @@ - - + - + - - - - - - - - - - - @@ -180,7 +168,7 @@ -r -o systemvm.iso - systemvm.zip + agent.zip cloud-scripts.tgz authorized_keys diff --git a/systemvm/scripts/run.bat b/systemvm/scripts/run.bat deleted file mode 100644 index ce6dc404574..00000000000 --- a/systemvm/scripts/run.bat +++ /dev/null @@ -1,18 +0,0 @@ -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations -rem under the License. - -java -mx700m -cp cloud-console-proxy.jar;;cloud-console-common.jar;log4j-1.2.15.jar;apache-log4j-extras-1.0.jar;gson-1.3.jar;commons-logging-1.1.1.jar;.;.\conf; com.cloud.consoleproxy.ConsoleProxy %* diff --git a/systemvm/systemvm-descriptor.xml b/systemvm/systemvm-agent-descriptor.xml similarity index 92% rename from systemvm/systemvm-descriptor.xml rename to systemvm/systemvm-agent-descriptor.xml index ce5ae4b6d20..a3f0453cffd 100644 --- a/systemvm/systemvm-descriptor.xml +++ b/systemvm/systemvm-agent-descriptor.xml @@ -19,7 +19,7 @@ - systemvm + agent zip @@ -46,13 +46,13 @@ 555 - scripts + agent/scripts 555 555 - conf + agent/conf conf 555 555 @@ -63,7 +63,7 @@ - images + agent/images images 555 555 @@ -75,7 +75,7 @@ - js + agent/js js 555 555 @@ -84,7 +84,7 @@ - ui + agent/ui ui 555 555 @@ -93,7 +93,7 @@ - css + agent/css css 555 555 @@ -102,7 +102,7 @@ - certs + agent/certs certs 555 555 diff --git a/systemvm/vm-script/vmops b/systemvm/vm-script/vmops deleted file mode 100644 index a9f70c83925..00000000000 --- a/systemvm/vm-script/vmops +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# -# vmops Script to start and stop the VMOps Agent. -# -# Author: Chiradeep Vittal -# chkconfig: 2345 99 01 -# description: Start up the VMOps agent - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -# Source function library. -if [ -f /etc/init.d/functions ] -then - . /etc/init.d/functions -fi - -_success() { - if [ -f /etc/init.d/functions ] - then - success - else - echo "Success" - fi -} - -_failure() { - if [ -f /etc/init.d/functions ] - then - failure - else - echo "Failed" - fi -} -RETVAL=$? -VMOPS_HOME="/usr/local/vmops" - -mkdir -p /var/log/vmops - -get_pids() { - local i - for i in $(ps -ef| grep java | grep -v grep | awk '{print $2}'); - do - echo $(pwdx $i) | grep "$VMOPS_HOME" | grep -i console | awk -F: '{print $1}'; - done -} - -start() { - local pid=$(get_pids) - echo -n "Starting VMOps Console Proxy: " - if [ -f $VMOPS_HOME/consoleproxy/run.sh ]; - then - if [ "$pid" == "" ] - then - (cd $VMOPS_HOME/consoleproxy; nohup ./run.sh > /var/log/vmops/vmops.out 2>&1 & ) - pid=$(get_pids) - echo $pid > /var/run/vmops.pid - fi - _success - else - _failure - fi - echo -} - -stop() { - local pid - echo -n "Stopping VMOps agent: " - for pid in $(get_pids) - do - kill $pid - done - _success - echo -} - -status() { - local pids=$(get_pids) - if [ "$pids" == "" ] - then - echo "VMOps agent is not running" - return 1 - fi - echo "VMOps agent is running: process id: $pids" - return 0 -} - - -case "$1" in - start) start - ;; - stop) stop - ;; - status) status - ;; - restart) stop - start - ;; - *) echo $"Usage: $0 {start|stop|status|restart}" - exit 1 - ;; -esac - -exit $RETVAL