From 884a7d859a9a3de1eaedc7fe9e30e907db1d8bad Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Sun, 30 Jan 2011 10:18:19 +0100 Subject: [PATCH] [spid + fsync] change CTRL and DAEMON paths to point to spid --- mote/v2/openwrt/package/flukso/luasrc/fsync.lua | 8 ++++---- mote/v2/openwrt/package/flukso/luasrc/spid.lua | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua index 2714b18..7bbe721 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua @@ -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 diff --git a/mote/v2/openwrt/package/flukso/luasrc/spid.lua b/mote/v2/openwrt/package/flukso/luasrc/spid.lua index cf5d3d6..d9b0745 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/spid.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/spid.lua @@ -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 @@ -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')