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
3
votes
3 answers

Comprehensive guide to init.d scripts?

I'm looking for good resources to learn more about how to write/debug/maintain init.d scripts on Ubuntu. Do you have any links or books to recommend ?
Thibaut Barrère
  • 691
  • 1
  • 9
  • 17
3
votes
3 answers

upstart not working

I saved the following file at /etc/init/nodejs.conf description "node.js server" author "dorelal" start on startup stop on shutdown script # We found $HOME is needed. Without it, we ran into problems export HOME="/root" exec…
user36318
  • 143
  • 4
2
votes
0 answers

How do I increase open file limit for nginx's master process on Ubuntu 14.04 LTS?

Not a dupe: This is not a duplicate of this question. I've already looked into that question. That helps with raising the limit for worker processes, but the nginx master process continues to retain 1024 and 4096 respectively. This latter nuance is…
Hassan Baig
  • 2,325
  • 12
  • 29
  • 48
2
votes
1 answer

Why would one use "stop; exit 1" in an Upstart script rather than just "exit 1" in case of an error?

I am maintaining an Upstart script (version 0.6.5) and in the pre-start script, there's a test to terminate the service if a precondition is not met: pre-start script if [ ! -f $REQUIRED_FILE ]; then echo "$REQUIRED_FILE does not exit" >>…
Behrang
  • 289
  • 2
  • 3
  • 10
2
votes
0 answers

Upstart job logs not being forwarded by rsyslog - Ubuntu 14.04 LTS

I've got rsyslog set up correctly forwarding all logs on a set of clients to a central server. Things like ssh auth logs etc all work fine and appear in the remote server properly. The issue is that I have custom upstart jobs for my applications…
Chilly
  • 121
  • 2
2
votes
0 answers

Restart service from non-admin user

I write my C++ program and run it as daemon by writing upstart script inside /etc/init/ So my program is automatically started after reboot and can be controlled using sudo service my-service restart How to allow to restart this service from another…
Roman Kolesnikov
  • 163
  • 1
  • 1
  • 4
2
votes
2 answers

nc exits immediately, on connection, when run as an upstart job

I'm using the following /etc/init/jsonlog.conf upstart job: description "jsonlog" start on runlevel [23] stop on runlevel [06] respawn script cd /tmp echo "about to listen" /bin/nc -l 3333 echo "finished listening" end…
fadedbee
  • 2,068
  • 5
  • 24
  • 36
2
votes
1 answer

Why does my Upstart job work with sudo but not with setuid?

I have an Upstart job for a Node.js application, and I want to make it run Node as the node user rather than root. When I use setuid in the job config, whenever I try to start the job, it says my-app stop/waiting. However, if I omit setuid but use…
amacleod
  • 145
  • 2
  • 5
2
votes
1 answer

How to find the file location of int.d scripts in ubuntu

I need location of a init.d script. I am using service cinder-api start to start the service Other init scripts are located at /etc/init.d/ location. But this service is not found in that location , its starting and stopping using service cinder-api…
manikantanr
  • 123
  • 1
  • 1
  • 3
2
votes
1 answer

sudo start my-project does not work

I'm using the following script in /etc/init/my-project.conf on my AWS instance. description "start and stop the go program 'my-project'" start on filesystem or runlevel [2345] stop on runlevel [!2345] env USER='ec2-user' env…
Thellimist
  • 121
  • 3
2
votes
1 answer

Upstart log stdout and stderr to file not working as expected

When in bash I can run: java -jar server.jar &>> log.txt And it combines the stdout and stderr into log.txt. However when I have this line in my Upstart .conf file, it does not do this: exec java -jar server.jar &>> log.txt I’ve also tried…
Dax Fohl
  • 283
  • 1
  • 2
  • 7
2
votes
2 answers

Only start a Docker container after process in other container is operational

I'm trying to deploy 3 Docker containers, having a dependency relation amongst them (A -> B -> C). Now, each container is supposed to run an Akka-Spray instance, on top of a JVM instance. The problem is: following usual orchestration approaches,…
2
votes
1 answer

Autossh ask for password when running with sudo (or from upstart)

I have an upstart job /etc/init/tunnel.conf: description "SSH Tunnel" start on (net-device-up IFACE=eth0) stop on runlevel[016] respawn exec autossh -nNT -o ServerAliveInterval=15 -R 12345:localhost:22 myuser@myserver When I look at the…
Leosar
  • 123
  • 1
  • 5
2
votes
2 answers

How to launch a SSH tunnel with upstart

I am not very used to sys admin and recently created an SSH tunnel between two servers (on Ubuntu 12.4) with the following command: ssh -fNg -L 3307:127.0.0.1:3306 tunneluser@xx.xx.xx.xx It worked, I also added this command to /etc/rc.local, and it…
user212141
2
votes
1 answer

Redirecting app log to rsyslog in upstart script

I have an upstart script that does the following start on runlevel [2345] stop on runlevel [06] respawn pre-start script exec >/dev/kmsg 2>&1 REPO=git@github.com:blabla/bli mkdir -p /var/log mkdir -p /var/www echo "Fetching app…
Michael
  • 263
  • 2
  • 4
  • 9