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

How to differentiate between start/stop/status in upstart

upstart has post-start, post-stop, etc... and script. as i understood, the script part gets executed on initctl start X or initctl stop X or initctl status X. so how do i know in script which one was called - start or stop?
b0x0rz
  • 101
  • 1
  • 5
0
votes
2 answers

upstart - Execute a specific command only on system startup and not on application startup

I'm new to upstart, and I would like to know if there's a way to tell upstart to execute a specific command only at system startup, and not when the application is subsequently restarted from the command line. For example, I have the following…
Mark
  • 442
  • 5
  • 12
0
votes
1 answer

Upstart can't determine my process' pid

I'm writing an upstart script for a small service I've written for my colleagues. My upstart job can start the service, but when it does it only outputs queryqueue start/running; note the lack of a pid as given for other services.…
sirlark
  • 211
  • 2
  • 12
0
votes
2 answers

Upstart job (haproxy)

I am starting HA proxy using the following command: sudo etc/init.d/haproxy start and I stop HA proxy using: sudo etc/init.d/haproxy stop How can I write a basic upstart script for sudo etc/init.d/something start or stop ?
Vladimir
  • 75
  • 1
  • 9
0
votes
1 answer

Upstart Script for haproxy

I am new to HA Proxy and Upstart Scripting. I am using, HA Proxy version 1.4.18 2011/09/16. I am trying to write an upstart script that will keep haproxy alive in case haproxy dies. This is what I have so far: script if [ $(pgrep haproxy) ];…
Vladimir
  • 75
  • 1
  • 9
0
votes
1 answer

Upstart - run a command as another user while preserving /etc/environment

G'day, I'm trying to run a command/service on startup with Upstart as a non-privileged user, while preserving /etc/environment. I had some luck in a shell with exec sudo -u user1 -i "/usr/bin/foo /opt/bar >> /var/log/bar.log 2>&1" However, Upstart…
Daniel
  • 1
0
votes
1 answer

Sending signals to running Upstart job

How can I send signals or events to a running Upstart job? I run a Node.js HTTP server with Upstart as a daemon and sometimes need to put it into maintenance mode for backups and stuff. I'd like to send a signal to the node process, which then will…
buschtoens
  • 169
  • 11
0
votes
1 answer

How can I restore initctl?

Assume I was dumb enough to accidentally unlink /sbin/initctl. How can I restore it?
buschtoens
  • 169
  • 11
0
votes
1 answer

EC2 Upstart job: Stop on runlevel never called pre-stop

I'm using EC2 and I have a pre-stop script that is calling curl. From what I can tell the curl never gets called. I'm trying to do stop on shutdown or stop on runlevel [056]. Neither seem actually call the pre-stop script when I shutdown the EC2…
Justin Thomas
  • 302
  • 1
  • 2
  • 10
0
votes
0 answers

ubuntu nginx running twice -- cannot kill extra process

Fresh Ubuntu 12.04 instance running on Amazon EC2 got Nginx running with Passenger added an upstart script description "NGiNX starter" start on (local-filesystems and runlevel [2345]) stop on runlevel [016] respawn exec /etc/nginx/sbin/nginx the…
Alvin
  • 121
  • 1
  • 9
0
votes
1 answer

Install Sphinx Search on my Virtual Private Server

I'm trying to install sphinxsearch on a Virtual Private Server that is running Debian GNU/Linux. It seems to depend on upstart-job. Here is the output I get when I try and run the installer. [ps64518]$ sudo dpkg -i…
vicatcu
  • 151
  • 6
0
votes
1 answer

Upstart: running app from home folder

I've created two user accounts for two applications: mongod and node.js. Both of these store their data in their home folder. This keeps data "sandboxed" and prevents them from needing to be in the sudoers / admin file. However, I have read that the…
Tom
  • 601
  • 2
  • 8
  • 15
0
votes
1 answer

Can I use Upstart to start a script which requires the user's X session?

I wrote a script which greps through the output of synclient to determine whether a laptop's touchpad has miraculously turned itself off (Ubuntu seems to /love/ doing this recently) and, if so, turns it back on. The script is something like…
ledneb
  • 169
  • 6
0
votes
1 answer

Upstart output pre-start script content

Based on the content of the Ubuntu init.d script to control nginx instances, found at : http://wiki.nginx.org/Nginx-init-ubuntu I'm trying to update Upstart version, found at: http://wiki.nginx.org/Upstart to make the configuration syntax…
0
votes
1 answer

Node.js doesn't load after reboot using upstart on debian squeeze

I have been dabbling with Node.js lately, and I came across this article on how to get it to start automatically after a reboot: http://howtonode.org/deploying-node-upstart-monit In particular, the article recommends that I use upstart (I'm running…
James Nine
  • 173
  • 1
  • 7
1 2 3
18
19