-
Notifications
You must be signed in to change notification settings - Fork 96
Closed as not planned
Description
Currently celix_framework_stopBundle is called in signal handler of SIGINT and SIGTERM to stop the framework.
This function calls bunch of unsafe functions, and thus is not async-signal-safe. See man signal-safety for more information.
celix/libs/framework/src/celix_launcher.c
Lines 104 to 122 in 62480b1
| struct sigaction sigact; | |
| memset(&sigact, 0, sizeof(sigact)); | |
| sigact.sa_handler = shutdown_framework; | |
| sigaction(SIGINT, &sigact, NULL); | |
| sigaction(SIGTERM, &sigact, NULL); | |
| memset(&sigact, 0, sizeof(sigact)); | |
| sigact.sa_handler = ignore; | |
| sigaction(SIGUSR1, &sigact, NULL); | |
| sigaction(SIGUSR2, &sigact, NULL); | |
| int rc = celixLauncher_launchWithConfigAndProps(config_file, &framework, packedConfig); | |
| if (rc == 0) { | |
| g_fw = framework; | |
| celixLauncher_waitForShutdown(framework); | |
| celixLauncher_destroy(framework); | |
| } | |
| return rc; |
We need a reliable mechanism to communicate with the Celix event loop from within a signal handler.
Metadata
Metadata
Assignees
Labels
No labels