6135 links
  • GuiGui's Show
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
 
  • linux - How can a process appear to have different name in ps output? - Unix & Linux Stack Exchange - Johndescs's mini-recording

    Bonne question : comment on fait pour changer le nom d'un process (visible via ps ou /proc). Par exemple, au lieu d'avoir la commande nginx on voit "nginx: worker process".

    Ok, y'a pas de vraie technique, juste écraser l'espace mémoire pointé par argv[0] :

    To change the process title in Linux and Solaris we have to set argv[1] to NULL and to copy the title to the same place where the argv[0] points to. However, argv[0] may be too small to hold a new title. Fortunately, Linux and Solaris store argv[] and environ[] one after another. So we should ensure that is the continuous memory and then we allocate the new memory for environ[] and copy it. After this we could use the memory starting from argv[0] for our process title.

    July 31, 2016 at 11:58:31 AM UTC - permalink - http://jonathan.michalon.eu/shaarli/?UDDSzg
Links per page: 20 50 100
 
Mentions légales identiques à celles de mon blog | CC BY-SA 3.0

Shaarli - The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community