Add start script to launch domod and sprinklerd
This commit is contained in:
24
bsp/board/domo/ovl/etc/init.d/domod
Executable file
24
bsp/board/domo/ovl/etc/init.d/domod
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
#
|
||||||
|
# Start Domo Daemon
|
||||||
|
|
||||||
|
START=60
|
||||||
|
STOP=60
|
||||||
|
|
||||||
|
NAME=domod
|
||||||
|
|
||||||
|
PROG=/usr/local/bin/$NAME
|
||||||
|
PIDFILE=/var/run/$NAME.pid
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
# PROCD_DEBUG=1
|
||||||
|
|
||||||
|
start_service () {
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG"
|
||||||
|
procd_set_param pidfile "$PIDFILE"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
24
bsp/board/domo/ovl/etc/init.d/sprinklerd
Executable file
24
bsp/board/domo/ovl/etc/init.d/sprinklerd
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
#
|
||||||
|
# Start Sprinkler Daemon
|
||||||
|
|
||||||
|
START=62
|
||||||
|
STOP=62
|
||||||
|
|
||||||
|
NAME=sprinklerd
|
||||||
|
|
||||||
|
PROG=/usr/local/bin/$NAME
|
||||||
|
PIDFILE=/var/run/$NAME.pid
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
# PROCD_DEBUG=1
|
||||||
|
|
||||||
|
start_service () {
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG"
|
||||||
|
procd_set_param pidfile "$PIDFILE"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
1
bsp/board/domo/ovl/etc/rc.d/K60domod
Symbolic link
1
bsp/board/domo/ovl/etc/rc.d/K60domod
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../init.d/domod
|
||||||
1
bsp/board/domo/ovl/etc/rc.d/K62sprinklerd
Symbolic link
1
bsp/board/domo/ovl/etc/rc.d/K62sprinklerd
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../init.d/sprinklerd
|
||||||
1
bsp/board/domo/ovl/etc/rc.d/S60domod
Symbolic link
1
bsp/board/domo/ovl/etc/rc.d/S60domod
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../init.d/domod
|
||||||
1
bsp/board/domo/ovl/etc/rc.d/S62sprinklerd
Symbolic link
1
bsp/board/domo/ovl/etc/rc.d/S62sprinklerd
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../init.d/sprinklerd
|
||||||
@@ -44,7 +44,7 @@ extern "C" {
|
|||||||
|
|
||||||
/*--------------------------------- GLOBALS ---------------------------------*/
|
/*--------------------------------- GLOBALS ---------------------------------*/
|
||||||
|
|
||||||
|
#define kConfigPath "/usr/local/share/domo/"
|
||||||
|
|
||||||
/*! ----------------------------------------------------------------------------
|
/*! ----------------------------------------------------------------------------
|
||||||
* @fn setupUbus
|
* @fn setupUbus
|
||||||
@@ -87,23 +87,15 @@ static struct ubus_context *setupUbus (void)
|
|||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
int theRet = 0;
|
int theRet = 0;
|
||||||
char *theWritePath;
|
|
||||||
std::string theDevicePath, theTimerPath;
|
std::string theDevicePath, theTimerPath;
|
||||||
struct ubus_context *theCtx = NULL;
|
struct ubus_context *theCtx = NULL;
|
||||||
|
|
||||||
theWritePath = getenv ("DOMO_WRITE_PATH");
|
|
||||||
if (theWritePath == NULL) {
|
|
||||||
|
|
||||||
fprintf (stderr, "you should export DOMO_WRITE_PATH. with the Path of data.\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create Configs Paths...
|
// Create Configs Paths...
|
||||||
|
|
||||||
theDevicePath = theWritePath;
|
theDevicePath = kConfigPath;
|
||||||
theDevicePath += "/Devices.json";
|
theDevicePath += "/Devices.json";
|
||||||
|
|
||||||
theTimerPath = theWritePath;
|
theTimerPath = kConfigPath;
|
||||||
theTimerPath += "/Timers.json";
|
theTimerPath += "/Timers.json";
|
||||||
|
|
||||||
//printf ("DOMO PATH: %s\n", thePath.c_str());
|
//printf ("DOMO PATH: %s\n", thePath.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user