Linux Background Task

31 views
Skip to first unread message

Chris Combs

unread,
Jul 12, 2017, 11:28:11 AM7/12/17
to George James Software
Can Serenji be used to debug a headless task such as an RPC or standalone task in Linux?

Chris Combs

unread,
Jul 12, 2017, 11:49:18 AM7/12/17
to George James Software
The reason I asked is it reads and writes TCP/IP sockets .....

George James

unread,
Jul 12, 2017, 11:55:33 AM7/12/17
to george-james-s...@googlegroups.com
Chris
You don't mention whether you are using Cache or GT.M.

If you are using Cache you can attach to a running process.  There are details in the Serenji Help document in the section Debugging / Attaching to a Process.

Regards
George



From: "Chris Combs" <chris...@sellingrtp.com>
To: "George James Software" <george-james-s...@googlegroups.com>
Sent: Wednesday, 12 July, 2017 15:50:13
Subject: [GeorgeJamesSoftware] Linux Background Task

Can Serenji be used to debug a headless task such as an RPC or standalone task in Linux?

--
You received this message because you are subscribed to the Google Groups "George James Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to george-james-softwar...@googlegroups.com.
To post to this group, send email to george-james-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/george-james-software-public.
For more options, visit https://groups.google.com/d/optout.

Chris Combs

unread,
Jul 12, 2017, 12:02:25 PM7/12/17
to George James Software
GTM


On Wednesday, July 12, 2017 at 11:55:33 AM UTC-4, George James wrote:
Chris
You don't mention whether you are using Cache or GT.M.

If you are using Cache you can attach to a running process.  There are details in the Serenji Help document in the section Debugging / Attaching to a Process.

Regards
George



From: "Chris Combs" <chris...@sellingrtp.com>
To: "George James Software" <george-james-s...@googlegroups.com>
Sent: Wednesday, 12 July, 2017 15:50:13
Subject: [GeorgeJamesSoftware] Linux Background Task

Can Serenji be used to debug a headless task such as an RPC or standalone task in Linux?

--
You received this message because you are subscribed to the Google Groups "George James Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to george-james-software-public+unsub...@googlegroups.com.

Chris Combs

unread,
Jul 12, 2017, 12:13:33 PM7/12/17
to George James Software
I am in the process of prchasing for that purpose and wanted to make sure I was buying a solution I can use.  My task will run on port 8xxx (really any port I choose) .... but reading and writing sockets in GTM means you are redirecting IO ... so wanted to make sure Serenji can give me a window into this task which I currently don't have for debugging.


On Wednesday, July 12, 2017 at 11:55:33 AM UTC-4, George James wrote:
Chris
You don't mention whether you are using Cache or GT.M.

If you are using Cache you can attach to a running process.  There are details in the Serenji Help document in the section Debugging / Attaching to a Process.

Regards
George



From: "Chris Combs" <chris...@sellingrtp.com>
To: "George James Software" <george-james-s...@googlegroups.com>
Sent: Wednesday, 12 July, 2017 15:50:13
Subject: [GeorgeJamesSoftware] Linux Background Task

Can Serenji be used to debug a headless task such as an RPC or standalone task in Linux?

--
You received this message because you are subscribed to the Google Groups "George James Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to george-james-software-public+unsub...@googlegroups.com.

rms

unread,
Jul 13, 2017, 10:08:33 AM7/13/17
to George James Software
If you cannot use Serenji to attach to a live process in GTM, is it because of something fundamentally different in the way that Cache and GTM do things?  In other words, with a reasonable amount of effort, can it also be done in GTM?

George James

unread,
Jul 13, 2017, 11:02:32 AM7/13/17
to george-james-software-public
Chris
You can attach to a running GT.M process by using the gtm_zinterrupt environment variable to invoke Serenji.

Ensure that the process that you want to be able to attach to has gtm_zinterrupt set as follows:
export gtm_zinterrupt='IF $$ENABLE^%SerenjD("nn.nn.nn.nn",,,"-0")'

or with your m code:
set $zinterrupt="IF $$ENABLE^%SerenjD(""nn.nn.nn.nn"",,,""-0"")'

where nn.nn.nn.nn is the IP address of the machine where you have the Serenji client installed.  Make sure you have the Serenji Sentry running in the taskbar notification area of your desktop as this listens for the connection from your process.

Then when you want to attach to the process issue the command:
mupip intrpt <pid>

where <pid> is the process id of the process you want to attach to.

This will cause your process to break wherever it happens to be and connect to the Serenji client.  From there you can examine your process and step through the code.

You can call $$ENABLE^%SerenjD() directly from any process if you want to use some other signalling mechanism to trigger debugging rather than using gtm_zinterrupt. Consult the source code in file _SerenjD.m for more documentation about the arguments to $$ENABLE.


Regards
George

George James Software
PO Box 701, Weybridge, KT13 3GZ, UK
0793 032 0241 / 01932-252568

I'm running 60 miles on July 15th in aid of Woking and Same Beare Hospices.  Please sponsor me: https://www.justgiving.com/fundraising/georgejames2017



From: "Chris Combs" <chris...@sellingrtp.com>
To: "george-james-software-public" <george-james-s...@googlegroups.com>
Sent: Wednesday, 12 July, 2017 17:05:58
Subject: Re: [GeorgeJamesSoftware] Linux Background Task

I am in the process of prchasing for that purpose and wanted to make sure I was buying a solution I can use.  My task will run on port 8xxx (really any port I choose) .... but reading and writing sockets in GTM means you are redirecting IO ... so wanted to make sure Serenji can give me a window into this task which I currently don't have for debugging.

On Wednesday, July 12, 2017 at 11:55:33 AM UTC-4, George James wrote:
Chris
You don't mention whether you are using Cache or GT.M.

If you are using Cache you can attach to a running process.  There are details in the Serenji Help document in the section Debugging / Attaching to a Process.

Regards
George



From: "Chris Combs" <chris...@sellingrtp.com>
To: "George James Software" <george-james-s...@googlegroups.com>
Sent: Wednesday, 12 July, 2017 15:50:13
Subject: [GeorgeJamesSoftware] Linux Background Task

Can Serenji be used to debug a headless task such as an RPC or standalone task in Linux?

--
You received this message because you are subscribed to the Google Groups "George James Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to george-james-softwar...@googlegroups.com.

To post to this group, send email to george-james-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/george-james-software-public.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "George James Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to george-james-softwar...@googlegroups.com.

Sam Habiel

unread,
Jul 13, 2017, 11:14:29 AM7/13/17
to george-james-s...@googlegroups.com
George,

I didn't know this! That's wonderful.

--Sam

rms

unread,
Jul 17, 2017, 3:54:21 AM7/17/17
to George James Software
Great information.  Thank you so much.
Reply all
Reply to author
Forward
0 new messages