| Summary: | Advanced settings hang | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | Grigory Batalov <bga> |
| Component: | alterator-apache2 | Assignee: | solo <solo> |
| Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P2 | CC: | dubrsl, inger |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
| Bug Depends on: | |||
| Bug Blocks: | 13746, 14698 | ||
|
Description
Grigory Batalov
2007-12-18 14:27:17 MSK
Что-то непонятное:
1. Сам по себе бакенд работает нормально:
$ sudo -H /usr/lib/alterator/backend3/apache2
_message:begin
_objects:extra/available
action:list
_message:end
(
("Directory_cgibin_default" enabled "no" status_def "none" summary "Default
config for CGI directory")
("httpd-mime" enabled "no" status_def "none" summary "Configure the list of
mappings from filename extension to MIME-type.")
("DirectoryIndex_default" enabled "yes" status_def "enable" summary
"DirectoryIndex by default")
("httpd-languages" enabled "yes" status_def "enable" summary "Settings for
hosting different languages.")
("httpd-proxy" enabled "no" status_def "none" summary "proxy_module configure")
("httpd-dav" enabled "no" status_def "none" summary "Distributed authoring and
versioning (WebDAV)")
("httpd-addon.d" enabled "yes" status_def "enable" summary "Load config files
from the config directory "conf/addon.d")
("httpd-manual" enabled "yes" status_def "enable" summary "Provide access to the
documentation on your server")
("httpd-multilang-errordoc" enabled "yes" status_def "enable" summary "The
configuration below implements multi-language error documents through
content-negotiation")
("httpd-default" enabled "yes" status_def "enable" summary "This configuration
file reflects default settings for Apache HTTP Server.")
("mime_magic_default" enabled "no" status_def "none" summary "Default configs
for mime_magic_module")
("httpd-autoindex" enabled "yes" status_def "enable" summary "Directives
controlling the display of server-generated directory listings.")
("httpd-manual-addons" enabled "yes" status_def "enable" summary "Provide access
to the documentation to addons on your server")
("userdir_default" enabled "no" status_def "none" summary "Settings for user
home directories")
("mem_cache_default" enabled "no" status_def "none" summary "Default configs for
mem_cache_module")
("httpd-mpm" enabled "yes" status_def "enable" summary "")
("dav_fs_default" enabled "no" status_def "none" summary "")
("Directory_root_default" enabled "no" status_def "none" summary "Default config
for all dirs")
("Directory_html_default" enabled "no" status_def "none" summary "Default config
for html documents")
("deflate_default" enabled "no" status_def "none" summary "")
("httpd-info" enabled "no" status_def "none" summary "Get information about the
requests being processed by the server and the configuration of the server.")
("disk_cache_default" enabled "no" status_def "none" summary "")
("log_config_default" enabled "yes" status_def "enable" summary "Loging configure")
)
2. После добавления отладочной печати в начало и конец цикла обработки команд, в
логе вижу (после повисшего sudo -H alterator-cmdline apache2/extra/available
action list):
S in_action=list in__objects=extra/available
("Directory_cgibin_default" enabled "no" status_def "none" summary "Default
config for CGI directory")
("httpd-mime" enabled "no" status_def "none" summary "Configure the list of
mappings from filename extension to MIME-type.")
("DirectoryIndex_default" enabled "yes" status_def "enable" summary
"DirectoryIndex by default")
("httpd-languages" enabled "yes" status_def "enable" summary "Settings for
hosting different languages.")
("httpd-proxy" enabled "no" status_def "none" summary "proxy_module configure")
("httpd-dav" enabled "no" status_def "none" summary "Distributed authoring and
versioning (WebDAV)")
("httpd-addon.d" enabled "yes" status_def "enable" summary "Load config files
from the config directory "conf/addon.d")
("httpd-manual" enabled "yes" status_def "enable" summary "Provide access to the
documentation on your server")
("httpd-multilang-errordoc" enabled "yes" status_def "enable" summary "The
configuration below implements multi-language error documents through
content-negotiation")
("httpd-default" enabled "yes" status_def "enable" summary "This configuration
file reflects default settings for Apache HTTP Server.")
("mime_magic_default" enabled "no" status_def "none" summary "Default configs
for mime_magic_module")
("httpd-autoindex" enabled "yes" status_def "enable" summary "Directives
controlling the display of server-generated directory listings.")
("httpd-manual-addons" enabled "yes" status_def "enable" summary "Provide access
to the documentation to addons on your server")
("userdir_default" enabled "no" status_def "none" summary "Settings for user
home directories")
("mem_cache_default" enabled "no" status_def "none" summary "Default configs for
mem_cache_module")
("httpd-mpm" enabled "yes" status_def "enable" summary "")
("dav_fs_default" enabled "no" status_def "none" summary "")
("Directory_root_default" enabled "no" status_def "none" summary "Default config
for all dirs")
("Directory_html_default" enabled "no" status_def "none" summary "Default config
for html documents")
("deflate_default" enabled "no" status_def "none" summary "")
("httpd-info" enabled "no" status_def "none" summary "Get information about the
requests being processed by the server and the configuration of the server.")
("disk_cache_default" enabled "no" status_def "none" summary "")
("log_config_default" enabled "yes" status_def "enable" summary "Loging configure")
E in_action=list in__objects=extra/available
Похоже, что альтератор неможет переворить то что ему возвращает модуль. Раньше
переваривал...
2inger: Нормальный ли вывод даёт модуль (п.1 предыдущего сообщения)? Поковырялся и решил вопрос так:
Дело в кавычках.
Подредактировав файл /etc/httpd2/conf/extra-available/httpd-addon.d.conf
не работает:
Summary: Load config files from the config directory "conf/addon.d"
так работает:
Summary: Load config files from the config directory conf/addon.d
при отправке данных на woo шину:
printf '("%s" enabled "%s" status_def "%s"
summary "%s")\n' "$name" "$en" "$status_def" "$summary"
в поле summary "съедается" одна кавычка:
("httpd-addon.d" enabled "yes" status_def "enable" summary "Load config files
from the config directory "conf/addon.d"), а должно быть
("httpd-addon.d" enabled "yes" status_def "enable" summary "Load config files
from the config directory "conf/addon.d"").
Поковыря дальше, кавычка "съедается" вот здесь /usr/share/alterator/build/apache2.sh а конкретно, в функции get_headers а конкретней в паттерне P_get_Summary, который я расковыривать не стал (In reply to comment #4) > Поковыря дальше, кавычка "съедается" вот здесь > /usr/share/alterator/build/apache2.sh > а конкретно, в функции get_headers > а конкретней в паттерне P_get_Summary, который я расковыривать не стал Спасибо, дальше сам справлюсь. Как оказалось, здесь у меня целый букет багов: 1) кавычки терялись при формировании регулярного выражения; 2) не правильно отбрасывались концевые (они отбрасывались всегда, даже если строка начиналась/заканчивалась закавыченной подстрокой); 3) внутристрочные кавычки передавались alterator`у без экранирования... Тег ALT/alterator-apache2/2.3.4 (см. http://git.altlinux.org/people/solo/packages/?p=alterator-apache2.git;a=commit;h=12ad8aeaba0dc55cea5c531fc02d39abde133f9c) содержит исправленную версию скриптов. Сделано: 1. Поправлено использование кавычек внутри регэкспов (перешёл на bash синтакс -- так проще). 2. Отброс концевых кавычек сделан правильно (происходит только если вся строка заключена в кавычки). 3. Кавычки экранируются при передачи. Пункты 2 и 3 на данный момент сделаны только для части полей (пока _не_ для всех). hint: libshell. (In reply to comment #7) > hint: libshell. > Прошу подробностей... $ apt-cache search libshell libshell - A library of shell functions Там много велосипедов по правильному квотированию (In reply to comment #9) > $ apt-cache search libshell > libshell - A library of shell functions > > Там много велосипедов по правильному квотированию > Спасибо. alterator-apache2-2.3.5-alt1.src.rpm (см. http://git.altlinux.org/people/solo/packages/?p=alterator-apache2.git;a=commit;h=9feff59eec02bfff4136fd8e8580d6acd819b1c1) ушёл в incoming/Sisyphus. |