Questions tagged [upstart]

Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.

Upstart was created due to fundamental limitations in existing systems. Those systems can be categorized into two types:

  • System V init system
  • Dependency-based init systems

It was necessary to outline the limitations of the SysV and dependency-based init systems to appreciate why Upstart is special...

Upstart is revolutionary as it recognises and was designed specifically for a dynamic system. It handles asynchronicity by emitting events. This too is revolutionary.

Upstart emits "events" which services can register an interest in. When an event -- or combination of events -- is emitted that satisfies some service's requirements, Upstart will automatically start or stop that service. If multiple jobs have the same "start on" condition, Upstart will start those jobs ''in parallel''. To be manifest: Upstart handles starting the "dependent" services itself - this is not handled by the service file itself as it is with dependency-based systems.

Further, Upstart is being guided by the ultimate arbiter of hardware devices: the kernel.

In essence, Upstart is an event engine: it creates events, handles the consequences of those events being emitted and starts and stops processes as required. Like the best Unix software, it does this job very well. It is efficient, fast, flexible and reliable. It makes use of "helper" daemons (such as the upstart-udev-bridge and the upstart-socket-bridge) to inject new types of events into the system and react to these events. This design is sensible and clean: the init system itself must not be compromised since if it fails, the kernel panics. Therefore, any functionality which is not considered "core" functionality is farmed out to other daemons.

See more at The Upstart cookbook

284 questions
10
votes
1 answer

Using Upstart to Manage AutoSSH Reverse Tunnel

I'm using upstart to manage a reverse SSH tunnel via autossh. When I do a "sudo start tunnel" the connection comes up just fine; however the command is not being automatically run when the networking services are started, and no matter what I change…
Nuri Hodges
  • 381
  • 3
  • 12
10
votes
1 answer

What signal does upstart/initctl use to restart a job?

What signal will upstart/initctl use to restart a job? Furthermore, is there any way to specify that SIGHUP should be used? Alternately, is there a way to define a custom reload command that will send a SIGHUP? Or do I need to go outside of upstart…
David Eyk
  • 667
  • 1
  • 7
  • 17
9
votes
4 answers

"sudo service nginx start" fails but "sudo nginx" works - can't figure out why

I have a server that is close to new and having a problem with getting nginx to start as expected. I have configured another server basically the same way and it works there. I figure there must be some environmental difference between the two, but…
Paul Hardwick
  • 167
  • 1
  • 1
  • 10
9
votes
7 answers

How can I start nginx via upstart?

Background: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS" I've built nginx, and I'd like to use upstart to start it: nginx upstart script from the site: description "nginx http daemon" start…
chiggsy
  • 1,576
  • 1
  • 15
  • 20
8
votes
7 answers

Restarting MongoDB automatically if it crashes

I am running MongoDB on an Ubuntu server. It's using an upstart script to start mongod when the machine boots. I noticed that if the process crashes, it doesn't get restarted. How can I make sure that if it crashes, the mongod process is restarted?
Flavien
  • 357
  • 1
  • 2
  • 8
8
votes
2 answers

How to define different stop/restart signals with upstart

I am starting to convert all of our systems to using upstart to manage our various application processes. One thing that I am constantly missing is the ability to send a different signal to the process on stop or restart events. For instance, we…
localshred
  • 183
  • 1
  • 5
8
votes
2 answers

Running Upstart user jobs on startup

I am running Ubuntu server 11.04. I have created an Upstart user job as described here. I have the following file at my /home/myuser/.init/sensors.conf: start on started mysql stop on stopping mysql chdir /home/myuser/mydir/project exec…
dgel
  • 275
  • 3
  • 5
7
votes
1 answer

start on vagrant-mounted (upstart) equivalent in systemd

I have a Vagrant box running Ubuntu 15.04, which has an upstart script that starts a service when the system boots. It has a start on vagrant-mounted stanza because the service requires that the /vagrant directory be mounted by Vagrant. I am now…
TJ Mazeika
  • 173
  • 4
7
votes
3 answers

Environment variable not being picked up by app when started with Upstart (Ubuntu)

How does one go about getting a new environment variable picked up system-wide without restarting the server? As its an Ubuntu 11.x server, I'm using Upstart to start/restart processes. I added a new environment variable to /etc/environment that…
Geuis
  • 625
  • 3
  • 8
  • 17
7
votes
3 answers

How to start a rake task using upstart

I'm trying to setup a Resque worker as an Upstart init script to be used by Monit in a Rails app. I'm not a sysop and I've tried to write this using examples from other init script we have on our server, here's what I got: start on startup stop on…
Nicolas Buduroi
  • 275
  • 3
  • 10
7
votes
3 answers

Ubuntu Upstart script hangs on start and stop

I have an upstart script that will start a custom jetty server. When I do sudo start [myservice] nothing happens. Subsequently, sudo status [myservice] show it as: [myservice] start/killed, process 3586. Here's the script in…
Simon Woodside
  • 456
  • 1
  • 7
  • 15
6
votes
1 answer

Do we need to explicitly pass php.ini's location to php-fpm?

I am seeing a strange issue where my php.ini is not used if I do not explicitly pass it to php-fpm when starting it. This is the upstart script I am using: start on (filesystem and net-device-up IFACE=lo) stop on runlevel [016] pre-start script …
F21
  • 696
  • 3
  • 10
  • 20
6
votes
1 answer

Upstart: stop on runlevel [016] vs stop on starting rc RUNLEVEL=[016]

So, I'm working on an upstart init script for mysql. Should be trivial, right? My stop stanza looks like: kill timeout 30 stop on runlevel [016] I shutdown now -r, and mysql yells about my MyISAM tables being crashed, just like I'd kill -9'd my…
Nate
  • 229
  • 4
  • 9
6
votes
1 answer

Equivalent for the "pid file" stanza in newer versions of upstart

I'd like to be able to use upstart to manage daemons where I don't have complete control over the forking behaviour. The "pid" stanza is removed as of version 0.3.9, so I can't point it at a pid file. What is the correct way to go about this? Do I…
mispy
  • 171
  • 1
  • 3
6
votes
3 answers

cant get upstart script for node.js program to start on startup

I made a rather simple startup script for my node.js program that should run on startup: start on startup stop on shutdown script exec sudo -u max WEBSITES_DIR=/home/max/websites/ /usr/local/bin/node /home/max/websites/server.js 2>&1 >>…
Max
  • 471
  • 1
  • 8
  • 17
1
2
3
18 19