[spid + fsync] change CTRL and DAEMON paths to point to spid

This commit is contained in:
Bart Van Der Meerssche 2011-01-30 10:18:19 +01:00
parent 069a8540b0
commit 884a7d859a
2 changed files with 8 additions and 8 deletions

View File

@ -28,7 +28,7 @@ local nixio = require 'nixio'
nixio.fs = require 'nixio.fs'
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_OUT = CTRL_PATH .. '/out'
@ -42,15 +42,15 @@ local ctrl = { fdin = nixio.open(CTRL_PATH_IN, O_RDWR_NONBLOCK),
events = POLLIN,
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
print('Error. Unable to open the ctrl fifos.')
print('Exiting...')
os.exit(1)
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

View File

@ -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>
@ -42,7 +42,7 @@ local TIMERFD_NS = 0
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 O_RDWR_NONBLOCK = nixio.open_flags('rdwr', 'nonblock')
@ -53,8 +53,8 @@ function mkfifos(input)
local path = string.format('%s/%s/', DAEMON_PATH, input)
nixio.fs.mkdirr(path)
nixio.fs.unlink(path .. 'in') -- clean up mess from previous run
nixio.fs.unlink(path .. 'out') -- idem
-- nixio.fs.unlink(path .. 'in') -- clean up mess from previous run
-- nixio.fs.unlink(path .. 'out') -- idem
nixio.fs.mkfifo(path .. 'in', '644')
nixio.fs.mkfifo(path .. 'out', '644')