> > I guess we could: > > * Switch the logic to try resolving argv[0] and only use > > proc/self/exe if we can't find argv[0]? > > * Create a link to /proc/self/exe named ceph-mds, and exec that? > > We could also check if argv[0] is 'exe' and, if so, rewrite it so that the ps > output shows ceph-mds... For ps/pgrep/pkill it'll work, but 'top' reports process name differently and you'll see 'exe' there. I think this is because 'ps' is looking on command line and 'top' on something else in procfs. You need to run also prctl(PR_SET_NAME, argv[0]) shortly after process starts. This could be a race condition, when system will be under big load, for a moment process name would change from 'ceph-mds' to 'exe' and then back to 'ceph-mds', pid will remain the same but some third party monitoring software could be confused (depends how they check the process name). I'm not sure, but I think you could pass argv again here, then respawn will short to: execv("/proc/self/exe", argv); And process name will be kept, since first start will set argv[0] and passing argv to execv + prctl will propagate it. > http://stackoverflow.com/questions/23398952/changing-linux-ps-output- > by-changing-argv0 > > sage > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the > body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at > http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html