upstart

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

余生长醉 提交于 2019-12-02 18:40:18
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! According to docker documentation , The recommended way to configure the daemon flags and environment variables for your Docker daemon is to use a systemd

Setting memory consumption limits with Upstart

夙愿已清 提交于 2019-12-02 18:15:30
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 with Monit, God or Bluepill. I read through the Upstart docs and this looks like the thing I'm looking

how to set mogodb in upstart service with authentication

回眸只為那壹抹淺笑 提交于 2019-11-30 21:31:49
问题 I have created a superuser tom in mongodb v2.6.11 with username & password and now i want to add this at ubuntu startup service on searching came to know that i have to edit below file this is how my /etc/init/mongod.conf looks pre-start script mkdir -p /var/lib/mongodb/ mkdir -p /var/log/mongodb/ end script start on runlevel [2345] stop on runlevel [06] script ENABLE_MONGOD="yes" CONF=/etc/mongod.conf DAEMON=/usr/bin/mongod DAEMONUSER=${DAEMONUSER:-mongodb} if [ -f /etc/default/mongod ];

Upstart node.js working directory

别来无恙 提交于 2019-11-30 11:49:10
Starting Node.js with Upstart, when trying to access files within Node.js it cannot access them without using the full path. I need it to use the working directory. start on startup stop on shutdown script echo $$ > /var/run/mynodeapp.pid exec sudo -u mynodeapp node server.js >> /var/log/mynodeapp.sys.log 2>&1 end script pre-start script echo "Starting" >> /var/log/mynodeapp.sys.log end script pre-stop script rm /var/run/mynodeapp.pid echo "Stopping" >> /var/log/mynodeapp.sys.log end script The solution is to change directory within the script. In my case, the user is mynodeapp and the node

Starting multiple upstart instances automatically

☆樱花仙子☆ 提交于 2019-11-30 10:20:31
问题 We use PHP gearman workers to run various tasks in parallel. Everything works just fine, and I have silly little shell script to spin them up when I want them. Being a programmer (and therefore lazy), I wanted to see if I could spin these up via an upstart script. I figured out how to use the instance stanza, so I could start them with an instance number: description "Async insert workers" author "Mike Grunder" env SCRIPT_PATH="/path/to/my/script" instance $N script php $SCRIPT_PATH/worker

Running services (upstart/init.d) in a container

我只是一个虾纸丫 提交于 2019-11-30 03:03:06
问题 I'm trying to launch a system in docker that has many init and upstart services and I get this error. initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused All the workarounds suggest making a hard link to /bin/true to silence the error. But I need to have these services managed by upstart for restart-ability and for upstart emit events to work... As it seems docker does not support this, I'm considering the gross hack of writing a script

Restarting Upstart instance processes

霸气de小男生 提交于 2019-11-29 20:21:58
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 instances without having to know how many are running. Here is my my-workers.conf start on stopped cloud-init

Starting multiple upstart instances automatically

╄→гoц情女王★ 提交于 2019-11-29 19:53:46
We use PHP gearman workers to run various tasks in parallel. Everything works just fine, and I have silly little shell script to spin them up when I want them. Being a programmer (and therefore lazy), I wanted to see if I could spin these up via an upstart script. I figured out how to use the instance stanza, so I could start them with an instance number: description "Async insert workers" author "Mike Grunder" env SCRIPT_PATH="/path/to/my/script" instance $N script php $SCRIPT_PATH/worker.php end script And this works great, to start them like so: sudo start async-worker N=1 sudo start async

Ubuntu, upstart, and creating a pid for monitoring

你说的曾经没有我的故事 提交于 2019-11-29 19:46:43
Below is a upstart script for redis. How to I create a pid so I use monit for monitoring? #!upstart description "Redis Server" env USER=redis start on startup stop on shutdown respawn exec sudo -u $USER sh -c "/usr/local/bin/redis-server /etc/redis/redis.conf 2>&1 >> /var/log/redis/redis.log" If start-stop-daemon is available on your machine, I would highly recommend using it to launch your process. start-stop-daemon will handle launching the process as an unprivileged user without forking from sudo or su ( recommended in the upstart cookbook ) AND it also has built in support for pid file

Is there benefit to using Monit instead of a basic Upstart setup?

孤人 提交于 2019-11-29 18:41:42
I'm configuring my server to run node.js as a daemon. I've setup Upstart to handle startup and shutdown of node, which works wonderfully. The next step is to make sure that node.js is restarted if it dies. A few of the guides have suggested using Monit (or Fugue ) to monitor the process (in Monit's case by doing an HTTP request to the server and waiting for a response). I'm happy to use something like Monit or Fugue, but I'm not sure why one wouldn't (or couldn't) just use Upstart's respawn feature . I assume Upstart will monitor the PID of the launched process and just kick it off again if it