---
name: "socket-event"
section: "7"
platform: "linux"
package: "upstart"
version: "1.11-5"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/socket-event"
---

# socket-event(7)

event signalling that a socket connection has been made

## NAME

socket - event signalling that a socket connection has been made

## SYNOPSIS

**socket** **PROTO=***PROTO* **PORT=***PORT* **ADDR=***ADDR*

**socket** **PROTO=***PROTO* **SOCKET\_PATH=***PATH*

## DESCRIPTION

The **socket** event is generated by the [**upstart-socket-bridge**(8)](/upstart-socket-bridge/8.md) 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.

When an incoming connection is detected, the file descriptor representing the socket is passed to the job in question to allow it to [**accept**(2)](/accept/2.md) the connection. Additionally, the environment variable **UPSTART\_JOB** will contain the name of the event ("socket") and the environment variable **UPSTART\_FDS** will contain the number of the file descriptor corresponding to the listening socket.

## EXAMPLES

### Internet socket

Start web server when first client connects from localhost:

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

### Local socket

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

### Abstract socket

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

## AUTHOR

Written by Scott James Remnant \<**scott@netsplit.com**\>

Manual page written by James Hunt \<**james.hunt@ubuntu.com**\>

## BUGS

Report bugs at  \<**https://launchpad.net/upstart/+bugs**\>

## COPYRIGHT

Copyright © 2011 Canonical Ltd.

This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

[**init**(5)](/init/5.md) [**init**(8)](/init/8.md) [**socket**(2)](/socket/2.md) [**socket**(7)](/socket/7.md) [**upstart-socket-bridge**(8)](/upstart-socket-bridge/8.md)
