[Devel] [ openser-Patches-1606005 ] change process name to differntiate the threads

Klaus Darilion klaus.mailinglists at pernau.at
Fri Dec 1 11:21:37 CET 2006


Bogdan-Andrei Iancu wrote:
> Klaus,
> 
> have you consider using the "ps" internal command to see label/name of 
> each process? :
>       ./openserctl fifo ps

Wow - I haven't known of this command. One more question:

Listening on
              udp: 10.10.0.42 [10.10.0.42]:6060
              udp: 10.10.0.42 [10.10.0.42]:6070
              tcp: 10.10.0.42 [10.10.0.42]:6060
              tcp: 10.10.0.42 [10.10.0.42]:6070
              tls: 10.10.0.42 [10.10.0.42]:5063
Aliases:
              *: outbound.itsp2.ienum.labs.nic.at:*
              *: itsp2.ienum.labs.nic.at:*

.
server2:~# openserctl fifo ps
/usr/sbin/openserctl: line 9: 
=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/sbin//: 
No such file or directory
WARNING: no database engine found - tried ''
0       3474    attendant
1       3477    fifo server
2       3480    receiver child=0 sock= 10.10.0.42:6060
3       3482    receiver child=1 sock= 10.10.0.42:6060
4       3484    receiver child=2 sock= 10.10.0.42:6060
5       3485    receiver child=3 sock= 10.10.0.42:6060
6       3496    receiver child=0 sock= 10.10.0.42:6070
7       3500    receiver child=1 sock= 10.10.0.42:6070
8       3502    receiver child=2 sock= 10.10.0.42:6070
9       3503    receiver child=3 sock= 10.10.0.42:6070
10      3512    timer
11      3515    tcp receiver
12      3517    tcp receiver
13      3518    tcp receiver
14      3527    tcp receiver
15      3531    tcp main process
server2:~#


Is it correct that there are CHILDREN threads for each UDP socket, but 
only CHILDREN threads for all the TCP/TLS sockets? Why this?

regards
klaus


> 
> I think it is more simpler this way :)
> 
> regards,
> bogdan
> 
> Klaus Darilion wrote:
> 
>> Hi Dan!
>>
>> The problem is, that the string can't be longer than the original 
>> string (at least in the program sample I found). Maybe it is possible 
>> to redirect the argv pointer but I'm not a programmer :-(
>>
>> In my case I use ps -Alf to identify different openser processes on 
>> their further command line parameters (e.g. -f openser3.cfg ). My 
>> patch only changes argv[0] which is the application itself, not the 
>> other parameters.
>>
>> regards
>> klaus
>>
>> Dan Pascu wrote:
>>
>>> On Thursday 30 November 2006 14:27, Klaus Darilion wrote:
>>>
>>> Hey Klaus,
>>>
>>> The improvement looks nice and useful, but I think you should retain 
>>> somehow the openser name in the process list instead of only printing 
>>> something like fifo or udp 0
>>> Else it can get confusing (what if some other process decides to name 
>>> itself fifo?)
>>>
>>> Maybe just append the extra description after the original string, so 
>>> it'll look something like:
>>>
>>> 5 S root     14133     1   /usr/sbin/openser
>>> 1 S root     14134 14133   /usr/sbin/openser fifo
>>> 1 S root     14135 14133   /usr/sbin/openser udp 0
>>> ...
>>>
>>> or if you want:
>>> 5 S root     14133     1   /usr/sbin/openser
>>> 1 S root     14134 14133   openser fifo
>>> 1 S root     14135 14133   openser udp 0
>>> ...
>>>
>>> (however this second version as well as the original will be 
>>> confusing if you run 2 instances of openser on the same machine from 
>>> 2 different directories - /usr and /usr/local for example)
>>>
>>>> Hi!
>>>>
>>>> IMO this patch is useful as it helps debugging (which thread did what,
>>>> when certain threads crashes, ...).
>>>>
>>>> As I have no glue about forking in theory and memory handling between
>>>> the threads please review this patch  ;-)
>>>>
>>>> btw: I also missed some forks - maybe someone who knows how the forking
>>>> is done in more detail can take care of this.
>>>>
>>>>
>>>> regards
>>>> klaus
>>>>
>>>> SourceForge.net wrote:
>>>>
>>>>> Patches item #1606005, was opened at 2006-11-30 13:17
>>>>> Message generated for change (Tracker Item Submitted) made by Item
>>>>> Submitter You can respond by visiting:
>>>>> https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1606005&
>>>>> group_id=139143
>>>>>
>>>>> Please note that this message will contain a full copy of the comment
>>>>> thread, including the initial issue submission, for this request,
>>>>> not just the latest update.
>>>>> Category: None
>>>>> Group: None
>>>>> Status: Open
>>>>> Resolution: None
>>>>> Priority: 5
>>>>> Private: No
>>>>> Submitted By: Klaus Darilion (klaus_darilion)
>>>>> Assigned to: Nobody/Anonymous (nobody)
>>>>> Summary: change process name to differntiate the threads
>>>>>
>>>>> Initial Comment:
>>>>> Hi!
>>>>>
>>>>> Since long I am unhappy that it is not possible to identify openser's
>>>>> thread (which thread is doing what?).
>>>>>
>>>>> I made a little patch which rewrites the argv[0] to reflect the usage
>>>>> of the process.
>>>>>
>>>>> without patch:
>>>>> 5 S root     14133     1   /usr/sbin/openser
>>>>> 1 S root     14134 14133   /usr/sbin/openser
>>>>> 1 S root     14135 14133   /usr/sbin/openser
>>>>> 1 S root     14136 14133   /usr/sbin/openser
>>>>> 1 S root     14137 14133   /usr/sbin/openser
>>>>> 1 S root     14138 14133   /usr/sbin/openser
>>>>> 1 S root     14139 14133   /usr/sbin/openser
>>>>> 1 S root     14140 14133   /usr/sbin/openser
>>>>> 1 S root     14141 14133   /usr/sbin/openser
>>>>> 1 S root     14142 14133   /usr/sbin/openser
>>>>> 1 S root     14143 14133   /usr/sbin/openser
>>>>> 1 S root     14144 14133   /usr/sbin/openser
>>>>>
>>>>>
>>>>> with patch:
>>>>> 5 S root     14133     1   /usr/sbin/openser
>>>>> 1 S root     14134 14133    fifo
>>>>> 1 S root     14135 14133    udp 0
>>>>> 1 S root     14136 14133    udp 1
>>>>> 1 S root     14137 14133    udp 2
>>>>> 1 S root     14138 14133    udp 3
>>>>> 1 S root     14139 14133   /usr/sbin/openser
>>>>> 1 S root     14140 14133    tcp 0
>>>>> 1 S root     14141 14133    tcp 1
>>>>> 1 S root     14142 14133    tcp 2
>>>>> 1 S root     14143 14133    tcp 3
>>>>> 1 S root     14144 14133   /usr/sbin/openser
>>>>>
>>>>> apperently I missed some forks :-)
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> -
>>>>>
>>>>> You can respond by visiting:
>>>>> https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1606005&
>>>>> group_id=139143
>>>>>
>>>>> _______________________________________________
>>>>> Devel mailing list
>>>>> Devel at openser.org
>>>>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>>>
>>>
>>
>>
> 


-- 
Klaus Darilion
nic.at




More information about the Devel mailing list