[spid + fsync] change CTRL and DAEMON paths to point to spid
This commit is contained in:
parent
069a8540b0
commit
884a7d859a
|
@ -28,7 +28,7 @@ local nixio = require 'nixio'
|
||||||
nixio.fs = require 'nixio.fs'
|
nixio.fs = require 'nixio.fs'
|
||||||
local uci = require 'luci.model.uci'.cursor()
|
local uci = require 'luci.model.uci'.cursor()
|
||||||
|
|
||||||
local CTRL_PATH = '/var/run/fluksod/ctrl'
|
local CTRL_PATH = '/var/run/spid/ctrl'
|
||||||
local CTRL_PATH_IN = CTRL_PATH .. '/in'
|
local CTRL_PATH_IN = CTRL_PATH .. '/in'
|
||||||
local CTRL_PATH_OUT = CTRL_PATH .. '/out'
|
local CTRL_PATH_OUT = CTRL_PATH .. '/out'
|
||||||
|
|
||||||
|
@ -42,15 +42,15 @@ local ctrl = { fdin = nixio.open(CTRL_PATH_IN, O_RDWR_NONBLOCK),
|
||||||
events = POLLIN,
|
events = POLLIN,
|
||||||
revents = 0 }
|
revents = 0 }
|
||||||
|
|
||||||
ctrl.fd = ctrl.fdout -- need this entry for nixio.poll
|
|
||||||
ctrl.line = ctrl.fdout:linesource()
|
|
||||||
|
|
||||||
if ctrl.fdin == nil or ctrl.fdout == nil then
|
if ctrl.fdin == nil or ctrl.fdout == nil then
|
||||||
print('Error. Unable to open the ctrl fifos.')
|
print('Error. Unable to open the ctrl fifos.')
|
||||||
print('Exiting...')
|
print('Exiting...')
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ctrl.fd = ctrl.fdout -- need this entry for nixio.poll
|
||||||
|
ctrl.line = ctrl.fdout:linesource()
|
||||||
|
|
||||||
-- TODO acquire an exclusive lock on the ctrl fifos or exit
|
-- TODO acquire an exclusive lock on the ctrl fifos or exit
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
fluksod.lua - Lua part of the Flukso daemon
|
spid.lua - Lua part of the Flukso daemon
|
||||||
|
|
||||||
Copyright (C) 2011 Bart Van Der Meerssche <bart.vandermeerssche@flukso.net>
|
Copyright (C) 2011 Bart Van Der Meerssche <bart.vandermeerssche@flukso.net>
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ local TIMERFD_NS = 0
|
||||||
|
|
||||||
local GET_DELTA = 'gd'
|
local GET_DELTA = 'gd'
|
||||||
|
|
||||||
local DAEMON = os.getenv('DAEMON') or 'fluksod'
|
local DAEMON = os.getenv('DAEMON') or 'spid'
|
||||||
local DAEMON_PATH = os.getenv('DAEMON_PATH') or '/var/run/' .. DAEMON
|
local DAEMON_PATH = os.getenv('DAEMON_PATH') or '/var/run/' .. DAEMON
|
||||||
|
|
||||||
local O_RDWR_NONBLOCK = nixio.open_flags('rdwr', 'nonblock')
|
local O_RDWR_NONBLOCK = nixio.open_flags('rdwr', 'nonblock')
|
||||||
|
@ -53,8 +53,8 @@ function mkfifos(input)
|
||||||
local path = string.format('%s/%s/', DAEMON_PATH, input)
|
local path = string.format('%s/%s/', DAEMON_PATH, input)
|
||||||
|
|
||||||
nixio.fs.mkdirr(path)
|
nixio.fs.mkdirr(path)
|
||||||
nixio.fs.unlink(path .. 'in') -- clean up mess from previous run
|
-- nixio.fs.unlink(path .. 'in') -- clean up mess from previous run
|
||||||
nixio.fs.unlink(path .. 'out') -- idem
|
-- nixio.fs.unlink(path .. 'out') -- idem
|
||||||
nixio.fs.mkfifo(path .. 'in', '644')
|
nixio.fs.mkfifo(path .. 'in', '644')
|
||||||
nixio.fs.mkfifo(path .. 'out', '644')
|
nixio.fs.mkfifo(path .. 'out', '644')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue