diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-06-11 12:37:19 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-06-11 12:37:19 +0000 |
commit | 91b97bc9f625d09431dc1c753209a037d7c42fbc (patch) | |
tree | 428230e6d8f0d7ac47dcccebabccd09667d58ea5 /libs/lucid | |
parent | 2d05a6135a0d29a82148f9bfc215b2de5b609dd5 (diff) |
Remove unmaintained components: lucid, fastindex, niu
Diffstat (limited to 'libs/lucid')
-rw-r--r-- | libs/lucid/Makefile | 2 | ||||
-rw-r--r-- | libs/lucid/docs/OVERVIEW | 75 | ||||
-rw-r--r-- | libs/lucid/hostfiles/etc/config/lucid | 75 | ||||
-rw-r--r-- | libs/lucid/luasrc/lucid.lua | 348 | ||||
-rw-r--r-- | libs/lucid/luasrc/lucid/tcpserver.lua | 254 | ||||
-rw-r--r-- | libs/lucid/root/etc/config/lucid | 52 | ||||
-rwxr-xr-x | libs/lucid/root/etc/init.d/lucid | 43 |
7 files changed, 0 insertions, 849 deletions
diff --git a/libs/lucid/Makefile b/libs/lucid/Makefile deleted file mode 100644 index f7fac7740..000000000 --- a/libs/lucid/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include ../../build/config.mk -include ../../build/module.mk diff --git a/libs/lucid/docs/OVERVIEW b/libs/lucid/docs/OVERVIEW deleted file mode 100644 index ca742ddd6..000000000 --- a/libs/lucid/docs/OVERVIEW +++ /dev/null @@ -1,75 +0,0 @@ - LuCId Network Superserver in Lua - -*** Abstract *** -LuCId is a network superserver written in Lua based on the nixio POSIX library. -It supports IPv4, IPv6, TLS, asynchronous and synchronous IO and can be extended -to handle any kind of IO events on file descriptors. LuCId is also able to -generate RSA private keys and self-signed certificates on demand if the px5g -keymaster library is available. Both nixio and px5g are libraries created -by the LuCI developers. - - -*** Configuration *** -LuCId uses the UCI Universal Configuration Interface as configuration backend. - -There are 4 types of configuration sections and one named section defined: -The main section of type "lucid" defines the basic framework parameters of LuCId -These include: - * pollinterval: Internal polling interval - * threadlimit: Overall maximum number of child processes - * daemonize: Whether to daemonize at startup - * debug: Whether to enable debug output in syslog - - -The "tcpserver" section type provides the framework for TCP servers: -Parameters: - * entrypoint: Lua module entrypoint (provides a prepare_daemon function) - -The "daemon" sections define instances of servers. -Parameters may include: - * slave: Server slave - * publisher: Publishers to be served by this daemon - * enabled: Flag (0/1) whether this daemon should be started - * address: List of ports / addresses to be bound too, if applicable - * encryption: Flag (disabled/enabled) whether to enforce encryption - * tls: Reference to the TLS configuration section to use - -The "...Publisher" sections define services to be published through daemons. -Publishers definitions should be daemon and protocol independent whenever -possible. Publishers should also implement access restrictions for certain -network interfaces and for specified UNIX user accounts. -Publishers usually define but are not required to use the following Parameters: - * name: Published Name - * physical: Physical source path - * virtual: Virtual resource path - * domain: Any kind of domain or realm specification - * read: ACL containing entities allowed to read the given resource - * write: -"- - * exec: -"- - -The "tls" sections describe TLS security specifications for TCP servers. -Parameters: - * key: Private Key file - * cert: Certificate file - * type: Type of certificate and key files (pem, asn1) - * generate: Flag (0/1) to determine whether LuCId should generate - keys and self-signed certificates if the certificate is not available and - the px5g RSA Keymaster is available - - - -*** Workflow *** -In the preparation phase LuCId loads its configuration using the specification -given above and prepares its servers, daemons and publishers. It also allocates -resources such as binding sockets or preparing encryption credentials. -If everything could be setup correctly LuCId will daemonize - if requested. If -any errors occur in the preparation phase, LuCId will write to the system logger -and exit. - -After daemonizing the main process is responsible for keeping a list of -file descriptors that LuCId is polling regularly to handle incoming data events. -Data events are for example new TCP connection attempts which could cause the -superserver to fork a new process and invoke a registered handler. - -Whenever a sub-process is about to be generate LuCId checks if given resource -limits are still met.
\ No newline at end of file diff --git a/libs/lucid/hostfiles/etc/config/lucid b/libs/lucid/hostfiles/etc/config/lucid deleted file mode 100644 index a88835cdd..000000000 --- a/libs/lucid/hostfiles/etc/config/lucid +++ /dev/null @@ -1,75 +0,0 @@ -config lucid main - option pollinterval 15000 - option daemon 1 - option debug 1 - list supports tcpserver - list supports server - -config DirectoryPublisher webroot - option name 'Webserver Share' - option physical host/www - option virtual '' - option domain '' - -config LuciWebPublisher luciweb - option name 'LuCI Webapplication' - option physical '' - list virtual /luci - option domain '' - option home 1 - -config RPCPublisher mainrpc - option namespace 'luci.lucid.rpc' - list export system - list export ruci - list exec ':lo' - list exec 'root' - -config tcpserver httpd - option entrypoint "luci.lucid.http" - list supports DirectoryPublisher - list supports LuciWebPublisher - -config tcpserver rpcd - option entrypoint "luci.lucid.rpc" - list supports RPCPublisher - -config daemon http - option slave httpd - list address 8080 - list publisher webroot - list publisher luciweb - option enabled 1 - -config daemon https - option slave httpd - list address 4443 - list publisher webroot - list publisher luciweb - option enabled 1 - option encryption enable - option tls sdk_tls - -config tls sdk_tls - option generate 1 - option key /tmp/lucid-tls.key - option cert /tmp/lucid-tls.cert - option type asn1 - -config daemon rpc - option slave rpcd - list address 12900 - list publisher mainrpc - option enabled 1 - -config 'daemon' 'splashr' - option 'slave' 'httpd' - list 'address' '8082' - list 'publisher' 'splashredir' - option 'enabled' '1' - -config 'Redirector' 'splashredir' - option 'name' 'Splashd' - option 'virtual' '/' - option 'physical' ':80/luci/splash' - diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua deleted file mode 100644 index 38b34fde9..000000000 --- a/libs/lucid/luasrc/lucid.lua +++ /dev/null @@ -1,348 +0,0 @@ ---[[ -LuCI - Lua Development Framework - -Copyright 2009 Steven Barth <steven@midlink.org> - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]] - -local nixio = require "nixio" -local table = require "table" -local uci = require "luci.model.uci" -local os = require "os" -local io = require "io" - -local pairs, require, pcall, assert, type = pairs, require, pcall, assert, type -local ipairs, tonumber, collectgarbage = ipairs, tonumber, collectgarbage - - -module "luci.lucid" - -local slaves = {} -local pollt = {} -local tickt = {} -local tpids = {} -local tcount = 0 -local ifaddrs = nixio.getifaddrs() - -cursor = uci.cursor() -state = uci.cursor_state() -UCINAME = "lucid" - -local cursor = cursor -local state = state -local UCINAME = UCINAME -local SSTATE = "/tmp/.lucid_store" - - ---- Starts a new LuCId superprocess. -function start() - state:revert(UCINAME, "main") - - prepare() - - local detach = cursor:get(UCINAME, "main", "daemonize") - if detach == "1" then - local stat, code, msg = daemonize() - if not stat then - nixio.syslog("crit", "Unable to detach process: " .. msg .. "\n") - ox.exit(2) - end - end - - state:set(UCINAME, "main", "pid", nixio.getpid()) - state:save(UCINAME) - - run() -end - ---- Returns the PID of the currently active LuCId process. -function running() - local pid = tonumber(state:get(UCINAME, "main", "pid")) - return pid and nixio.kill(pid, 0) and pid -end - ---- Stops any running LuCId superprocess. -function stop() - local pid = tonumber(state:get(UCINAME, "main", "pid")) - if pid then - return nixio.kill(pid, nixio.const.SIGTERM) - end - return false -end - ---- Prepares the slaves, daemons and publishers, allocate resources. -function prepare() - local debug = tonumber((cursor:get(UCINAME, "main", "debug"))) - - nixio.openlog("lucid", "pid", "perror") - if debug ~= 1 then - nixio.setlogmask("warning") - end - - cursor:foreach(UCINAME, "daemon", function(config) - if config.enabled ~= "1" then - return - end - - local key = config[".name"] - if not config.slave then - nixio.syslog("crit", "Daemon "..key.." is missing a slave\n") - os.exit(1) - else - nixio.syslog("info", "Initializing daemon " .. key) - end - - state:revert(UCINAME, key) - - local daemon, code, err = prepare_daemon(config) - if daemon then - state:set(UCINAME, key, "status", "started") - nixio.syslog("info", "Prepared daemon " .. key) - else - state:set(UCINAME, key, "status", "error") - state:set(UCINAME, key, "error", err) - nixio.syslog("err", "Failed to initialize daemon "..key..": ".. - err .. "\n") - end - end) -end - ---- Run the superprocess if prepared before. --- This main function of LuCId will wait for events on given file descriptors. -function run() - local pollint = tonumber((cursor:get(UCINAME, "main", "pollinterval"))) - local threadlimit = tonumber((cursor:get(UCINAME, "main", "threadlimit"))) - - while true do - local stat, code = nixio.poll(pollt, pollint) - - if stat and stat > 0 then - local ok = false - for _, polle in ipairs(pollt) do - if polle.revents ~= 0 and polle.handler then - ok = ok or polle.handler(polle) - end - end - if not ok then - -- Avoid high CPU usage if thread limit is reached - nixio.nanosleep(0, 100000000) - end - elseif stat == 0 then - ifaddrs = nixio.getifaddrs() - end - - for _, cb in ipairs(tickt) do - cb() - end - - local pid, stat, code = nixio.wait(-1, "nohang") - while pid and pid > 0 do - nixio.syslog("info", "Buried thread: " .. pid) - if tpids[pid] then - tcount = tcount - 1 - if tpids[pid] ~= true then - tpids[pid](pid, stat, code) - end - tpids[pid] = nil - end - pid, stat, code = nixio.wait(-1, "nohang") - end - end -end - ---- Add a file descriptor for the main loop and associate handler functions. --- @param polle Table containing: {fd = FILE DESCRIPTOR, events = POLL EVENTS, --- handler = EVENT HANDLER CALLBACK} --- @see unregister_pollfd --- @return boolean status -function register_pollfd(polle) - pollt[#pollt+1] = polle - return true -end - ---- Unregister a file desciptor and associate handler from the main loop. --- @param polle Poll descriptor --- @see register_pollfd --- @return boolean status -function unregister_pollfd(polle) - for k, v in ipairs(pollt) do - if v == polle then - table.remove(pollt, k) - return true - end - end - return false -end - ---- Close all registered file descriptors from main loop. --- This is useful for forked child processes. -function close_pollfds() - for k, v in ipairs(pollt) do - if v.fd and v.fd.close then - v.fd:close() - end - end -end - ---- Register a tick function that will be called at each cycle of the main loop. --- @param cb Callback --- @see unregister_tick --- @return boolean status -function register_tick(cb) - tickt[#tickt+1] = cb - return true -end - ---- Unregister a tick function from the main loop. --- @param cb Callback --- @see register_tick --- @return boolean status -function unregister_tick(cb) - for k, v in ipairs(tickt) do - if v == cb then - table.remove(tickt, k) - return true - end - end - return false -end - ---- Tests whether a given number of processes can be created. --- @oaram num Processes to be created --- @return boolean status -function try_process(num) - local threadlimit = tonumber((cursor:get(UCINAME, "main", "threadlimit"))) - return not threadlimit or (threadlimit - tcount) >= (num or 1) -end - ---- Create a new child process from a Lua function and assign a destructor. --- @param threadcb main function of the new process --- @param waitcb destructor callback --- @return process identifier or nil, error code, error message -function create_process(threadcb, waitcb) - local threadlimit = tonumber(cursor:get(UCINAME, "main", "threadlimit")) - if threadlimit and tcount >= threadlimit then - nixio.syslog("warning", "Cannot create thread: process limit reached") - return nil - else - collectgarbage("collect") - end - local pid, code, err = nixio.fork() - if pid and pid ~= 0 then - nixio.syslog("info", "Created thread: " .. pid) - tpids[pid] = waitcb or true - tcount = tcount + 1 - elseif pid == 0 then - local code = threadcb() - os.exit(code) - else - nixio.syslog("err", "Unable to fork(): " .. err) - end - return pid, code, err -end - ---- Prepare a daemon from a given configuration table. --- @param config Configuration data. --- @return boolean status or nil, error code, error message -function prepare_daemon(config) - nixio.syslog("info", "Preparing daemon " .. config[".name"]) - local modname = cursor:get(UCINAME, config.slave) - if not modname then - return nil, -1, "invalid slave" - end - - local stat, module = pcall(require, _NAME .. "." .. modname) - if not stat or not module.prepare_daemon then - return nil, -2, "slave type not supported" - end - - config.slave = prepare_slave(config.slave) - - return module.prepare_daemon(config, _M) -end - ---- Prepare a slave. --- @param name slave name --- @return table containing slave module and configuration or nil, error message -function prepare_slave(name) - local slave = slaves[name] - if not slave then - local config = cursor:get_all(UCINAME, name) - - local stat, module = pcall(require, config and config.entrypoint) - if stat then - slave = {module = module, config = config} - end - end - - if slave then - return slave - else - return nil, module - end -end - ---- Return a list of available network interfaces on the host. --- @return table returned by nixio.getifaddrs() -function get_interfaces() - return ifaddrs -end - ---- Revoke process privileges. --- @param user new user name or uid --- @param group new group name or gid --- @return boolean status or nil, error code, error message -function revoke_privileges(user, group) - if nixio.getuid() == 0 then - return nixio.setgid(group) and nixio.setuid(user) - end -end - ---- Return a secure UCI cursor. --- @return UCI cursor -function securestate() - local stat = nixio.fs.stat(SSTATE) or {} - local uid = nixio.getuid() - if stat.type ~= "dir" or (stat.modedec % 100) ~= 0 or stat.uid ~= uid then - nixio.fs.remover(SSTATE) - if not nixio.fs.mkdir(SSTATE, 700) then - local errno = nixio.errno() - nixio.syslog("err", "Integrity check on secure state failed!") - return nil, errno, nixio.perror(errno) - end - end - - return uci.cursor(nil, SSTATE) -end - ---- Daemonize the process. --- @return boolean status or nil, error code, error message -function daemonize() - if nixio.getppid() == 1 then - return - end - - local pid, code, msg = nixio.fork() - if not pid then - return nil, code, msg - elseif pid > 0 then - os.exit(0) - end - - nixio.setsid() - nixio.chdir("/") - - local devnull = nixio.open("/dev/null", nixio.open_flags("rdwr")) - nixio.dup(devnull, nixio.stdin) - nixio.dup(devnull, nixio.stdout) - nixio.dup(devnull, nixio.stderr) - - return true -end diff --git a/libs/lucid/luasrc/lucid/tcpserver.lua b/libs/lucid/luasrc/lucid/tcpserver.lua deleted file mode 100644 index 266ea29e4..000000000 --- a/libs/lucid/luasrc/lucid/tcpserver.lua +++ /dev/null @@ -1,254 +0,0 @@ ---[[ -LuCI - Lua Development Framework - -Copyright 2009 Steven Barth <steven@midlink.org> - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]] - -local os = require "os" -local fs = require "nixio.fs" -local nixio = require "nixio" -local lucid = require "luci.lucid" - -local ipairs, type, require, setmetatable = ipairs, type, require, setmetatable -local pairs, print, tostring, unpack = pairs, print, tostring, unpack -local pcall = pcall - -module "luci.lucid.tcpserver" - -local cursor = lucid.cursor -local UCINAME = lucid.UCINAME - -local tcpsockets = {} - ---- Prepare a daemon and allocate its resources. (superserver callback) --- @param config configuration table --- @param server LuCId basemodule --- @return binary data -function prepare_daemon(config, server) - nixio.syslog("info", "Preparing TCP-Daemon " .. config[".name"]) - if type(config.address) ~= "table" then - config.address = {config.address} - end - - local sockets, socket, code, err = {} - local sopts = {reuseaddr = 1} - for _, addr in ipairs(config.address) do - local host, port = addr:match("(.-):?([^:]*)") - if not host then - nixio.syslog("err", "Invalid address: " .. addr) - return nil, -5, "invalid address format" - elseif #host == 0 then - host = nil - end - socket, code, err = prepare_socket(config.family, host, port, sopts) - if socket then - sockets[#sockets+1] = socket - end - end - - nixio.syslog("info", "Sockets bound for " .. config[".name"]) - - if #sockets < 1 then - return nil, -6, "no sockets bound" - end - - nixio.syslog("info", "Preparing publishers for " .. config[".name"]) - - local publisher = {} - for k, pname in ipairs(config.publisher) do - local pdata = cursor:get_all(UCINAME, pname) - if pdata then - publisher[#publisher+1] = pdata - else - nixio.syslog("err", "Publisher " .. pname .. " not found") - end - end - - nixio.syslog("info", "Preparing TLS for " .. config[".name"]) - - local tls = prepare_tls(config.tls) - if not tls and config.encryption == "enable" then - for _, s in ipairs(sockets) do - s:close() - end - return nil, -4, "Encryption requested, but no TLS context given" - end - - nixio.syslog("info", "Invoking daemon factory for " .. config[".name"]) - local handler, err = config.slave.module.factory(publisher, config) - if not handler then - for _, s in ipairs(sockets) do - s:close() - end - return nil, -3, err - else - local pollin = nixio.poll_flags("in") - for _, s in ipairs(sockets) do - server.register_pollfd({ - fd = s, - events = pollin, - revents = 0, - handler = accept, - accept = handler, - config = config, - publisher = publisher, - tls = tls - }) - end - return true - end -end - ---- Accept a new TCP connection. (server callback) --- @param polle Poll descriptor --- @return handler process id or nil, error code, error message -function accept(polle) - if not lucid.try_process() then - return false - end - local socket, host, port = polle.fd:accept() - if not socket then - return nixio.syslog("warning", "accept() failed: " .. port) - end - - socket:setblocking(true) - - local function thread() - lucid.close_pollfds() - local inst = setmetatable({ - host = host, port = port, interfaces = lucid.get_interfaces() - }, {__index = polle}) - if polle.config.encryption then - socket = polle.tls:create(socket) - if not socket:accept() then - socket:close() - return nixio.syslog("warning", "TLS handshake failed: " .. host) - end - end - - return polle.accept(socket, inst) - end - - local stat = {lucid.create_process(thread)} - socket:close() - return unpack(stat) -end - ---- Prepare a TCP server socket. --- @param family protocol family ["inetany", "inet6", "inet"] --- @param host host --- @param port port --- @param opts table of socket options --- @param backlog socket backlog --- @return socket, final socket family -function prepare_socket(family, host, port, opts, backlog) - nixio.syslog("info", "Preparing socket for port " .. port) - backlog = backlog or 1024 - family = family or "inetany" - opts = opts or {} - - local inetany = family == "inetany" - family = inetany and "inet6" or family - - local socket, code, err = nixio.socket(family, "stream") - if not socket and inetany then - family = "inet" - socket, code, err = nixio.socket(family, "stream") - end - - if not socket then - return nil, code, err - end - - for k, v in pairs(opts) do - socket:setsockopt("socket", k, v) - end - - local stat, code, err = socket:bind(host, port) - if not stat then - return nil, code, err - end - - stat, code, err = socket:listen(backlog) - if not stat then - return nil, code, err - end - - socket:setblocking(false) - - return socket, family -end - ---- Prepare a TLS server context and load keys and certificates. --- May invoke px5g to create keys and certificate on demand if available. --- @param tlskey TLS configuration identifier --- @return TLS server conext or nil -function prepare_tls(tlskey) - local tls - if nixio.tls and tlskey and cursor:get(UCINAME, tlskey) then - tls = nixio.tls("server") - - local make = cursor:get(UCINAME, tlskey, "generate") == "1" - local key = cursor:get(UCINAME, tlskey, "key") - local xtype = make and "asn1" or cursor:get(UCINAME, tlskey, "type") - local cert = cursor:get(UCINAME, tlskey, "cert") - local ciphers = cursor:get(UCINAME, tlskey, "ciphers") - - if make and (not fs.access(key) or not fs.access(cert)) then - local CN = cursor:get(UCINAME, tlskey, "CN") - local O = cursor:get(UCINAME, tlskey, "O") - local bits = 2048 - - local data = { - CN = CN or nixio.uname().nodename, - O = not O and "LuCId Keymaster" or #O > 0 and O - } - - local stat, px5g = pcall(require, "px5g") - if not stat then - return nixio.syslog("err", "Unable to load PX5G Keymaster") - end - - nixio.syslog("warning", "PX5G: Generating private key") - local rk = px5g.genkey(bits) - local keyfile = nixio.open(key, "w", 600) - if not rk or not keyfile or not keyfile:writeall(rk:asn1()) then - return nixio.syslog("err", "Unable to generate private key") - end - keyfile:close() - - nixio.syslog("warning", "PX5G: Generating self-signed certificate") - if not fs.writefile(cert, rk:create_selfsigned(data, - os.time(), os.time() + 3600 * 24 * 366 * 15)) then - return nixio.syslog("err", "Unable to generate certificate") - end - end - - if cert then - if not tls:set_cert(cert, xtype) then - nixio.syslog("err", "Unable to load certificate: " .. cert) - end - end - if key then - if not tls:set_key(key, xtype) then - nixio.syslog("err", "Unable to load private key: " .. key) - end - end - - if ciphers then - if type(ciphers) == "table" then - ciphers = table.concat(ciphers, ":") - end - tls:set_ciphers(ciphers) - end - end - return tls -end diff --git a/libs/lucid/root/etc/config/lucid b/libs/lucid/root/etc/config/lucid deleted file mode 100644 index 07c32c16c..000000000 --- a/libs/lucid/root/etc/config/lucid +++ /dev/null @@ -1,52 +0,0 @@ -config lucid main - option pollinterval 15000 - option threadlimit 10 - option daemonize 1 - option debug 0 - list supports tcpserver - list supports server - -config DirectoryPublisher webroot - option name 'Webserver Share' - option physical /www - option virtual '' - option domain '' - -config LuciWebPublisher luciweb - option name 'LuCI Webapplication' - option physical '' - option home 1 - list virtual /luci - list virtual /cgi-bin/luci - option domain '' - -config tcpserver httpd - option entrypoint "luci.lucid.http" - list supports DirectoryPublisher - list supports LuciWebPublisher - -config daemon http - option slave httpd - list address 80 - list publisher webroot - list publisher luciweb - option nokeepalive 1 - option memlimit 1572864 - option enabled 1 - -config daemon https - option slave httpd - list address 443 - list publisher webroot - list publisher luciweb - option nokeepalive 1 - option memlimit 1572864 - option enabled 1 - option tls maincert - option encryption enable - -config tls maincert - option key /etc/nixio/rsa_main.der - option cert /etc/nixio/cert_main.der - option type asn1 - option generate 1 diff --git a/libs/lucid/root/etc/init.d/lucid b/libs/lucid/root/etc/init.d/lucid deleted file mode 100755 index 1b2b04ed4..000000000 --- a/libs/lucid/root/etc/init.d/lucid +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh /etc/rc.common -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -NAME=lucid -DESC="LuCId superserver" -START=49 - -test -x $DAEMON || exit 0 -set -e - -start() { - echo -n "Starting $DESC: $NAME" - lua -lluci.lucid -e 'luci.lucid.start()' - echo "." -} - -stop() { - echo -n "Stopping $DESC: $NAME" - lua -lluci.lucid -e 'luci.lucid.stop()' - echo "." -} - -restart() { - # echo -n "Restarting $DESC: $NAME... " - # start-stop-daemon -K -s HUP -q -x $DAEMON - # echo "done." - stop - sleep 3 - start -} - -reload() { - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # echo -n "Reloading $DESC configuration... " - # start-stop-daemon -K -s 1 -q -x $DAEMON - # echo "done." - restart -} |