hpcugent / vsc-install

Shared setuptools functions and classes for python libraries developed by UGent's HPC group
Other
0 stars 27 forks source link

New builded packages do not show up with their name as command with ps/pgrep/pkill , /proc #73

Open kwaegema opened 6 years ago

kwaegema commented 6 years ago

This changed now to 'python' , which makes using those commands less easier. [root@osd010 ~]# cat /proc/2302819/comm zkrsync

[root@osd009 ~]# cat /proc/2278866/comm python

JensTimmerman commented 6 years ago

[root@osd010 ~]# cat /proc/2302819/cmdline
/usr/bin/python-E/usr/bin/zkrsync--configfiles=/etc/zkrs/kyukonhome.conf--session=kyukonhome--daemon-D

still shows /usr/bin/zkrsync in there

stdweird commented 6 years ago

@JensTimmerman osd010 wasn't updated yet

JensTimmerman commented 6 years ago

same on osd009


[root@osd009 ~]#  cat /proc/2278866/cmdline
/usr/bin/python-E/usr/bin/zkrsync--configfiles=/etc/zkrs/kyukonhome.conf--session=kyukonhome--daemon-D
stdweird commented 6 years ago

@JensTimmerman try ps -C i guess the new wrapper in the shebang does an exec and ps sometimes shows before vs after exec?

JensTimmerman commented 6 years ago

@stdweird I know the procname is different, that is indeed changed, just trying to give some alternatives here.

If you consider this a bug, we could have the wrapper set the correct procname (linux only) with

def set_proc_name(newname):
    from ctypes import cdll, byref, create_string_buffer
    libc = cdll.LoadLibrary('libc.so.6')
    buff = create_string_buffer(len(newname)+1)
    buff.value = newname
    libc.prctl(15, byref(buff), 0, 0, 0)

but this seems a bit hacky

stdweird commented 6 years ago

@JensTimmerman oh, i don't consider it a bug 😄 it would be nice to understand why it happened, but nothing more then that imho. @kwaegema your fixes in https://github.ugent.be/hpcugent/vsc-backup/pull/6 are sufficient to work around this, right?

JensTimmerman commented 6 years ago

It happens because we now always call python, via https://github.com/hpcugent/vsc-install/blob/master/bin/python-stripped-env#L32

maybe we should exec it instead?

stdweird commented 6 years ago

@JensTimmerman ah, we wrote that. what happens if you use exec $PYTHON ... to start it?