From: chas w. <ch...@us...> - 2003-05-02 17:35:09
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv7193 Modified Files: Tag: V2_5_0 main.c zeppelin.8 Log Message: zeppelin will now create a file during startup in /var/run called lec[interface number].pid containing its pid. this makes it easier to find a kill a particular interface via a script Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** main.c 2 May 2003 17:19:41 -0000 1.2.2.1 --- main.c 2 May 2003 17:35:03 -0000 1.2.2.2 *************** *** 41,44 **** --- 41,45 ---- #include <getopt.h> #include <errno.h> + #include <fcntl.h> #include <atm.h> *************** *** 202,205 **** --- 203,208 ---- struct sockaddr_atmsvc manual_atm_addr; struct sockaddr_atmsvc listen_addr; + char pidbuf[PATH_MAX + 1]; + int fd; memset(elan_name, '\0', sizeof(elan_name)); *************** *** 413,416 **** --- 416,429 ---- } } + + sprintf(pidbuf, "/var/run/lec%d.pid", itf); + fd = open(pidbuf, O_CREAT | O_WRONLY, 0600); + if (fd < 0) { + diag(COMPONENT, DIAG_FATAL, "open(%s, ..) failed, %s\n", pidbuf, strerror(errno)); + return -1; + } + sprintf(pidbuf, "%d\n", getpid()); + write(fd, pidbuf, strlen(pidbuf)); + close(fd); diag(COMPONENT, DIAG_DEBUG, "initializing lec parameters\n"); Index: zeppelin.8 =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/zeppelin.8,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** zeppelin.8 2 May 2003 17:23:19 -0000 1.2.2.1 --- zeppelin.8 2 May 2003 17:35:04 -0000 1.2.2.2 *************** *** 99,102 **** --- 99,105 ---- recommended. Token Ring support has received less testing than its Ethernet counterpart. + .SH FILES + .IP \fI/var/run/lec[interface number].pid\fP + The file containing the process id of zeppelin. .SH BUGS John Bonham died 1980 and Led Zeppelin broke. |