Skip to content

emmiegit/qotd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qotd

Build Status Coverity Status

QOTD (quote of the day) is specified in RFC 865 as a way of broadcasting a quote to users. On both TCP and UDP, port 17 is officially reserved for this purpose. This program is meant to provide a simple QOTD daemon on IPv4 and IPv6 over TCP/IP. See also here.

Installation from package

Installation from source

Clone this repo, and in the top level directory, run:

$ make
# make install

This will install the following files on your system:

  • /etc/qotd.conf
  • /usr/bin/qotdd
  • /usr/share/qotd/quotes.txt

If you use systemd, install with make install SYSTEMD=1. This will add a QOTD service file to your system at /usr/lib/systemd/system/qotd.service.

If you're creating a package, you can have make install to the packaging directory by setting ROOT, e.g. make install ROOT=/tmp/my_package.

Configuration

The default configuration file is located at /etc/qotd.conf (though this can be changed with the -c flag). Read the man pages or look at the example configuration files for more information about each setting and what it does.

Running

systemd users can run the new service:

# systemctl enable qotd.service
# systemctl start qotd.service

Those running the daemon directly should be aware of its options:

Usage: qotdd [OPTION]...
Usage: qotdd [--help | --version]

  -f, --foreground      Do not fork, but run in the foreground.
  -c, --conf (file)     Specify an alternate configuration file location. The default
      --config (file)   is at "/etc/qotd.conf".
  -N, --noconf          Do not read from a configuration file, but use the default
      --noconfig        options instead.
      --lax             When parsing the configuration, don't check file permissions
                        or perform other security checks.
  -P, --pidfile (file)  Override the pidfile name given in the configuration file with
                        the given file instead.
  -s, --quotes (file)   Override the quotes file given in the configuration file with
                        the given filename instead.
  -j, --journal (file)  Override the journal file given in the configuration file with
                        the given filename instead.
  -4, --ipv4            Only listen on IPv4.
  -6, --ipv6            Only listen on IPv6. (By default the daemon listens on both)
  -t, --tcp             Use TCP. This is the default behavior.
  -u, --udp             Use UDP instead of TCP. (Not fully implemented yet)
  -q, --quiet           Only output error messages. This is the essentially the same as
                        using "--journal /dev/null".
  --help                List all options and what they do.
  --version             Print the version and some basic license information.

FAQ

Q) How can I use multi-line quotes?
A) Set QuoteDivider to percent in the configuration file, and delimit each quotation in your quotes file with a percent sign on its own line.

Q) Why does this need to run as root?
A) RFC 865 specifies that the quote of the day protocol should be run on port 17, and only root is permitted bind to ports below 1024. By default, the program drops privileges and runs as the daemon user once a socket is established.