jk_socketd(8)
π jk_socketd(8) π
okay bestie, so this is the manual page for jk_socketd, from the jailkit family β section 8, daemon territory, we love that for us. it's literally the jailkit socket daemon and it's about to become your new hyperfixation. let's go π
β¨ NAME β¨
jk_socketd β a daemon to create a rate-limited /dev/log socket inside a chroot π¦
πΈ SYNOPSIS πΈ
jk_socketd
jk_socketd -p pidfile -n
jk_socketd --pidfile= pidfile --nodetach
like, three whole moods, pick your fighter π
π DESCRIPTION π
The jailkit socket daemon creates a rate-limited /dev/log socket inside a jail according to /etc/jailkit/jk_socketd.ini and writes all data eventually to syslog using the real /dev/log. Programs like jk_lsh and also many daemons need a /dev/log socket to do logging to syslog. fr fr, it's a whole need.
jk_socketd is an alternative for syslog to create /dev/log inside the jail (see your syslog manual how to accomplish this). However, if you are worrying about an attacker disrupting normal system operation by filling your logs you should use jk_socketd. π jk_socketd can limit the number of bytes written trough the socket. If the logging is limited by jk_socketd, processes that run inside the jail will be slowed down if they try to use the logging service. If you expect a high logging rate in a jail, it is recommended to use syslog to create the socket in the jail instead of jk_socketd. no cap, read that part twice bestie.
π¨ on (Open)Solaris/dev/logis not a socket and thereforejk_socketdwill not function. On (Open)Solaris you should create the devices/dev/logand/dev/conslogin the jail to enable logging inside the jail. it's giving "different OS, different rules" π
The rate limiting is done based on three parameters, the base, the peak and the interval. The interval is the number of seconds that jk_socketd will use to count up to the number of bytes. The base and peak are both a number in bytes. β¨
A socket is normally only allowed to have base bytes going trough per interval seconds. Only if in the previous interval the number of bytes has been lower than base, peak number of bytes is allowed. So a peak can only happen if the previous interval has been lower than base. the way that's literally the whole mechanic π«Ά
The config file consists of several entries where each entry looks like this:
[/home/testchroot/dev/log]
base = 512
peak = 2048
interval = 5.0
The title of the section is the socket to be created. The directory to create the socket in should exist. π (yes, that's a requirement, not a suggestion, she's strict)
π Security π
The jailkit socket daemon will change to user nobody and will chroot() into an empty dir once all sockets are opened. If the /dev/log socket is closed by the syslog daemon (for example during log rotation), jk_socketd needs a restart to open it again. π that's not a bug it's just how she is.
π OPTIONS π
-n,--nodetachβ do not detach from the terminal and print debugging output π-ppidfile,--pidfile=pidfile β write PID to pidfile-h,--helpβ show help screen π--socket=/path/to/socketβ do not read ini file, create specific socket π--base=integer β message rate limit (in bytes) per interval for socket specified by--socket--peak=integer β message rate limit peak (in bytes) for socket specified by--socket--interval=float β message rate limit interval in seconds for socket specified by--socket
π FILES π
/etc/jailkit/jk_socketd.ini
the main character config file, honestly β¨
π DIAGNOSTICS π
jk_socketd logs errors to syslog, so check your log files π
otherwise run jk_socketd -n and it will not detach from the terminal, and it will print some debugging output. vibe check your own problems, bestie π
π¦ SEE ALSO π¦
jailkit(8) jk_check(8) jk_chrootlaunch(8) jk_chrootsh(8) jk_cp(8) jk_init(8) jk_jailuser(8) jk_list(8) jk_lsh(8) jk_procmailwrapper(8) jk_uchroot(8) jk_update(8) chroot(2) syslogd(8)
the whole friend group, obsessed π«Ά
π COPYRIGHT π
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Olivier Sessink
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
and that's the whole page bestie π this one's from the JAILKIT crew, dated 02-08-2012, and yes it lives in section jk_socketd(8) β go forth and rate-limit responsibly β¨π
π¦ where this page comes from
- debian bookworm: jailkit 2.23-2 Β· BSD-3-Clause
- debian trixie: jailkit 2.23-2+b1 Β· BSD-3-Clause
- ubuntu jammy: jailkit 2.23-1 Β· BSD-3-Clause
- ubuntu noble: jailkit 2.23-2 Β· BSD-3-Clause
- ubuntu questing: jailkit 2.23-2
- ubuntu resolute: jailkit 2.23-3 Β· BSD-3-Clause
- ubuntu stonking: jailkit 2.23-3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms