File: README

package info (click to toggle)
libkeepalive 0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 120 kB
  • sloc: ansic: 98; makefile: 31
file content (74 lines) | stat: -rw-r--r-- 3,366 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    _ _ _     _                         _ _
   | (_) |__ | | _____  ___ _ __   __ _| (_)_   _____
   | | | '_ \| |/ / _ \/ _ \ '_ \ / _` | | \ \ / / _ \
   | | | |_) |   <  __/  __/ |_) | (_| | | |\ V /  __/
   |_|_|_.__/|_|\_\___|\___| .__/ \__,_|_|_| \_/ \___|
                           |_|

   (C) Fabio Busatto <fabio.busatto@gmail.com>



1. OVERVIEW
   Many systems provide the ability to keep tcp connections alive, so they
   aren't reset by peers or by routers because of inactivity.

   Even if this feature is present, only a few programs correctly implement
   the code to use it. If your favourite foo-client is not written with
   support for tcp keepalive, you'll continue to see your connection reset.

   libkeepalive library provides a way to enable tcp keepalive support in
   any program that uses shared libraries (e.g.: glibc shared object) to
   perform network operations. Using the preload method, you will be able to
   intercept normal program execution and to inject the code needed to enable
   the keepalive routines, everything done without modifying the original
   binary file and with no need to gain root privileges.

2. OBTAINING SOFTWARE
   Latest version of libkeepalive is available on
   http://libkeepalive.sourceforge.net/#download.

3. BUILDING BINARIES
   Just run make (use gmake if your default make is another one).

4. INSTALLING
   Simply copy libkeepalive.so in some cool directory (/usr/lib, or ~/lib if
   you're not so elite to have root privileges).
   If you want to enable keepalive in suid programs too, you have to copy
   libkeepalive.so in /lib or /usr/lib and suid it (according to ld.so
   manpage). In any other scenarios the library will not work with suid
   binaries.

5. USER CONFIGURATION
   libkeepalive will do its job if you set the environment variable LD_PRELOAD
   to the path of libkeepalive.so shared library before executing the target
   program.  You must specify the full path of the library if ld.so cannot is
   not able to find it. You can also set the variable in your startup script
   (i.e.: ~/.profile), depending from your shell.
   For informations about setting environment variables, refer to your shell
   documentation.

6. SYSTEM-WIDE CONFIGURATION
   Host administrators may want to impose the use of libkeepalive to all their
   users and all daemons loaded by the system startup process.
   Adding the full path of the libkeepalive.so dynamic library to
   /etc/ld.so.preload you obtain the same result as the LD_PRELOAD variable is
   always set, forcing the use indipendently from the environment.

7. DISABLING FOR A SPECIFIC EXECUTION
   If you need to disable the action of libkeepalive for a single job, or if
   your admin set the ld.so.preload, you can set the KEEPALIVE environment
   variable to "off", inhibiting the library even if it will be loaded.

8. TUNING KEEPALIVE PARAMETERS
   You can change the keepalive parameters using environment variables or via
   sysctl/procfs.

       env             sysctl
   KEEPCNT     <=>   net.ipv4.tcp_keepalive_probes
   KEEPIDLE    <=>   net.ipv4.tcp_keepalive_time
   KEEPINTVL   <=>   net.ipv4.tcp_keepalive_intvl

DON'T FORGET to configure your system-specific parameters for keepalive!
Many times, defaults are not what you need and you have to change your
settings (see your system documentation for this).