]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/lua: warn instead of error on failed control socket binds
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 15 Jan 2020 16:21:33 +0000 (17:21 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 21 Jan 2020 16:20:38 +0000 (17:20 +0100)
daemon/lua/config.lua
daemon/lua/distro-preconfig.lua.in

index 8088d7d39347b16ec64f6070edbcca1abc741dcd..52accee29c6e39114ba4b91ed3cf805e469ec615 100644 (file)
@@ -21,7 +21,7 @@ if not C.the_args.interactive and n_control_socks == 0 and not env.KRESD_NO_LIST
        local path = worker.cwd..'/control/'..worker.pid
        local ok, err = pcall(net.listen, path, nil, { kind = 'control' })
        if not ok then
-               error('bind to '..path..' failed '..err)
+               warn('bind to '..path..' failed '..err)
        end
 end
 
index 56375a86fec640bc972336b10b9509c51005f631..618e62d7c030e0997a6a56f36aabf2a8bb654838 100644 (file)
@@ -1,15 +1,14 @@
 local id = os.getenv('SYSTEMD_INSTANCE')
-
 if not id then
-       error('environment variable $SYSTEMD_INSTANCE not set')
+       warn('environment variable $SYSTEMD_INSTANCE not set')
 else
        -- Bind to control socket in run_dir
        local path = '@run_dir@/control/'..id
        local ok, err = pcall(net.listen, path, nil, { kind = 'control' })
        if not ok then
-               error('bind to '..path..' failed '..err)
+               warn('bind to '..path..' failed '..err)
        end
-
-       -- Set cache location
-       rawset(cache, 'current_storage', 'lmdb://@systemd_cache_dir@')
 end
+
+-- Set cache location
+rawset(cache, 'current_storage', 'lmdb://@systemd_cache_dir@')