svscan 1 user commands djbwares
svscan starts and monitors a collection of services
`svscan` `directory`

## Description

`svscan` starts one supervise 1 process for each subdirectory of the current directory, up to a limit of 1000 subdirectories. `svscan` skips subdirectory names starting with dots. supervise 1 must be in `svscan`'s path.

`svscan` optionally starts a pair of supervise 1 processes, one for a subdirectory `s`, one for `s/log`, with a pipe between them. It does this if the name `s` is at most 255 bytes long and `s/log` exists. (In versions 0.70 and below, it does this if `s` is sticky.) `svscan` needs two free descriptors for each pipe.

Every five seconds, `svscan` checks for subdirectories again. If it sees a new subdirectory, it starts a new supervise 1 process. If it sees an old subdirectory where a supervise 1 process has exited, it restarts the supervise 1 process. In the `log` case it reuses the same pipe so that no data is lost.

`svscan` is designed to run forever. If it has trouble creating a pipe or running supervise 1, it prints a message to stderr; it will try again five seconds later.

If `svscan` is given a command-line argument `directory`, it switches to that `directory` when it starts.

## See also

supervise 1
svc 1
svok 1
svstat 1
svscanboot 1
readproctitle 1
fghack 1
pgrphack 1
multilog 1
tai64n 1
tai64nlocal 1
setuidgid 1
envuidgid 1
envdir 1
softlimit 1
setlock 1

## Author

Original code and documentation by Daniel J. Bernstein. Converted to manual pages and updated by Gerrit Pape in 2000, 2001, and 2002. Converted to DocBook XML by Jonathan de Boyne Pollard.