Menu

#41 change process name to differntiate the threads

ver devel
closed-works-for-me
core (30)
5
2006-12-05
2006-11-30
No

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 :-)

Discussion

  • Klaus Darilion

    Klaus Darilion - 2006-11-30
     
  • Bogdan-Andrei Iancu

    Logged In: YES
    user_id=1275325
    Originator: NO

    Klaus,

    if you change the argv[0] you will not be able to use a killall command :), or to do a ps and grep to see all openser processes. Have you considered a possiility to insert your info but without altering argv[0]. Maybe using other argv[] or appending a new one?

    regards,
    bogdan

     
  • Bogdan-Andrei Iancu

    • labels: --> core
    • milestone: --> ver devel
     
  • Klaus Darilion

    Klaus Darilion - 2006-12-05

    Logged In: YES
    user_id=1318360
    Originator: YES

    Hi!

    I've closed the patch as there are already other solutions to address this problem:

    ./openserctl fifo ps
    this will show you all the openser processes and its tasks.

    ps -aef --forest
    this will show you which openser process belong to each other.

     
  • Klaus Darilion

    Klaus Darilion - 2006-12-05
    • assigned_to: nobody --> klaus_darilion
    • status: open --> closed-works-for-me
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.