restart error handler

This commit is contained in:
Serghey Rodin 2014-02-06 11:11:45 +02:00
commit 477934825c
66 changed files with 297 additions and 9 deletions

View file

@ -74,6 +74,9 @@ increase_user_value $user '$U_CRON_JOBS'
# Restart crond
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "added cron job $job"

View file

@ -46,6 +46,9 @@ sync_cron_jobs
# Restart crond
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "enabled cron reporting"

View file

@ -162,6 +162,9 @@ increase_user_value "$user" '$U_DNS_RECORDS' "$records"
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -107,6 +107,9 @@ increase_user_value "$user" '$U_DNS_RECORDS'
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -152,7 +152,13 @@ fi
# Restart web server
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "added system ip address $ip" '' 'admin'

View file

@ -176,6 +176,9 @@ chmod 660 $USER_DATA/web.conf
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -103,7 +103,14 @@ increase_user_value "$user" '$U_WEB_ALIASES'
# Adding task to the vesta pipe
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
log_history "added $dom_alias as alias for $domain"

View file

@ -103,6 +103,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
log_history "enabled proxy support for $domain"

View file

@ -126,6 +126,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL' "yes"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -65,6 +65,9 @@ sync_cron_jobs
# Restart crond
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "changed cron job $job"

View file

@ -70,6 +70,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -64,6 +64,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -88,6 +88,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -63,6 +63,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -98,6 +98,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -70,6 +70,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -77,6 +77,9 @@ fi
# Restart ftp server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-ftp
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -87,7 +87,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -94,6 +94,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restart web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -71,7 +71,14 @@ fi
# Restart web server
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "changed ssl certificate for $domain"

View file

@ -71,7 +71,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME' "$SSL_HOME"
# Restart web server
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "changed ssl home for $domain to $ssl_home"

View file

@ -96,6 +96,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$TPL' "$template"
# Restart web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -54,6 +54,9 @@ decrease_user_value "$user" '$U_CRON_JOBS'
# Restart crond
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "deleted cron job $job"

View file

@ -46,6 +46,9 @@ sync_cron_jobs
# Restart crond
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "disabled cron reporting"

View file

@ -75,6 +75,9 @@ decrease_user_value "$user" '$U_DNS_RECORDS' "$records"
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -43,6 +43,9 @@ done
# Restart named
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_event "$OK" "$EVENT"

View file

@ -46,6 +46,9 @@ done
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -69,6 +69,9 @@ decrease_user_value "$user" '$U_DNS_RECORDS'
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -39,7 +39,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
if [ ! -z "$check_web" ]; then
$BIN/v-delete-web-domain $user $domain
if [ $? -ne 0 ]; then
exit $?
exit E_RESTART
fi
fi
fi
@ -50,7 +50,7 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then
if [ ! -z "$check_dns" ]; then
$BIN/v-delete-dns-domain $user $domain
if [ $? -ne 0 ]; then
exit $?
exit E_RESTART
fi
fi
fi
@ -61,7 +61,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then
if [ ! -z "$check_mail" ]; then
$BIN/v-delete-mail-domain $user $domain
if [ $? -ne 0 ]; then
exit $?
exit E_RESTART
fi
fi
fi

View file

@ -121,7 +121,14 @@ fi
# Adding task to the vesta pipe
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
# Logging
log_history "deleted system ip address $ip"

View file

@ -154,7 +154,14 @@ fi
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -101,7 +101,14 @@ decrease_user_value "$user" '$U_WEB_ALIASES'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -80,6 +80,9 @@ fi
# Restart proxy server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -92,7 +92,14 @@ decrease_user_value "$user" '$U_WEB_SSL'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -45,7 +45,14 @@ done
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -72,6 +72,9 @@ chmod 660 $USER_DATA/dns.conf
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -47,6 +47,9 @@ echo "$data" >> $USER_DATA/dns/$domain.conf
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns $restart
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -50,6 +50,9 @@ fi
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -43,6 +43,9 @@ sync_cron_jobs
# Restart crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -78,6 +78,9 @@ update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns "$restart"
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -78,6 +78,9 @@ update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -148,7 +148,14 @@ update_user_value "$user" '$U_WEB_ALIASES' "$user_aliases"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -56,6 +56,7 @@ if [ $? -ne 0 ]; then
/etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $DNS_SYSTEM restart failed"
exit $E_RESTART
fi
fi

View file

@ -48,6 +48,7 @@ fi
/etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $FTP_SYSTEM restart failed"
exit $E_RESTART
fi

View file

@ -49,6 +49,7 @@ fi
/etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $MAIL_SYSTEM restart failed"
exit $E_RESTART
fi

View file

@ -45,13 +45,11 @@ if [ -z "$PROXY_SYSTEM" ]; then
fi
# Restart system
/etc/init.d/$PROXY_SYSTEM reload >/dev/null 2>&1
/etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
exit $E_RESTART
fi
send_email_report
echo "Error: $PROXY_SYSTEM restart failed"
exit $E_RESTART
fi
# Update restart queue

View file

@ -53,6 +53,7 @@ if [ "$WEB_SYSTEM" == 'apache2' ]; then
/etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $WEB_SYSTEM restart failed"
exit $E_RESTART
fi
fi
@ -62,6 +63,7 @@ else
/etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $WEB_SYSTEM restart failed"
exit $E_RESTART
fi
fi

View file

@ -372,7 +372,15 @@ if [ "$web" != 'no' ]; then
# Restart WEB
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
echo
msg="$msg\n"
fi
@ -482,6 +490,10 @@ if [ "$dns" != 'no' ]; then
# Restart DNS
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
echo
msg="$msg\n"
fi
@ -695,6 +707,10 @@ if [ "$cron" != 'no' ]; then
# Restart cron
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
echo
msg="$msg\n"
fi

View file

@ -49,6 +49,9 @@ sync_cron_jobs
# Restart crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -44,6 +44,9 @@ done
# Restart crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -49,6 +49,9 @@ increase_user_value "$user" '$SUSPENDED_DNS'
# Restart named
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -45,6 +45,9 @@ done
# Restart dns server
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -63,6 +63,9 @@ update_domain_zone
# Restart named
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -71,8 +71,19 @@ fi
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Changing suspend value

View file

@ -91,7 +91,14 @@ increase_user_value "$user" '$SUSPENDED_WEB'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -45,6 +45,14 @@ done
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -49,6 +49,9 @@ sync_cron_jobs
# Restart crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -44,6 +44,9 @@ done
# Restart crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -51,6 +51,9 @@ sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf
# Restart named
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -45,6 +45,9 @@ done
# Restart dns server
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -62,6 +62,9 @@ update_domain_zone
# Restart named
#if [ "$restart" != 'no' ]; then
# $BIN/v-restart-dns
# if [ $? -ne 0 ]; then
# exit E_RESTART
# fi
#fi
# Logging

View file

@ -73,8 +73,19 @@ decrease_user_value 'admin' '$SUSPENDED_USERS'
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-cron
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -88,7 +88,14 @@ decrease_user_value "$user" '$SUSPENDED_WEB'
# Restart web erver
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -46,6 +46,14 @@ done
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Logging

View file

@ -53,6 +53,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
/etc/$PROXY_SYSTEM/conf.d/$new.conf
sed -i "s/$old/$new/g" /etc/$PROXY_SYSTEM/conf.d/$new.conf
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
if [ ! -z "$WEB_SYSTEM" ]; then
mv /etc/$WEB_SYSTEM/conf.d/$old.conf \
@ -65,6 +68,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
$BIN/v-rebuild-web-domains $user no
done
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
if [ ! -z "$DNS_SYSTEM" ]; then
@ -75,6 +81,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
$BIN/v-rebuild-dns-domains $user no
done
$BIN/v-restart-dns
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# No further comparation is needed

View file

@ -64,7 +64,14 @@ done
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit E_RESTART
fi
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit E_RESTART
fi
fi
# Delete tmpdir