** xref:network/index.adoc[Network Errors]
+*** Server does not start
+**** xref:network/bind.adoc[Failed binding to socket]
+
*** Common Errors
**** xref:network/unknown_packet_code.adoc[Unknown packet code]
**** xref:network/unexpected_request_code.adoc[Unexpected request code]
--- /dev/null
+= Failed binding to socket
+
+This error message is produced when the server cannot open a socket on
+the specified port. There are a few reasons why this can happen, but
+the most common one is that there is already another instance of
+FreeRADIUS running.
+
+**Cause:** You are trying to run the server in
+xref:ROOT:debugging/radiusd_X.adoc[debug mode], without stopping the
+server that is running in the background.
+
+**Action:** Stop the server which is running in the background, and
+you can then run it in debug mode.
+
+**Cause:** The server does not have permission to open the given socket/port.
+
+**Action:** Check that the server has the correct UID/GID permissions.
+
+**Action:** Check that something like SeLinux is not preventing the
+server from opening sockets.
+
problems. Either it is either not receiving packets, or else it
receives a packet and discards it with a complaint. Both situations
can be solved by running the server in
-xref:ROOT:debugging/radiusd_X.adoc[debugging] mode.
+xref:ROOT:debugging/radiusd_X.adoc[debug mode].
+
+== Server does not start
+
+If the server does not start, it prints a descriptive message to the
+log files, or to the terminal window. The common errors are listed
+below.
+
+* xref:network/bind.adoc[Failed binding to socket]
== Not Receiving Packets
-When the server is started in debugging mode, the last line it prints is:
+When the server successfully starts in debugging mode, the last line
+it prints is:
[source,text]
----
When the server discards packets for a particular reason, it gives a
descriptive error messages when running in
-xref:ROOT:debugging/radiusd_X.adoc[debugging] mode. The errors are
+xref:ROOT:debugging/radiusd_X.adoc[debug mode]. The errors are
not sent to the normal log file, because that could allow attackers to
DoS the server.
#define DOC_ROOT_URL "https://www.freeradius.org/documentation/freeradius-server/" STRINGIFY(RADIUSD_DOC_VERSION)
#define DOC_KEYWORD_URL(_x) DOC_ROOT_URL "/reference/unlang/" STRINGIFY(_x) ".html"
#define DOC_KEYWORD_REF(_x) "For more information, please see " DOC_KEYWORD_URL(_x)
+#define DOC_ROOT_REF(_x) "For more information, please see " STRINGIFY(_x) ".html"
/*
* Version check.
if (fr_socket_bind(sockfd, inst->interface, &ipaddr, &port) < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (rcode < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (inst->interface) li->app_io_addr->inet.src_ipaddr.scope_id = ipaddr.scope_id;
rad_suid_down();
if (rcode < 0) {
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
close_error:
close(sockfd);
goto error;
rcode = fr_socket_bind(sockfd, inst->interface, &ipaddr, &port);
rad_suid_down();
if (rcode < 0) {
- cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
close(sockfd);
+ cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (fr_socket_bind(sockfd, inst->interface, &ipaddr, &port) < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (fr_socket_bind(sockfd, inst->interface, &ipaddr, &port) < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (fr_socket_bind(sockfd, inst->interface, &ipaddr, &port) < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}
if (fr_socket_bind(sockfd, inst->interface, &ipaddr, &port) < 0) {
close(sockfd);
cf_log_err(li->cs, "Failed binding to socket - %s", fr_strerror());
+ cf_log_err(li->cs, DOC_ROOT_REF(troubleshooting/network/bind));
goto error;
}