-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we use proper process name instead of linker-36cefa356... #57
Comments
Kind of. We can change diff --git a/src/exodus_bundler/templates/launcher.c b/src/exodus_bundler/templates/launcher.c
index 324ceb9..aec8fe0 100644
--- a/src/exodus_bundler/templates/launcher.c
+++ b/src/exodus_bundler/templates/launcher.c
@@ -53,7 +53,7 @@ int main(int argc, char *argv[]) {
// Construct all of the arguments for the linker.
char *linker_args[] = { "--library-path", library_path, "--inhibit-rpath", "", "--inhibit-cache" };
char **combined_args = malloc(sizeof(linker_args) + sizeof(char*) * (argc + 1));
- combined_args[0] = linker_basename;
+ combined_args[0] = executable;
memcpy(combined_args + 1, linker_args, sizeof(linker_args));
// We can't use `--inhinit-rpath` or `--inhibit-cache` with the musl linker.
int offset = (sizeof(linker_args) / sizeof(char*)) + 1 - ({{full_linker}} ? 0 : 3);
diff --git a/src/exodus_bundler/templates/launcher.sh b/src/exodus_bundler/templates/launcher.sh
index 79311ec..586a41d 100644
--- a/src/exodus_bundler/templates/launcher.sh
+++ b/src/exodus_bundler/templates/launcher.sh
@@ -6,7 +6,7 @@ library_path="{{library_path}}"
library_path="${current_directory}/${library_path//:/:${current_directory}/}"
linker="${current_directory}/{{linker_dirname}}/{{linker_basename}}"
if [ "{{full_linker}}" == "true" ]; then
- exec "${linker}" --library-path "${library_path}" --inhibit-rpath "" "${executable}" "$@"
+ exec -a {{executable}} "${linker}" --library-path "${library_path}" --inhibit-rpath "" "${executable}" "$@"
else
- exec "${linker}" --library-path "${library_path}" "${executable}" "$@"
+ exec -a {{executable}} "${linker}" --library-path "${library_path}" "${executable}" "$@"
fi This would change the apparent process name from
to:
The reason that I didn't do this initially is because I think it's misleading to show the linker arguments as though they're arguments to the bundled binary when it is, after all, the linker that is being executed and passed these arguments. This also only changes Maybe a comprise would be to set |
We can generate linker hardlinks per executable with the correct name. |
When app is run from bin/app, you get
linker-36cefa356a7da068c94decf04caef852f344a44e9930131b41826c860ffa0135
in OS process list.Is there a way to get the name
app
in process list ?Thanks.
The text was updated successfully, but these errors were encountered: