Changles in LuCI
This commit is contained in:
parent
edabcb60cc
commit
185501b7fa
4 changed files with 21 additions and 10 deletions
|
@ -128,8 +128,9 @@
|
|||
|
||||
#define EVENT_LIST_LENGTH (4 + 2 + 4)
|
||||
|
||||
#define BUFFER_SIZE 2048
|
||||
#define EXPIRATION_TIME 60
|
||||
#define BUFFER_SIZE 2048 // 2 KB
|
||||
#define EXPIRATION_TIME 60 // 1 minute
|
||||
#define INITIAL_INTERVAL 100 * 1000000 // 100 milliseconds
|
||||
|
||||
|
||||
int serviceMode = MODE_CONSOLE;
|
||||
|
@ -247,6 +248,12 @@ int main(int argc, const char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (serviceMode & MODE_SYSLOG)
|
||||
{
|
||||
// Set proper origin for syslog (required by OpenWRT)
|
||||
openlog("CronosAgent", LOG_NOWAIT | LOG_PID, LOG_USER);
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
if ((serviceMode & MODE_DAEMON) &&
|
||||
(daemon(-1, -1) < 0))
|
||||
|
@ -376,7 +383,7 @@ int main(int argc, const char* argv[])
|
|||
struct itimerspec timerInterval;
|
||||
memset(&timerInterval, 0, sizeof(timerInterval));
|
||||
|
||||
timerInterval.it_value.tv_sec = REWIND_KEEP_ALIVE_INTERVAL;
|
||||
timerInterval.it_value.tv_nsec = INITIAL_INTERVAL;
|
||||
timerInterval.it_interval.tv_sec = REWIND_KEEP_ALIVE_INTERVAL;
|
||||
|
||||
timerHandle1 = timerfd_create(CLOCK_MONOTONIC, 0);
|
||||
|
|
|
@ -3,10 +3,5 @@ module("luci.controller.cronosagent", package.seeall)
|
|||
function index()
|
||||
entry({ "admin", "cronosagent" }, alias("admin", "cronosagent", "configure", "restart"), "CronosAgent")
|
||||
entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent/configure"), "Configure", 10)
|
||||
entry({ "admin", "cronosagent", "restart" }, call("restartCronosAgent"), "Restart", 20)
|
||||
end
|
||||
|
||||
function restartCronosAgent()
|
||||
luci.sys.call("/etc/init.d/cronosagent restart")
|
||||
luci.http.write("Done!")
|
||||
entry({ "admin", "cronosagent", "restart" }, template("cronosagent/restart"), "Restart", 20)
|
||||
end
|
||||
|
|
9
OpenWRT/view/cronosagent/restart.htm
Normal file
9
OpenWRT/view/cronosagent/restart.htm
Normal file
|
@ -0,0 +1,9 @@
|
|||
<%
|
||||
|
||||
luci.sys.call("/etc/init.d/cronosagent restart ; sleep 2")
|
||||
|
||||
%>
|
||||
<%+header%>
|
||||
<h2 name="content">CronosAgent</h2>
|
||||
<textarea readonly="readonly" wrap="off" rows="20"><%= luci.util.exec("logread | grep CronoSAgent") %></textarea>
|
||||
<%+footer%>
|
|
@ -1 +1 @@
|
|||
#define VERSION 20160811
|
||||
#define VERSION 20160812
|
||||
|
|
Loading…
Add table
Reference in a new issue