From: Sage Weil Date: Thu, 7 Mar 2019 14:50:53 +0000 (-0600) Subject: mds,mgr,mon: warn future respawn() copy-pasters to set thread name X-Git-Tag: v14.1.1~28^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26821%2Fhead;p=ceph.git mds,mgr,mon: warn future respawn() copy-pasters to set thread name Signed-off-by: Sage Weil --- diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index c1bbeb820772..9b22a1a92a76 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -1073,6 +1073,14 @@ void MDSDaemon::suicide() void MDSDaemon::respawn() { + // --- WARNING TO FUTURE COPY/PASTERS --- + // You must also add a call like + // + // ceph_pthread_setname(pthread_self(), "ceph-mds"); + // + // to main() so that /proc/$pid/stat field 2 contains "(ceph-mds)" + // instead of "(exe)", so that killall (and log rotation) will work. + dout(1) << "respawn!" << dendl; /* Dump recent in case the MDS was stuck doing something which caused it to diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index e0c80e0b00e1..061ddd0f9b9e 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -302,6 +302,14 @@ void MgrStandby::shutdown() void MgrStandby::respawn() { + // --- WARNING TO FUTURE COPY/PASTERS --- + // You must also add a call like + // + // ceph_pthread_setname(pthread_self(), "ceph-mgr"); + // + // to main() so that /proc/$pid/stat field 2 contains "(ceph-mgr)" + // instead of "(exe)", so that killall (and log rotation) will work. + char *new_argv[orig_argc+1]; dout(1) << " e: '" << orig_argv[0] << "'" << dendl; for (int i=0; i