{"id":164053,"date":"2026-03-13T11:11:58","date_gmt":"2026-03-13T09:11:58","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite"},"modified":"2026-03-13T11:11:58","modified_gmt":"2026-03-13T09:11:58","slug":"predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite","title":{"rendered":"\ud83e\udd47smath 1.0.0 \u2014 a linear algebra library for C++ (C++23 standard) | ProHoster","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>The linux-api mailing list has presented a proposal (RFC) to replace the outdated binary formats of system logs lastlog, btmp, utmp, and wtmp with new shared libraries that use SQLite as a backend. This initiative aims to address accumulated issues, including the overflow of 32-bit time counters in 2038, lack of extensibility, low query performance, and absence of atomicity during writes.      <\/p>\n<p>Currently, the following binary files with a fixed structure are used for storing data about sessions and authentication attempts in Linux:  <\/p>\n<ul>\n<li class=\"l\"> \/var\/log\/lastlog &#8212; \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u0430 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 &#171;struct lastlog&#187; \u0441 \u043f\u043e\u043b\u0435\u043c &#171;ll_time&#187; 32-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 time_t);\n<li class=\"l\"> \/var\/log\/btmp &#8212; \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0432\u0445\u043e\u0434\u0430;\n<li class=\"l\"> \/var\/run\/utmp &#8212; \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u0435\u0430\u043d\u0441\u044b;\n<li class=\"l\"> \/var\/log\/wtmp &#8212; \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u0445\u043e\u0434\u043e\u0432 \u0438 \u0432\u044b\u0445\u043e\u0434\u043e\u0432.  <\/ul>\n<p>The file data format was developed several decades ago and has a number of fundamental limitations:  <\/p>\n<ul>\n<li class=\"l\"> The field 'tv_sec' in the 'utmpx' structure and the field 'll_time' in 'lastlog' are of type 'int32_t', with time counter values that will overflow on January 19, 2038. Due to ABI compatibility requirements, these fields remain 32-bit even on 64-bit systems, so the problem will affect all Linux installations.\n<li class=\"l\"> The fixed size of records prevents the addition of new fields (for example, container ID, service name, IP address) without completely replacing the format and recompiling all utilities.\n<li class=\"l\"> The last, lastb, who, and lastlog utilities are forced to linearly iterate through the contents of the files. With large log sizes and without the use of indexes that allow for efficient filtering of records, the input\/output system load and delays in executing queries become unacceptable.\n<li class=\"l\"> Writing to a binary file is not an atomic operation. In the event of a failure, the write may be partially corrupted.\n<li class=\"l\"> To avoid conflicts when multiple processes (for example, sshd and login) write to the log simultaneously, flock locks are used, which do not guarantee atomicity and can lead to deadlocks.    <\/ul>\n<p>The RFC author suggests completely abandoning binary formats in favor of specialized shared libraries using SQLite. A separate library is created for each type of log, with a uniform C interface: liblastlog2, libbtmp2, libutmp2, and libwtmp2. All libraries work with a database schema that includes 64-bit timestamps (INTEGER type) and indexes on users and time. There is the possibility of adding new fields without breaking compatibility (via ALTER TABLE).    <\/p>\n<p>Among the arguments in favor of using SQLite is the use of a 64-bit INTEGER type for storing epoch time, utilizing indexes to reduce I\/O by selectively accessing records instead of full scans, the ability to add new fields without changing existing records, support for ACID transactions, and WAL (Write-Ahead Logging) mode for concurrent access without locks, as well as the proven reliability of SQLite.      <\/p>\n<p>To ensure a smooth transition, a 'dual-write' strategy is proposed:  <\/p>\n<ul>\n<li class=\"l\"> Programs that write to binary files (login, sshd, sudo, cron, etc.) are modified to simultaneously write to both the old binary file and the new SQLite database through the corresponding library.\n<li class=\"l\"> New versions of utilities (last2, lastb2, who2, lastlog2) are being developed to read data from SQLite databases, using indexes for fast operations. The old utilities continue to work with the previous files.\n<li class=\"l\"> In a few years, when the overwhelming majority of systems are upgraded, support for writing in old formats may be disabled, and old utilities may be declared obsolete.  <\/ul>\n<p>Questions raised for further discussion:  <\/p>\n<ul>\n<li class=\"l\"> The feasibility of splitting into separate libraries or combining into one (e.g., libsession2).\n<li class=\"l\"> Choice of names for libraries and utilities (whether to keep historical names or switch to more generic ones).\n<li class=\"l\"> Location of database files (\/var\/lib\/ like for application state or \/var\/log\/ like for logs).\n<li class=\"l\"> Mechanism for schema versioning and migration.\n<li class=\"l\"> SQLite performance parameters for various scenarios (<a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/server\/\" title=\"servers\" data-wpil-keyword-link=\"linked\">servers<\/a>, embedded systems).\n<li class=\"l\"> Providing a fallback backend that stores logs in a simplified binary format for systems where SQLite may be excessive (e.g., embedded devices with strict memory constraints).  <\/ul>\n<p>Source: <a rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=64981\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 linux-api \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (RFC) \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 SQLite \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u044d\u043a\u0435\u043d\u0434\u0430. \u0418\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u043a\u043e\u043f\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 32-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u0445 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 2038 \u0433\u043e\u0434\u0443, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u0438, \u043d\u0438\u0437\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438. \u0412 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-164053","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 linux-api \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (RFC) \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 SQLite \u0432.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Erik Peterson\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SQLite | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 linux-api \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (RFC) \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 SQLite \u0432.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-03-13T09:11:58+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-03-13T09:11:58+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Proposal to transition system logs lastlog, btmp, utmp, and wtmp to using SQLite | ProHoster","description":"A proposal (RFC) to replace the outdated binary formats of the system logs lastlog, btmp, utmp, and wtmp with new shared libraries using SQLite is on the agenda of the linux-api mailing list.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SQLite | ProHoster","og:description":"\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 linux-api \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (RFC) \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 lastlog, btmp, utmp \u0438 wtmp \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 SQLite \u0432.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/predlozhenie-po-perevodu-sistemnyh-logov-lastlog-btmp-utmp-i-wtmp-na-ispolzovanie-sqlite","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2026-03-13T09:11:58+00:00","article:modified_time":"2026-03-13T09:11:58+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":[],"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/164053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=164053"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/164053\/revisions"}],"predecessor-version":[{"id":165640,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/164053\/revisions\/165640"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=164053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=164053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=164053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}