Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Upstart has gained the ability to start a process after a socket is accessed, but I found the feature to be poorly documented. How is a socket-activated daemon and upstart config written?

share|improve this question
2  
Checked the (sparse) man pages? upstart-socket-bridge and the referenced socket-event seem relevant. – sr_ May 10 '12 at 15:03
up vote 2 down vote accepted

I ran into an issue where I needed my upstart script to wait for the libvirt-bin socket, as you can't just used start on started libvirt-bin because of this bug.

Anyway, I ended up making my upstart script like so:

start on socket PROTO=unix SOCKET_PATH=/var/run/libvirt/libvirt-sock
task
exec    /data/configureESA.sh

Per the documentation referenced by @sr_:

The socket event is generated by the upstart-socket-bridge(8) daemon when a socket connection is made whose details match the socket event condition and environment specified in a jobs start on or stop on stanza.

start on socket PROTO=inet PORT=80 ADDR=127.0.0.1

start on socket PROTO=unix SOCKET_PATH=/var/run/.s.pgsql.1234

start on socket PROTO=unix SOCKET_PATH=@/at/upstart/example

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.