Previous: , Up: Top  


7 Writing services

A service program is expected to write output into its stdout, read input from stdin, and exit when its stdin is closed (or upon receiving a signal, which should be specified for tlsd in that case).

While TLSd itself doesn’t demand much, a service easily usable with standard tools requires some care to design. It is suggested to make the services usable without special client software, with basic shell commands only. Essentially, to follow the Unix philosophy, and e.g. not to make up a context-free grammar (one that can’t be parsed with regular expressions properly) where a regular grammar or no parsing at all would suffice.

Making the services reusable with other similar super-servers (such as inetd, nc -le, or systemd socket activation) and/or as interactive programs for local use could also be a good idea.