How to autostart the odoo server when down

Afghanistan Åland Islands Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Territory British Virgin Islands Brunei Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Caribbean Netherlands Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Cook Islands Costa Rica Croatia Cuba Curaçao Cyprus Czechia Denmark Djibouti Dominica Dominican Republic DR Congo Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Falkland Islands Faroe Islands Fiji Finland France French Guiana French Polynesia French Southern and Antarctic Lands Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea-Bissau Guyana Haiti Heard Island and McDonald Islands Honduras Hong Kong Hungary Iceland India Indonesia Iran Iraq Ireland Isle of Man Israel Italy Ivory Coast Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macau Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia Moldova Monaco Mongolia Montenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island Northern Mariana Islands North Korea North Macedonia Norway Oman Pakistan Palau Palestine Panama Papua New Guinea Paraguay Peru Philippines Pitcairn Islands Poland Portugal Puerto Rico Qatar Réunion Romania Russia Rwanda Saint Barthélemy Saint Helena, Ascension and Tristan da Cunha Saint Kitts and Nevis Saint Lucia Saint Martin Saint Pierre and Miquelon Saint Vincent and the Grenadines Samoa San Marino São Tomé and Príncipe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Sint Maarten Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia South Korea South Sudan Spain Sri Lanka Sudan Suriname Svalbard and Jan Mayen Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Timor-Leste Togo Tokelau Tonga Trinidad and Tobago Tunisia Türkiye Turkmenistan Turks and Caicos Islands Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States United States Minor Outlying Islands United States Virgin Islands Uruguay Uzbekistan Vanuatu Vatican City Venezuela Vietnam Wallis and Futuna Western Sahara Yemen Zambia Zimbabwe Server
Published in Blog on April 17, 2019 2 min read
8_blog_img

When Odoo server is down we have to manually restart the Odoo service. Instead of this autostart Odoo server, when down by using Monit service. It is a helpful program that automatically monitors and manages server programs. Additionally monit comes with a basic web interface through which all of the processes can be set up. Few easy steps to create a script that will automatically start your odoo server when Ubuntu reboots.

Install Monit

Install monit package in our odoo server by terminal

sudo apt-get install monit

Adding Odoo Service in Monit Configuration File

After the installation completed, adding the Odoo service program to monitor into the /etc/monit.conf under RedhHat/CentOS/Fedora and /etc/monit/monitrc file for Ubuntu/Debian/Linux Mint at the services section.

sudo vim /etc/monit/monitrc
check process odoo-server with pidfile /var/run/odoo-server.pid
start program "/etc/init.d/odoo-server start"
stop program "/etc/init.d/odoo-server stop"

And change The control file '/etc/monit/monitrc' permission to 0700. Once configured Odoo service program for monitoring, check if there is any error in monit syntax by the following command,

Starting Monit Service

When will be finishing all configurations finally we will start the monit service.

sudo /etc/init.d/monit start

when Odoo service will down the monit function automatically detect that and restarting the Odoo service.

Status of Monit Service

sudo /etc/init.d/monit status

From this we can know about the status of the monit service and also we can see that Odoo service is monitoring in monit function.

Monit -t

If there  any error occurred correct them. When we get a error free message like “ Control file syntax OK “, then we proceed ahead.

auto start the odoo server when down

As the part of Odoo server maintaining, it is very easy to handle the server in the case of any odoo server failure.

odoo_erp_services

Hi...

Got ideas? We’ve got
the skills. Let’s team up.

Have a question or ready to discuss your project? Our team is here to help you scope, design, and deliver.

Trusted by Leading Businesses
Metro
Zabeel Equstrian
GEMS Logo
APSG Logo
Anisia Logo
Foodlinx Logo
🌐 +1
Select Subject?
send mail graphic