hi, tell me, is it possible to configure the zmailboxdctl service so that when it falls, it restarts itself? The service crashes once a day.
Best regards, Dimon.
Automatically restart the service
Re: Automatically restart the service
You should start by finding out why the service is failing and fix that problem, my server is up for months-on-end and I see no such problem with any ZCS services. Just restarting the service continually is not the answer to your problem but If you really want to go down the restart 'route' then you can use something like monit.
Re: Automatically restart the service
phoenix wrote:You should start by finding out why the service is failing and fix that problem, my server is up for months-on-end and I see no such problem with any ZCS services. Just restarting the service continually is not the answer to your problem but If you really want to go down the restart 'route' then you can use something like monit.
This is clear to me, what data should I provide to help me, because I don’t know how to fix it?
Best regards, Dimon
Re: Automatically restart the service
Who cares, here are your "crutches":
Two files
check_proc.sh
scr.sh
crontab -e
*/3 * * * * /bin/bash /opt/store/scr.sh > /tmp/backup.log 2>&1
It's works
Two files
check_proc.sh
Code: Select all
#!/bin/bash
ps_out=`/opt/zimbra/bin/zmcontrol status | grep $1 | grep -v 'grep' | grep -v $0`
result=$(echo $ps_out | grep "$1" | grep "$2")
if [[ "$result" != "" ]];then
echo "true"
else
echo "false"
fi
scr.sh
Code: Select all
#!/bin/bash
if [[ "$(/bin/sh /opt/store/check_proc.sh mailbox Running)" == "false" ]];then
/opt/zimbra/bin/zmmailboxdctl restart > /dev/null &
fi
*/3 * * * * /bin/bash /opt/store/scr.sh > /tmp/backup.log 2>&1
It's works