PDA

View Full Version : Quoting style for APK config files; backslashes disappear


Svilen Ivanov
01-21-2009, 04:37 AM
Hello,

I'm trying to instrument a configuration file using APK (adlfix) but the backslashes ("\") in the property value disappear. Here is the config file before restart of the appliance:

# $$propN: x:ans_regexp
+/x/ REDIRECT rpx@localhost
The "ans_regexp" property have value "rpx-.*@rpx\.recoveryplanner\.com" (w/o surrounding double quotes - note the backslashes in the value). After restart the file becomes:
# $$propN: rpx-.*@rpx-ca.recoveryplanner.com:ans_regexp
+/rpx-.*@rpx-ca.recoveryplanner.com/ REDIRECT rpx@localhost


Here is an extract from ADL config file:

assembly main
{
.category = General
.description = "Main assembly of the application"

subordinate LUX64 : .class = LUX64
{
.standby = 0
.ignore = 0
...
[snip]
...
ans_regexp = rpx-.*@rpx-ca\.recoveryplanner\.com
mailq = mailq

cpu : dflt = 0.25
bw : dflt = 50M
mem : dflt = 256M
}

I'm using Applogic 2.4.5 Beta hf2586 hf2602 hf1910 and the APK kit is inherited from stock LUX64 appliance.

Additionally, I wasn't able to find in the documentation how to specify quoting style (http://doc.3tera.com/AppLogic24/AdvADLPropertyMarkup.html) in case of "dhcp" method of property propagation.

Any ideas?

Best regards,
Svi

Update: I was able to workaround it by putting 2 backslashes wherever a single backslash is required, but it is inconvenient

LeoKalev
01-22-2009, 02:58 AM
It is possible that the APK code in AppLogic 2.4.5 is buggy. Can you please post the APK version here? You will find it in the file /lib/applogic/apk/version.tag on the appliance. Most likely, you will need to upgrade the APK on your appliance to get this problem fixed. The APK version in AppLogic 2.4.7 should support backslashes and any other character as well - I will double-check this and add a note here later.

For the particular case that you have, you can work around the issue by using [.] instead of \. in your regular expression.

>> Additionally, I wasn't able to find in the documentation how to specify
>> quoting style in case of "dhcp" method of property propagation.

Quoting is not supported at all for now (not in the old 'volfix' method and not in the 'dhcp' method of configuration). Property values are passed verbatim. If your configuration file requires quoting of some meta-characters, you cannot use the automatic update (with instrumentation like # $$propN: ). You will need a custom script to read the property from /var/run/applogic/appliance.conf (or appliance.sh) and update your config file.

Svilen Ivanov
01-22-2009, 03:17 AM
Leo,

I wasn't able to find /lib/applogic/apk/version.tag on the appliance. The only "version.tag" file is /lib/applogic/version.tag which is "2.0.10".

I downloaded latest apk on my grid (yesterday I upgraded to Applogic 2.4.7) from http://10.15.255.254:8080/download/apk-2.0.18-linux-rh.tar.gz. After I extracted the package, I diff-ed /bin/adlfix and <un-tar-ed-dir>/bin/adlfix - they were the same and the bug persists - slashes where stripped.

Also thanks for the regexp advice - I'll check if works with postfix regexp engine (this is regexp access rule in postfix configuration)

Let me know if you want me to provide more information for reproducing the bug.

Svilen Ivanov
01-22-2009, 03:20 AM
Quoting is not supported at all for now (not in the old 'volfix' method and not in the 'dhcp' method of configuration). Property values are passed verbatim.

Oh, I got it. If this is the case I would suggest mentioning it in the documentation: Property Markup Syntax (http://doc.3tera.com/AppLogic24/AdvADLPropertyMarkup.html) and Class Editor -- Simple Appliances > Config files (http://doc.3tera.com/AppLogic24/RefEditorClassEditorSimple.html?configtopic=WebPub lish2;ping=24%20Dec%202008%20-%2013:55#Config_Files)

LeoKalev
01-22-2009, 09:43 AM
Sorry, I mis-quoted the version tag file name. 2.0.10 is very old.

Note that the bug is not in aldfix - if you updated only this file, that won't fix the bug :(

Re-install the entire APK - unpack the archive in the filesystem root directory (/) and run /tmp/apk-install. If you got a new APK, it should be 2.0.18. In this version the \ characters work correctly, I just tested this.

Let me know if updating APK does not solve your problem.