You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suggest the possibility of setting the process name (as seen by ps or top) of master and workers via two options to the server process:
--worker-procname "Somename [worker]"
and
--master-procname "Somename [master]"
as done in this C code below:
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<sys/prctl.h>#include<errno.h>intmain(intargc, char*argv[]) {
if (argc!=2) {
fprintf(stderr, "Usage: %s <NewName>\n", argv[0]);
returnEXIT_FAILURE;
}
char*new_name=argv[1];
// Ensure the new name is not longer than 15 charactersif (strlen(new_name) >15) {
fprintf(stderr, "Error: Process name cannot be longer than 15 characters\n");
returnEXIT_FAILURE;
}
// Change the name of the current processif (prctl(PR_SET_NAME, (unsigned long)new_name, 0, 0, 0) !=0) {
perror("prctl(PR_SET_NAME)");
returnEXIT_FAILURE;
}
printf("Successfully changed the name of the current process to %s\n", new_name);
while (1) {
sleep(1); // Keep the process running to observe the name change
}
return0;
}
I thought this was what the --master-name option did, but apparently not...
(what exactly does the --master-name option do ?)
The text was updated successfully, but these errors were encountered:
I would suggest the possibility of setting the process name (as seen by ps or top) of master and workers via two options to the server process:
--worker-procname "Somename [worker]"
and
--master-procname "Somename [master]"
as done in this C code below:
I thought this was what the --master-name option did, but apparently not...
(what exactly does the --master-name option do ?)
The text was updated successfully, but these errors were encountered: