2010/5/11 agogolev <[email protected]> > Hi everyone! > > # touch lease > # izcoordinator -d 1 -l lease -i wpan0 -p 0x777 -s 1 -c 11 > Opt: d (64) > Opt: d (64) > Opt: l (6c) > Opt: l (6c) > Opt: i (69) > Opt: i (69) > Opt: p (70) > Opt: p (70) > Opt: s (73) > Opt: s (73) > Opt: c (63) > Opt: c (63) > Opt: � (ff) > open: No such file or directory > > I have the same problem. The izcoordinator can't find "PID_FILE" and give this error message. The location of PID_FILE is defined by "prefix". You can touch a new file "izcoordinator.pid" under $PREFIX/var/run in your imote2 or use my patch. My patch add a new option for izcoordinator to locate "pid_file".
xue liu What to do? > -- > Respectfully yours, Alexander E. Gogolev > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Linux-zigbee-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel >
From 5ec96e6b5284920eee9990039be1e979e2192e5d Mon Sep 17 00:00:00 2001 From: liuxue <[email protected]> Date: Sat, 8 May 2010 14:39:02 +0800 Subject: [PATCH] * add pid_file location --- src/coordinator.c | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/coordinator.c b/src/coordinator.c index 7ab88e2..b875226 100644 --- a/src/coordinator.c +++ b/src/coordinator.c @@ -56,6 +56,7 @@ static int family; static struct nl_handle *nl; static const char *iface; static char lease_file[PATH_MAX]; +static char pid_file[PATH_MAX]; static int die_flag = 0; @@ -249,6 +250,7 @@ static void usage(char * name) printf("Usage: %s [OPTION]... -i IFACE\n", name); printf("Provide a userspace part of IEEE 802.15.4 coordinator on specified IFACE.\n\n"); printf( " -l lease_file Where we store lease file.\n" + " -f pid_file Where we store pid of izcoordinator.\n" " -d debug_level Set debug level of application.\n" " Will not demonize on levels > 0.\n" " -m range_min Minimal new 16-bit address allocated.\n" @@ -281,7 +283,9 @@ int main(int argc, char **argv) int opt, debug, pid_fd, uid; uint16_t pan = 0xffff, short_addr = 0xffff; char pname[PATH_MAX]; + char fname[PATH_MAX]; char * p; + char * f; uint8_t channel = 0; debug = 0; @@ -296,13 +300,21 @@ int main(int argc, char **argv) strncpy(pname, argv[0], PATH_MAX); + memcpy(pid_file, PID_FILE, sizeof(pid_file)); + + f = getenv("PID_FILE"); + if(f) + strncpy(pid_file, f, PATH_MAX); + + strncpy(fname, argv[0], PATH_MAX); + while(1) { #ifdef HAVE_GETOPT_LONG int option_index = 0; - opt = getopt_long(argc, argv, "l:d:m:n:i:s:p:c:hv", + opt = getopt_long(argc, argv, "l:f:d:m:n:i:s:p:c:hv", long_options, &option_index); #else - opt = getopt(argc, argv, "l:d:m:n:i:s:p:c:hv"); + opt = getopt(argc, argv, "l:f:d:m:n:i:s:p:c:hv"); #endif fprintf(stderr, "Opt: %c (%hhx)\n", opt, opt); if (opt == -1) @@ -312,6 +324,9 @@ int main(int argc, char **argv) case 'l': strncpy(lease_file, optarg, PATH_MAX); break; + case 'f': + strncpy(pid_file, optarg, PATH_MAX); + break; case 'd': debug = atoi(optarg); break; @@ -442,7 +457,7 @@ int main(int argc, char **argv) return 2; } } - pid_fd = open (PID_FILE, O_WRONLY | O_CREAT, 0640); + pid_fd = open (pid_file, O_WRONLY | O_CREAT, 0640); if (pid_fd < 0) { perror ("open"); return 1; -- 1.6.3.3
------------------------------------------------------------------------------
_______________________________________________ Linux-zigbee-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
