File: distro-preconfig.lua.in

package info (click to toggle)
knot-resolver 5.6.0-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 16,088 kB
  • sloc: javascript: 42,732; ansic: 34,753; python: 4,603; cpp: 2,107; sh: 1,883; makefile: 199; xml: 193
file content (19 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- SPDX-License-Identifier: GPL-3.0-or-later
log_target('syslog') -- assume running as OS service

local ffi = require('ffi')
local id = os.getenv('SYSTEMD_INSTANCE')
if not id then
	log_warn(ffi.C.LOG_GRP_SYSTEM, 'environment variable $SYSTEMD_INSTANCE not set')
else
	-- Bind to control socket in run_dir
	worker.control_path = '@run_dir@/control/'
	local path = worker.control_path..id
	local ok, err = pcall(net.listen, path, nil, { kind = 'control' })
	if not ok then
		log_warn(ffi.C.LOG_GRP_NETWORK, 'bind to '..path..' failed '..err)
	end
end

-- Set cache location
rawset(cache, 'current_storage', 'lmdb://@systemd_cache_dir@')