Stopping TCP service

1 view
Skip to first unread message

Zia

unread,
Oct 25, 2009, 5:24:39 AM10/25/09
to Ensemble-in...@googlegroups.com
Hi,
 
How to stop TCP service from terminal ? I tried to disable TCP inside the production but it ask for updating the production which i tried, but it did not perform the update.
 
 
Thanks,
Zia

Rahul

unread,
Oct 26, 2009, 7:11:00 AM10/26/09
to InterSystems: Ensemble in Healthcare
Hi Zia,
IF you want to handle that out from terminal first you
need to create a handle for your production and then for the
service . Then you will have to set the Enabled property to zero ,
save the service handle and then update the production.
You will have to perform the following:

Set obj = ##class(Ens.Config.Production).%OpenId
("YourProductionName",.tStatus)
set obj1 = obj.FindItemByConfigName("YourServiceName")
set obj1.Enabled = 0
set tStatus = obj1.%Save()

Then

set tSC= ##class(Ens.Director).UpdateProduction()

I hope that helps.

Regards,
Rahul Srivastava
+91-9818446535

Zia

unread,
Oct 26, 2009, 7:16:31 AM10/26/09
to Ensemble-in...@googlegroups.com
That's looks cool thanks....I will try

Heloisa Ramalho

unread,
Oct 26, 2009, 7:54:26 AM10/26/09
to Ensemble-in...@googlegroups.com
Hi,

Method ##class(Ens.Director).EnableConfigItem(name,0) should disable an item, the second parameter is 0 to disable or 1 to enable, does it work for you?  If it doesn't, please give us more details, and let us know the version you are using.

Thanks

--
Heloisa

InterSystems Development


/// Enable or disable a ConfigItem in a Production. The Production may be running or not.
/// The pConfigItemName argument gives the name of the config item to be enabled or disabled
/// In the case of multiple matching items with the same config name, if any is already enabled then
/// the pEnable=1 option will do nothing and the pEnable=0 option will disable the running matching
/// production item, or if not running then the first matching enabled item that it finds.
///
/// See method Ens.Director.ParseConfigName() for full syntax of the ConfigItem name specification string.
ClassMethod
EnableConfigItem(pConfigItemName As %String, pEnable As %Boolean = 1, pDoUpdate As %Boolean = 1) As %Status

James MacKeith

unread,
Oct 26, 2009, 7:57:24 AM10/26/09
to InterSystems: Ensemble in Healthcare
Thanks Rahul

There is also the API in the Ens.Director class:

Set tStatus=##class(Ens.Director).EnableConfigItem
(<itemName>,<flagToEnableOrDisable>,<flagToUpdateProduction>)

Now if the Update Production button still shows one can hover the
mouse over the button to see the reason(s).

Regards

James

ps note on a slight tangent: the EnableConfigItem api cannot be
called from within a production item such as a business service.

On Oct 26, 7:16 am, Zia <ziauddin.qure...@gmail.com> wrote:
> That's looks cool thanks....I will try
>

Zia

unread,
Oct 26, 2009, 8:00:59 AM10/26/09
to Ensemble-in...@googlegroups.com
Like I said i was trying to disable my TCP service BS inside Ensemble production. Once i uncheck the enable option in configuration parameters. It asked for update the production. When I trying doing that, it did not updated. Some job was running behind. Ensemble 2008.2.2 ....Do you have any comments on
 
Set obj = ##class(Ens.Config.Production).%OpenId
("YourProductionName",.tStatus)
 set obj1 = obj.FindItemByConfigName("YourServiceName")
 set obj1.Enabled = 0
 set tStatus = obj1.%Save()

Then

 set tSC= ##class(Ens.Director).UpdateProduction()
 
I have not tried it yet.

Zia

unread,
Oct 26, 2009, 8:02:26 AM10/26/09
to Ensemble-in...@googlegroups.com
To add further, i would be using from terminal

Heloisa Ramalho

unread,
Oct 26, 2009, 8:29:33 AM10/26/09
to Ensemble-in...@googlegroups.com
Hi,

Thanks for the information.

About why the update didn't work, perhaps the TCP service was in a timed read and didn't respond timely, or something like that.

About the code provided by Rahul, it is a simpler version of the code in method EnableConfigItem(), it should work in most cases.  Our API also looks for items with duplicate names, and things like that.  It's okay to use the code provided, no problem.

Do want to disable this config item because it's stuck, or you just want to stop the interface with no particular problem going on?  If it's stuck whatever is preventing it from working properly may also be the same reason why it's failing to respond to the attempt to be stopped.

Heloisa

Zia

unread,
Oct 26, 2009, 8:53:40 AM10/26/09
to Ensemble-in...@googlegroups.com
Yes it stuck so i want to forcefully stop the TCP service ?? Is that fine if i used the given codes?

Ted Peck

unread,
Oct 26, 2009, 9:45:26 AM10/26/09
to Ensemble-in...@googlegroups.com
You should look at the Event Log for this particular service to see if it gives any clues.
 
The most common cause for this sort of thing is that the TCP service has made a synchronous call and is waiting for a synchonous response that is not forthcoming.
 
The quick remedy is to kill the job using the Processes page in the System Management Portal.  You can find the job number by clicking the Instances button in the lower config pane.
 
You could also look at the Message Trace diagram for the last message sent from your Service and see if you can fix the Operation that's failing to respond. For example resubmitting a suspended message might do it.
 
The second most common cause is that the the Service's CallInterval or ReadTimeout setting is longer than 10 seconds, which is the default value for the UpdateTimeout setting for the general Production.  If that's the case it might help to lengthen the UpdateTimeout setting and then click Update Production again. You can change the UpdateTimeout by clicking in the background area of the Config diagram so that the bottom config pane shows settings that apply to the Production generally (rather than to any particular config item in the Production).  Then change the UpdateTimeout value and click Apply.
 
Using the API for EnableConfigItem is not going to help because the item has already been successfully marked as Disabled, it just has a job running that won't stop. That's the reason the Update Production button appears: the configured state doesn't match the running state, in this case because no jobs should be running for a disabled item yet one is running anyway. You can confirm this by reading the hover text that appears over the Update Production button.
 
Hope this helps,
Ted
Reply all
Reply to author
Forward
0 new messages