upstart

Node.js upstart vs forever

安稳与你 提交于 2019-12-20 09:57:51
问题 I am looking to daemonize my Node.js application. What's the difference between upstart and forever? Also, are there other packages I might want to considering looking at? 回答1: As pointed out in the comments, upstart will be used to start the forever script, since upstart has hooks for system events (like shutdown and startup of your server). The other differences are: Upstart was developed for Linux, while forever is platform-independent. Forever is specific to nodejs, and has some pretty

Increase max open files for Ubuntu/Upstart (initctl)

 ̄綄美尐妖づ 提交于 2019-12-20 09:57:34
问题 This is on an Ubuntu 12.04.3 LTS server. I've added the following to /etc/security/limits.conf (my Golang processes run as root): * hard nofile 50000 * soft nofile 50000 root hard nofile 50000 root soft nofile 50000 I've added the following to /etc/pam.d/common-session session required pam_limits.so I've added the following to /etc/sysctl.conf: fs.file-max = 50000 Yet when I cat /proc/{PID}/limits, I get: Limit Soft Limit Hard Limit Units Max open files 1024 4096 files This happens only when

Setting memory consumption limits with Upstart

被刻印的时光 ゝ 提交于 2019-12-20 09:16:51
问题 I've recently become quite fond of Upstart. Previously I've been using God, Monit and Bluepill but I don't really like these solutions so I'm giving Upstart a try. I've been using the Foreman gem to generate some basic Upstart configuration files for my processes in /etc/init . However, these generated files only handle the respawning of a crashed process. I was wondering whether it's possible to tell Upstart to restart a process that's consuming for example > 150mb of memory, as you would

DOCKER_OPTS do not work in config file /etc/default/docker

狂风中的少年 提交于 2019-12-20 08:59:51
问题 I have changed /etc/default/docker with DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock" (docker version 1.4.1 in ubuntu 14.04), but it do not take any effect for me (not listening at port 2375 ). It seems that docker do not read this initial config file because I found export http_proxy enviroment do not work too. Only sudo docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d works. It really confused me! 回答1: According to docker documentation, The recommended

A better way to restart/reload Gunicorn (via Upstart) after 'git pull'ing my Django projects

若如初见. 提交于 2019-12-20 08:00:30
问题 Im looking for something better than sudo restart projectname every time I issue a git pull origin master , which pulls down my latest changes to a Django project. This restart command, I believe, is related to Upstart, which I use to start/top my Gunicorn server process. This restart causes a brief outage. Users hitting the web server (nginx) will get a 500, because Gunicorn is still restarting. In fact, it seems to restart instantly, but it takes a few seconds for pages to load. Any ideas

Upstart env stanza not setting environment variables (like NODE_ENV) for Node.js application

天涯浪子 提交于 2019-12-18 10:33:55
问题 I have an Upstart script for my server that looks like this: description "myapp node.js server" start on runlevel [2345] stop on shutdown env NODE_ENV=production env CUSTOM=somevalue exec sudo -u nodejs /usr/local/bin/node /opt/myapp/app.js >> /var/log/nodejs/myapp.log 2>&1 post-start script NODE_PID=`status myapp | egrep -oi '([0-9]+)$' | head -n1` echo $NODE_PID > /var/run/nodejs/myapp.pid end script However, the app doesn't see NODE_ENV set to production. In fact, if I console.log(process

Restarting Upstart instance processes

孤街浪徒 提交于 2019-12-18 10:11:47
问题 I am running multiple instances of a worker as described in this answer: Starting multiple upstart instances automatically Question: Can I restart all instances at once? To start my workers I can do: initctl start my-workers Which then allows me to do: initctl status worker N=1 worker (1) start/running, process 551 initctl status worker N=2 worker (2) start/running, process 552 Is there a way to do something like this: initctl restart my-workers I would like to be able to restart all

Restarting Upstart instance processes

人盡茶涼 提交于 2019-12-18 10:10:10
问题 I am running multiple instances of a worker as described in this answer: Starting multiple upstart instances automatically Question: Can I restart all instances at once? To start my workers I can do: initctl start my-workers Which then allows me to do: initctl status worker N=1 worker (1) start/running, process 551 initctl status worker N=2 worker (2) start/running, process 552 Is there a way to do something like this: initctl restart my-workers I would like to be able to restart all

How do I tell celery worker to stop accepting tasks? How can I check if any celery worker tasks are running?

可紊 提交于 2019-12-18 07:12:23
问题 The scenario: System running on a server consisting of a Python/Flask web application and background tasks using Celery Both web application and celery workers are run as upstart jobs (Web app behind Nginx) Deployment to production is done with a script that: Stop the upstart jobs Push code to server Run any db migrations Start the upstart jobs How can I enhance the deployment script so it does the following?: Tell the celery worker to stop accepting tasks Wait until any currently running

Run python script as daemon at boot time (Ubuntu)

岁酱吖の 提交于 2019-12-17 21:56:58
问题 I've created small web server using werkzeug and I'm able to run it in usual python way with python my_server.py . Pages load, everything works fine. Now I want to start it when my pc boots. What's the easiest way to do that? I've been struggling with upstart but it doesn't seem to "live in a background" cuz after I execute start my_server I immediately receive kernel: [ 8799.793942] init: my_server main process (7274) terminated with status 1 my_server.py: ... if __name__ == '__main__': from