keyd was stashing its Unix domain socket in the DB directory, which
is contrary to convention. Add a sock_dir config option and default it
to ${prefix}/var/run in the sample config file.
-ListenStream=/var/lib/onak/keyd.sock
+ListenStream=/var/run/keyd.sock
SocketUser=onak
SocketMode=0660
SocketUser=onak
SocketMode=0660
}
stats->started = time(NULL);
}
stats->started = time(NULL);
- snprintf(sockname, 1023, "%s/%s", config.db_dir, KEYD_SOCKET);
+ snprintf(sockname, 1023, "%s/%s", config.sock_dir, KEYD_SOCKET);
fd = sock_init(sockname);
if (fd != -1) {
fd = sock_init(sockname);
if (fd != -1) {
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
KEYD_SOCKET);
if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
logthing(LOGTHING_CRITICAL,
KEYD_SOCKET);
if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
logthing(LOGTHING_CRITICAL,
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
KEYD_SOCKET);
if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
if (verbose >= 0) {
KEYD_SOCKET);
if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
if (verbose >= 0) {
NULL, /* logfile */
false, /* use_keyd */
NULL, /* logfile */
false, /* use_keyd */
/*
* Options for directory backends.
/*
* Options for directory backends.
/** Set if we're using keyd as the backend. */
bool use_keyd;
/** Set if we're using keyd as the backend. */
bool use_keyd;
+ /** The path to the directory the keyd socket lives in. */
+ char *sock_dir;
/*
* Options for any database backend that needs a directory, be it the
/*
* Options for any database backend that needs a directory, be it the
mail_intro_file /community/pgp-keyserver/share/mail_intro
help_dir /community/pgp-keyserver/share
mail_dir @STATEDIR@/spool/onak
mail_intro_file /community/pgp-keyserver/share/mail_intro
help_dir /community/pgp-keyserver/share
mail_dir @STATEDIR@/spool/onak
### If you change this, make sure to put a corresponding help file in
### the help_dir named above
### If you change this, make sure to put a corresponding help file in
### the help_dir named above