home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!cs.utexas.edu!sdd.hp.com!network.ucsd.edu!mvb.saic.com!info-multinet
- From: GAVRON@IT.SUNQUEST.COM (Ehud Gavron 602-570-2546)
- Newsgroups: vmsnet.networks.tcp-ip.multinet
- Subject: Question about running a command procedure from the Multinet_Server
- Message-ID: <921229140333.85a9@IT.SUNQUEST.COM>
- Date: Tue, 29 Dec 1992 14:03:33 -0700 (MST)
- Organization: Info-Multinet<==>Vmsnet.Networks.Tcp-Ip.Multinet Gateway
- X-Gateway-Source-Info: Mailing List
- Lines: 92
-
- Date sent: 29-DEC-1992 14:01:16
-
-
- I wrote:
- >> Ideally one could
- >> mult config/serv
- >> add bogon
- >> set program multinet:run_bogon_mumps.com
- >
-
- Kevin Carosso added:
- >Yes, a facility for invoking servers with a CLI would be useful!
-
- I just got around it by doing:
-
- /*
- * call sys$creprc with input set to command file multinet:mumps_server.com
- * output nty device
- *
- * Then let the command file assign a channel to the nty device (before the
- * timer down below runs out ... kludge... kludge...) and open a log file
- * for output.
- */
-
-
- #include <descrip.h>
- #include <lnmdef.h>
- #define cli_image "SYS$SYSTEM:LOGINOUT.EXE"
- #define command_file "MULTINET:MUMPS_SERVER.COM"
- #define log_file "MULTINET:MUMPS_SERVER.LOG"
- #define lnm_table "LNM$FILE_DEV"
- #define inet_dev "SYS$INPUT"
-
- cmain()
- {
- int ss_stat;
- int sys$creprc();
- static int pid;
- struct {
- short buflen;
- short itemcode;
- char *bufaddr;
- int *retlen;
- } list[2];
-
- static $DESCRIPTOR(cli_desc,cli_image);
- static $DESCRIPTOR(cmd_desc,command_file);
- static $DESCRIPTOR(log_desc,log_file);
- static $DESCRIPTOR(lnm_desc,lnm_table);
- static $DESCRIPTOR(lnm_name,inet_dev);
- struct dsc$descriptor_s indev;
- char devbuf[100];
- indev.dsc$a_pointer = (char *) &devbuf;
- indev.dsc$w_length = sizeof(devbuf);
- indev.dsc$b_dtype = DSC$K_DTYPE_T;
- indev.dsc$b_class = DSC$K_CLASS_S;
-
- list[0].buflen = sizeof(devbuf);
- list[0].itemcode= LNM$_STRING;
- list[0].bufaddr = (char *) &devbuf;
- list[0].retlen = (int *) &indev.dsc$w_length;
- list[1].buflen = list[1].itemcode = 0;
-
- ss_stat = sys$trnlnm(0,&lnm_desc,&lnm_name,0,&list);
-
- if (!(ss_stat & 1)) sys$exit(ss_stat);
-
- ss_stat = sys$creprc(&pid, /* pidadr */
- &cli_desc, /* image */
- &cmd_desc, /* input */
- &indev, /* output - the real nty device */
- &indev, /* error - the real nty device */
- 0, /* prvadr */
- 0, /* quota */
- 0, /* prcnam */
- 0, /* baspri */
- 0, /* uic */
- 0, /* mbxunt */
- 0) ; /* stsflg */
-
- lib$wait(&5.0); /* <--- if we deassign too quickly, the new process
- won't have a device to attach to */
- return(ss_stat);
- }
-
-
- Ehud
-
- --
- Ehud Gavron (EG76)
- gavron@vesta.sunquest.com This was sent
- "The world bores you when you're cool." from an Alpha
-