首页IT科技checkups什么意思(Check to see if python script is running Stack Overflow)

checkups什么意思(Check to see if python script is running Stack Overflow)

时间2025-05-04 11:27:05分类IT科技浏览4962
导读:Check to see if python script is running up vote 8 down vote favorite 7 share [g+] share [fb] share [tw] I have a python daemon running as a part of my web app/ How c...

Check to see if python script is running up vote 8 down vote favorite 7 share [g+] share [fb] share [tw] I have a python daemon running as a part of my web app/ How can I quickly check (using python) if my daemon is running and, if not, launch it? I want to do it that way to fix any crashes of the daemon, and so the script does not have to be run manually, it will automatically run as soon as it is called and then stay running. How can i check (using python) if my script is running?Monitor and restart Apache or lighttpd webserver when daemon is killed by VIVEK GITE on NOVEMBER 21, 2006 · 46 COMMENTS When you cannot monitor your server for service availability, it is better to take help of automated monitor and restart utility. Last 4 days I was away from my server as I was enjoying my vacation. During this time due to load my lighttpd webserver died but it was restarted automatically within 2 minutes. I had utility configured for monitoring services on a Linux system called monit. It offers all features you ever needed for system monitoring and perform error recovery for UNIX like system. Before monit I had my own shell and perl script for monitoring service. If service failed script will try to restart service and send an automated email to me. However monit is a superior solution. monit is a utility for managing and monitoring processes, files, directories and devices on a Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. For example, monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses to much resources. You may use monit to monitor files, directories and devices for changes, such as timestamps changes, checksum changes or size changes. You may also use monit to monitor files, directories and devices on localhost. Monit can monitor these items for changes, such as timestamps changes, checksum changes or size changes. This is also useful for security reasons you can monitor the md5 checksum of files that should not change. Personally, I always install and configure monit on all boxes which are under my control. Install monit under Debian or Ubuntu Linux Use apt-get command to install monit # apt-get install monit OR $ sudo apt-get install monit Install monit under Red Hat enterprise Linux / CentOS Linux (source code installation) Many distributions include monit. However monit is not included in official Red hat enterprise Linux. Just download monit source code from official web site using wget command: # cd /opt # wget http://www.tildeslash.com/monit/dist/monit-4.8.2.tar.gz Untar monit # tar -zxvf monit-4.8.2.tar.gz # cd monit-4.8.2 Configure and compile monit: # ./configure # make Install monit # make install Copy monit configuration file: # cp monitrc /etc/monitrc By default monit is located at /usr/local/bin/monit How do I Configure monit? monitrc is name of monit configuration file and it is by default located at /etc/monitrc location. However each distribution places file in different location: . => Source code installation : /etc/monitrc => Debian / Unentu Linux installation : /etc/monit/monitrc Open monit configuration file and setup values as follows: # vi /etc/monitrc a) Run it as daemon and check the services (such as web, mysql, sshd) at 2-minute intervals. set daemon 120 b) Set syslog logging with the daemon facility:

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
“毕业设计”(毕业设计学习锋迷商城的的笔记(手写后台商品管理,分类管理,用户,地址管理系统)) 科技型中小企业为什么需要SEO?(掌握SEO技巧,提高企业能见度)