upstart

How to set environment variable in pre-start in Upstart script?

烂漫一生 提交于 2020-01-01 04:38:09
问题 We have a custom C++ daemon application that forks once. So we've been doing this in our Upstart script on Ubuntu 12.04 and it works perfectly: expect fork exec /path/to/the/app However now we need to pass in an argument to our app which contains the number of CPUs on the machine on which it runs: cat /proc/cpuinfo | grep processor | wc -l Our first attempt was this: expect fork exec /path/to/the/app -t `cat /proc/cpuinfo | grep processor | wc -l` While that starts our app with the correct -t

Upstart script for node.js app

▼魔方 西西 提交于 2019-12-31 21:43:48
问题 I'm having trouble starting an Upstart script. Here's the script (app.conf in /etc/init/) description "node.js server" author "kvz" start on startup stop on shutdown script # We found $HOME is needed. Without it, we ran into problems export HOME="/root" exec sudo -u /usr/local/bin/node \ /var/www/vhosts/travelseguro.com/node/app.js \ 2>&1 >> /var/log/node.log end script When I run sudo start app , I get: start: Unknown job: app How can I make this work? 回答1: I was having the same problem

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

柔情痞子 提交于 2019-12-29 10:07:31
问题 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

Run php script in monit

空扰寡人 提交于 2019-12-24 13:24:13
问题 Good day. Is there any way to run a php "my_script.php" script as action in the fall a demon that keeps alive a node.js server? The script to execute deletes records from a table of connected persons: I tried different ways but it does not work me, currently the script that monitors the process is as follows: #monit script set logfile /var/log/monit.log check process nodejs with pidfile "/var/run/mi_server.pid" start program = "/sbin/start mi_server" stop program = "/sbin/stop mi_server" if

Starting a service (upstart) from a shell script, from a cron job

偶尔善良 提交于 2019-12-24 10:38:59
问题 I'm trying to use a cron job to call a healthcheck script I've written to check the status of a web app (api) I've written (a url call doesn't suffice to test full functionality, hence the custom healthcheck). The healthcheck app has several endpoints which are called from a shell script (see below), and this script restarts the bigger web app we are checking. Naturally, I'm having trouble. How it works: 1) cron job runs every 60s 2) healthcheck script is run by cron job 3) healthcheck script

How to define custom templates with foreman's --template option?

只愿长相守 提交于 2019-12-23 11:26:07
问题 While using the foreman gem I'm having some issues where it will not allow me to define a custom template. For one of my apps I am able to define ~/.foreman/templates/upstart/master.conf.erb and it is read just fine. Yet for another project, no matter what I try, I cannot get a template to evoke properly with forman upstart exportation. I've attempted many different ways from defining the -t and --template flag with a file with absolute and relative paths to the ~/.foreman approach. Nothing

Process monitoring - Python/Ubuntu/Linux [closed]

心已入冬 提交于 2019-12-21 06:19:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I have a few processes I need to run in deamon mode, I just discovered upstart so I am starting to use it. Are there any python libraries or applications that I could use to monitor and control these processes from an html interface? I'm asking as I would like to prevent myself from reinventing the wheel. :) Any

how to automatically restart a node server?

被刻印的时光 ゝ 提交于 2019-12-21 03:11:02
问题 We are finishing development of a project, the client is already using it but occasionally some errors occur - crashing the server. I know I could register a service as 'upstart' script on linux, in order to have my node service restart when it crashes. But our server is running other stuff, so we can't restart it. Well, actually, while writing, I realize I have two questions then: Will 'upstart' work without having to reboot? Something is just whispering yes to me :) If not, what other

how to automatically restart a node server?

不问归期 提交于 2019-12-21 03:10:13
问题 We are finishing development of a project, the client is already using it but occasionally some errors occur - crashing the server. I know I could register a service as 'upstart' script on linux, in order to have my node service restart when it crashes. But our server is running other stuff, so we can't restart it. Well, actually, while writing, I realize I have two questions then: Will 'upstart' work without having to reboot? Something is just whispering yes to me :) If not, what other

Need help running Python app as service in Ubuntu with Upstart

江枫思渺然 提交于 2019-12-20 10:34:33
问题 I have written a logging application in Python that is meant to start at boot, but I've been unable to start the app with Ubuntu's Upstart init daemon. When run from the terminal with sudo /usr/local/greeenlog/main.pyw , the application works perfectly. Here is what I've tried for the Upstart job: /etc/init/greeenlog.conf # greeenlog description "I log stuff." start on startup stop on shutdown script exec /usr/local/greeenlog/main.pyw end script My application starts one child thread, in case