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
2
votes
1 answer

Amazon EC2 Ubuntu and upstart logging permissions

I have set up this upstart script on a Amazon Ec2 Ubuntu 12.04 TLS instance for executing a node.js application. The script uses setuid and setgid. It works fine without using setuid and setgid but when I use them if fails because the process can't…
2
votes
2 answers

Celery with Upstart - processes are dying unexpectedly

When I'm running Celery with Upstart, after a while, the child processes or the main processes die without any trace. The Upstart script I'm using (/etc/init/celery): description "celery" start on runlevel [2345] stop on runlevel [!2345] kill…
yprez
  • 183
  • 1
  • 10
2
votes
3 answers

Run upstart after all other init scripts have started

I'm running a CentOS6 instance and have an upstart job that depends on sshd to already be running. However when I boot up the box that job fails to start, I'm guessing because sshd isn't actually running yet. Is there a way I can delay upstart jobs…
Mediocre Gopher
  • 803
  • 1
  • 13
  • 24
2
votes
1 answer

Mysql with upstart not starting

After an update this morning we are having some strange problems. First of all apt-get upgrade fails during the configuration with the a message that it was unable to start the service. We then attempted dpkg-reconfigure, apt-get purge followed by…
cdecker
  • 411
  • 2
  • 5
  • 18
2
votes
3 answers

Why is Upstart not starting uWSGI?

I am trying to set up a django project on my VPS. I am trying to get a uWSGI Emperor to run and thus spawn vassals. I have set up all my config files as suggested by numerous websites including the uWSGI documentation. Yet when I run the file…
Paul
  • 161
  • 1
  • 1
  • 7
2
votes
1 answer

Execute gitlab sidekiq (rake task) with upstart

I'm trying start the gitlab sidekiq daemon through upstart. But unfortunately it seems that the sidekiq worker is respawned since sidekiq start deamonizes itself: Jul 12 17:26:42 git kernel: [370722.042968] init: gitlab-sidekiq main process (28251)…
Pascal
  • 320
  • 2
  • 12
2
votes
0 answers

Ubuntu upstart service hangs

I am trying to have the jenkins java application run at startup, run as the jenkins user. I have a upstart conf file located at /etc/init/jenkins.conf with the following inside it. description "Jenkins daemon" start on startup stop on…
John
  • 121
  • 1
2
votes
2 answers

How to set a binary to init on boot like Apache does (run as a service)

I am trying to setup PhantomJS to run as a service. I found the skeleton file in /etc/init.d and I am running on Ubuntu 12.10. In trying to figure this out I found the symlinks in the /etc/rc*.d directories and found that Apache runs at run levels 2…
Patrick
  • 190
  • 10
2
votes
1 answer

Is it necessary to monitor the PID of proccesses?

In some tutorials I've seen the following snippet for monitoring processes with PID: check process nodejs with pidfile "/var/run/yourprogram.pid" start program = "/sbin/start myapp" stop program = "/sbin/stop myapp" if failed port 8000…
Erik
  • 203
  • 2
  • 5
  • 14
2
votes
3 answers

Ubuntu Server: Running processes at boot time

How do I make Ubuntu Servers run services at boot time, in a specific order? I have read a bit about Upstart, init.d and inittab, and I'm not sure what's the right approach for doing it. Thanks, Udi
Adam Matan
  • 13,194
  • 19
  • 55
  • 75
2
votes
2 answers

Why need to use exec in upstart script?

I often see some upstart script has the to use exec, what is the point? Seems removing the exec the script also work? e.g. start on runlevel [2345] stop on runlevel [06] exec /path/to/program
Ryan
  • 5,831
  • 24
  • 72
  • 91
2
votes
4 answers

Upstart script vs. command-line: why this difference in behavior?

I'm trying to set up Tomcat to start with upstart. I find the following works: description "Tomcat Server" start on runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 setuid tomcat env…
Bosh
  • 95
  • 2
  • 8
2
votes
0 answers

Upstart: Repeat a task as a service

I have a number of services in init.d that are simple one-line commands wrapped in a script that repeats every few seconds. The template for them looks like this: e.g. #!/bin/sh autostart() { while true do $@ ; sleep 20 …
2
votes
1 answer

why does upstart start on not work as expected

i have two upstart scripts, and i want the second one to start after the first this is what i have in the second one (dir/second): start on (started runlevel [345] and dir/first) stop on (stopped dir/first or runlevel [0126]) fyi both scripts are…
b0x0rz
  • 101
  • 1
  • 1
  • 5
2
votes
2 answers

Is upstart for starting a service, and supervisord to monitor it?

Is there some overlap in functionality between upstart and supervisord? I have a java process that I need to start at boot up, and also monitor this process to make sure it stays running (try and restart it if it goes down). Could I use upstart for…
Blankman
  • 2,891
  • 10
  • 39
  • 68