[BlueOnyx:22195] httpd restart of sauce_serviced is locale dependent
Tomohiro Hosaka
bokutin at gmail.com
Tue Jul 3 05:46:01 -05 2018
Hello.
Since when did the problem come out with httpd restart.
I tried to find a problem.
I am using 5208R.
The log when the problem occurs is below.
# less /var/log/message
Jul 3 14:46:01 server1 cced(smd)[11843]: client 6:[49:22172]: CREATE
"Vsite" "createdUser" "=" "admin" "webAliases" "=" "&server2.net&"
"site_preview" "=" "0" "mailAliases" "=" "" "userPrefixField" "=" ""
"domain" "=" "server2.net" "ipaddr" "=" "123.123.123.123" "maxusers" "="
"25" "prefix" "=" "" "emailDisabled" "=" "0" "volume" "=" "/home"
"dns_auto" "=" "1" "fqdn" "=" "www.server2.net" "mailCatchAll" "=" ""
"webAliasRedirects" "=" "1" "userPrefixEnabled" "=" "0" "hostname" "=" "www"
Jul 3 14:46:01 server1 cced(smd)[11843]: handler handlers/base/mailman/
handle_vsite.pl defered
Jul 3 14:46:02 server1 cced(smd)[11843]: client 6:handlers/base/vsite/
vsite_create.pl: SET 224 name = site12 basedir = "/home/.sites/132/site12"
Jul 3 14:46:03 server1 sauce_serviced: : sauce_serviced[11934] ready to
accept requests
Jul 3 14:46:03 server1 pperld /usr/sausalito/handlers/base/vsite/
php_vsite_handler.pl: : Event registered: httpd restart
Jul 3 14:46:03 server1 sauce_serviced: : restart overrides
Jul 3 14:46:03 server1 sauce_serviced: : got event restart
Jul 3 14:46:03 server1 cced(smd)[11843]: client 6:handlers/base/vsite/
vsite_create.pl: SET succeeded
Jul 3 14:46:03 server1 sauce_serviced: : spawned child 11935 for httpd
restart
Jul 3 14:46:03 server1 sauce_serviced: : sub run: Setting up alarm(5).
Jul 3 14:46:03 server1 sauce_serviced: : Performing event: httpd restart
Jul 3 14:46:03 server1 sauce_serviced: : Special case (httpd): restart
Jul 3 14:46:03 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:46:03 server1 sauce_serviced: : _kill_and_restart_apache: Apache
state: 0
Jul 3 14:46:03 server1 sauce_serviced: : _kill_and_restart_apache runs:
/usr/bin/pkill -HUP -x -f /usr/sbin/httpd
Jul 3 14:46:03 server1 cced(smd)[11843]: client 6:handlers/base/vsite/
vsite_create.pl: CREATE ProtectedEmailAlias fqdn = "www.server2.net" site
= site12 build_maps = 0 action = apache alias = apache
Jul 3 14:46:03 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:46:03 server1 sauce_serviced: : xchecker reported: 0 - Apache
restart failed.
Jul 3 14:46:03 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:46:03 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:46:03 server1 sauce_serviced: : _kill_and_restart_apache: Apache
state: 0
Jul 3 14:46:03 server1 sauce_serviced: : _kill_and_restart_apache runs:
/usr/bin/pkill -HUP -x -f /usr/sbin/httpd
Jul 3 14:46:03 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:46:03 server1 sauce_serviced: : 2:checker reports: httpd 0#012
Jul 3 14:46:04 server1 cced(smd)[12029]: client [0:16048] has admin rights
Jul 3 14:46:04 server1 sauce_serviced: : _check_apache_state: Early return
#1
...snip...
Jul 3 14:50:09 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:50:09 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:50:09 server1 sauce_serviced: : _kill_and_restart_apache: Apache
state: 0
Jul 3 14:50:09 server1 sauce_serviced: : _kill_and_restart_apache runs:
/usr/bin/pkill -HUP -x -f /usr/sbin/httpd
Jul 3 14:50:09 server1 sauce_serviced: : _check_apache_state: Early return
#1
Jul 3 14:50:09 server1 sauce_serviced: : 2:checker reports: httpd 0#012
Jul 3 14:50:10 server1 sauce_serviced: : child 18415 unable to complete
event httpd restart. Running am_apache.sh and exiting
After this, httpd may be running or not running.
>From a conclusion, it was resolved with the patch below.
--- /usr/sausalito/perl/Sauce/Service/Daemon.pm.orig 2018-03-06
06:31:14.000000000 +0900
+++ /usr/sausalito/perl/Sauce/Service/Daemon.pm 2018-07-03
17:09:33.000000000 +0900
@@ -170,8 +170,12 @@
}
else {
# Thank God, no Systemd:
- $service_status = `/sbin/service $service status|$grep running|$wc
-l`;
- chomp($service_status);
+ $service_status = system("/sbin/service $service status") == 0 ? 1
: 0;
# yum whatprovides /usr/sausalito/perl/Sauce/Service/Daemon.pm
...snip...
perl-handler-utils-1.4.0-0BX15.el6.x86_64
The problem was that the code above was locale dependent.
# cat /etc/sysconfig/i18n
LANG=ja_JP.utf8
LC_ALL=ja_JP
LINGUAS="en_US da_DK de_DE es_ES fr_FR it_IT ja_JP nl_NL pt_PT"
https://unix.stackexchange.com/questions/226484/does-an-init-script-always-return-a-proper-exit-code-when-running-status
It is possible to use the command below, not the above code to examine the
return code.
env -i NOLOCALE=1 /etc/rc.d/init.d/httpd status
env -i LANG=en_US /etc/rc.d/init.d/httpd status
/etc/sysconfig/i18n seems to be set when changing the language of admin
from BlueOnyx's web console.
I am pleased that a solution to this problem will be merged in 5208R.
Thank you.
--
Tomohiro Hosaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20180703/50c8dfcf/attachment.html>
More information about the Blueonyx
mailing list