| Welcome to the Zimbra :: Forums! | |
Welcome, if you would like to post a comment please register.
We also encourage you to explore all things Zimbra with our team and members of the community.
|  | | 
06-15-2006, 11:14 AM
| | | [SOLVED] Small problem stopping zimbra Hi,
Here is the problem. When I stop zimbra with,
su - zimbra
zmcontrol stop
I get the following,
Host courriel.mydomain.ca
Stopping antispam...Done
Stopping antivirus...Done
Stopping ldap...Done
Stopping logger...Done
Stopping mailbox...Done
Stopping mta...FAILED
Stopping snmp...Done
Stopping spell...Done
the MTA returns it failed to stop. But in /var/log/zimbra.log I get the following,
Jun 15 12:42:46 courriel zimbramon[29471]: 29471:info: Stopping mta
Jun 15 12:44:06 courriel zimbramon[30161]: 30161:info: 2006-06-15 12:44:01, STATUS: courriel.mydomain.ca: mta: Stopped
Jun 15 12:44:32 courriel zimbramon[29636]: 29636:info: Starting mta
Jun 15 12:46:06 courriel zimbramon[31188]: 31188:info: 2006-06-15 12:46:02, STATUS: courriel.mydomain.ca: mta: Running
so indeed, there is no problem. Then if I issue zmcontrol start, all is ok and the server works.
My problem with this is that when the zmcontrol script terminates it returns a false error code 1 to what ever called it instead of 0.
What I'm trying to do is to get zimbra backed up with bacula and get bacula to stop zimbra before the backup, back it up and then start zimbra.
I tested it in VMware on an the same os as what I have on the real server and it works perfectly. Zimbra is stoped and restarted by bacula flawlessly. But in VMware, I don't get the error that MTA failed to stop so zmcontrol returns a0 to bacula.
So How can I get zmcontrol to get the correct infos about the status of the MTA so that bacula will not cancel the job because it receaved an error message from the script used to stop zimbra?
Or how can I check if there is a real problem stopping the MTA?
Thanx! | 
06-15-2006, 10:25 PM
| | Former Zimbran | |
Posts: 5,606
| | Is that all you have in the log?
What about the tomcat log (/opt/zimbra/zimbra.log
jh | 
06-16-2006, 01:49 PM
| | | Thanx wannabetenor for answering,
Of course, this is not all that I get in the log.
I posted this Snip just to mark the pount that postfix was indeed closing and starting properly even thought the zmcontrol script was saying somwthing else.
But anyway, I upgraded to 3.1.2 and the problem seems to be gone.
Thanx anyway!
Have a nice one! | 
06-16-2006, 04:22 PM
| | Zimbra Employee | |
Posts: 78
| | I believe what's happening is that Postfix is taking longer to shut down than zmcontrol expects. I'm not sure if there's a way to fix the problem, since you want to know when a service refuses to shut down. Would it be more intuitive to say something like "The mta service failed to stop within N seconds", rather than "FAILED"? | 
06-21-2006, 06:23 AM
| | | Hello all,
I'm back in this thread because finally I have the same problem again since the update I installed, 3.1.2, but slightly differently.
bburtin, as I noted in my second post, the mta no loger is reported as failed on shutdown with zmcontrol stop from user zimbra. And when I do "echo $?" it sais the script returned "0" as the return code of the execution wich is what I would need to be able to get bacula to run the backup job properly.
BUT, if I run /etc/init.d/zimbra stop, the zimbra services stops effectively but the script returns "1" instead of "0" so since this is the script I have to run from within bacula, the zimbra backup job fails. So I'm basicaly back to square one.
Do you have any ideas or suggestions to give me of what is hapening and how to analyse the script and find out what is failing indeed?
Thanx very much! | 
06-21-2006, 12:44 PM
| | Zimbra Employee | |
Posts: 4,792
| | Try sh -x /etc/init.d/zimbra stop to see who is returning the 1 | 
06-21-2006, 03:07 PM
| | | Thanx Kenvin, I'm trying this right now... | 
06-21-2006, 03:20 PM
| | | Ok so here is what I'm getting:
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra stop
+ command shutdown
+ su - zimbra -c 'zmcontrol shutdown </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra start
+ command startup
+ su - zimbra -c 'zmcontrol startup </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra stop
+ command shutdown
+ su - zimbra -c 'zmcontrol shutdown </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra start
+ command startup
+ su - zimbra -c 'zmcontrol startup </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra stop
+ command shutdown
+ su - zimbra -c 'zmcontrol shutdown </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=1
+ exit 1
courriel:/opt/zimbra/log# echo $?
1
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra start
+ command startup
+ su - zimbra -c 'zmcontrol startup </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log# echo $?
0
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra stop
+ command shutdown
+ su - zimbra -c 'zmcontrol shutdown </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=1
+ exit 1
courriel:/opt/zimbra/log# echo $?
1
courriel:/opt/zimbra/log# sh -x /etc/init.d/zimbra start
+ command startup
+ su - zimbra -c 'zmcontrol startup </dev/null >>/opt/zimbra/log/startup.log 2>&1'
+ RETVAL=0
+ exit 0
courriel:/opt/zimbra/log#
As you can see, the problem is intermittant.
And I just noticed that the problem :
Host courriel.mydomain.ca
Stopping antispam...Done
Stopping antivirus...Done
Stopping ldap...Done
Stopping logger...Done
Stopping mailbox...Done
Stopping mta...FAILED
Stopping snmp...Done
Stopping spell...Done
is back...
Of course I could put at the end of /etc/init.d/zimbra,
"exit 0" instead of the current "exit $RETVAL".
But I don't feel right to do so.
What do you think? | 
06-22-2006, 12:47 AM
| | Zimbra Employee | |
Posts: 4,792
| | I think Boris was on the right track. Seems like a race condition. Maybe try putting in a sleep. | 
06-22-2006, 07:02 AM
| | | Ok,
I added the following sleep 5 in /opt/zimbra/bin/zmmtactl
stop)
for i in $SCRIPTS; do
/opt/zimbra/bin/$i stop sleep 5
done
;;
I'll see if it fixes the problem and report back the results.
Thanx for your hints!
Jonathan | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |