what is the best method for start a Socket Server routine in
a linux server? I need run this routine when the Linux box
start every morning.
Now, I use the mumps -r ^ROUTINE, but only for test purposes.
It's posibly run as a service in xinetd?
Thanks in advance,
Take a look at the VistA VA Demo Toaster posted at http://sourceforge.net/projects/worldvista to see how mumps -run GTMLNX^XWBTCPM is started up by inetd when a connection request comes in at port 9297. Look at files /etc/services, /etc/inetd.conf and /var/VAVistADemo20060926/gtm_V5.2-000/cprs_direct.
I couldn't download the file because this are too big.
Is there any link to get it via ftp, with resume option
for break connections?
thanks and kind regards,
I am sure that there are utilities to download files resuming after lost connections, but I do not know what they are. If you send me your mailing address at bhaskar at users dot sourceforge dot net, I can mail you a CD. However the following should cover the essentials:
bash-2.05b# tail -6 /etc/services
dircproxy 57000/tcp # Detachable IRC Proxy
tfido 60177/tcp # fidonet EMSI over telnet
fido 60179/tcp # fidonet EMSI over telnet
# Locally defined - for VistA CPRS GUI
cprs-gui 9297/tcp # direct connect VistA CPRS GUI
bash-2.05b# tail -6 /etc/inetd.conf
vboxd stream tcp nowait root /usr/sbin/tcpd /usr/sbin/vboxd
# Local services - allow VistA CPRS GUI to connect
cprs-gui stream tcp nowait dsl /home/dsl/myVistA/gtm_V5.2-000/cprs_direct
bash-2.05b# cat /home/dsl/myVistA/gtm_V5.2-000/cprs_direct
# cprs_direct - start a process to serve the CPRS Gui client
# Set up the environment for VistA
cd `dirname $0`
# Run the server for the CPRS GUI client
mumps -run GTMLNX^XWBTCPM
I have modified the inetd.conf and the services files for calling
my mumps script:
gtm-web stream tcp nowait gtm /home/gtm/m_script
gtm-web 11111/tcp # sockets server
gtmroutines="/home/gtm/ . $gtm_dist"
mumps -run W
If I run this script manually, thats rules fine, but
when I call the php script from a web page to request data through the 11111 port
I receive the message: '%GTM-F-FORCEDHALT, Image HALTed by MUPIP STOP'
and the mozilla hangs until the mumps process ends (KILL).
Thank you again!!
This routine, called via inetd, never makes the OPEN in W+8 ... why?
The socket server routine:
W ;*** Socket Server ***
S $ZTRAP="ZGOTO "_$ZLEVEL_":ERR"
O dev:(ZLISTEN=por_":TCP":DELIMITER=$C(13):ATTACH="listener"):tim:"SOCKET" E Q
F W /WAIT(tim) Q:$KEY'=""
I cmd="CONNECT" G E
I cmd'="READ" G E
U dev:(SOCKET=sck:EXCEPTION="G ERR")
I $DEVICE C dev:(SOCKET=sck) D LOG("Error: $DEVICE="_$DEVICE) G E
I $KEY'=$C(13) G E
I log D LOG(dat)
S cmd=$P(dat," "),dat=$P(dat," ",2,32767)
I cmd="get" W @dat,! C dev:(SOCKET=sck) G E
I cmd="xec" X @dat C dev:(SOCKET=sck) G E
I cmd="do" D @dat C dev:(SOCKET=sck) G E
LOG(t) ;===== Login =====
ERR ;===== Error =====
When started by inetd, $PRINCIPAL is set to the socket passed
by inetd so it doesn't need to be opened though a USE to set
up delimiters and other device parameters is. $KEY will
Trying to open a socket on the same port inetd is serving
will cause interference.
The "%GTM-F-FORCEDHALT, Image HALTed by MUPIP STOP"
message means a SIGTERM was sent to the GT.M process.
thanks for your response!
With only 'USE' the socket, the routine works fine.