You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2018/05/02 14:36:22 UTC
[1/2] storm git commit: STORM-3041 improve worker-launcher messages
Repository: storm
Updated Branches:
refs/heads/master 1117a37b0 -> 57658f7fb
STORM-3041 improve worker-launcher messages
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/75830c0b
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/75830c0b
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/75830c0b
Branch: refs/heads/master
Commit: 75830c0bfe90e99cd2cb16a46ce26dc46bff8ec7
Parents: 7673253
Author: Aaron Gresch <ag...@yahoo-inc.com>
Authored: Tue Apr 24 14:52:46 2018 -0500
Committer: Aaron Gresch <ag...@yahoo-inc.com>
Committed: Wed May 2 08:20:52 2018 -0500
----------------------------------------------------------------------
.../src/native/worker-launcher/impl/main.c | 23 +++++++++++++-------
.../worker-launcher/impl/worker-launcher.c | 18 +++++++--------
2 files changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/75830c0b/storm-core/src/native/worker-launcher/impl/main.c
----------------------------------------------------------------------
diff --git a/storm-core/src/native/worker-launcher/impl/main.c b/storm-core/src/native/worker-launcher/impl/main.c
index 439e81d..450fd3d 100644
--- a/storm-core/src/native/worker-launcher/impl/main.c
+++ b/storm-core/src/native/worker-launcher/impl/main.c
@@ -91,22 +91,23 @@ int main(int argc, char **argv) {
fprintf(ERRORFILE, "Configuration file %s not found.\n", orig_conf_file);
exit(INVALID_CONFIG_FILE);
}
+ if (do_check_setup) {
+ fprintf(LOGFILE, "Using configuration file %s \n", conf_file);
+ }
if (check_configuration_permissions(conf_file) != 0) {
exit(INVALID_CONFIG_FILE);
}
read_config(conf_file);
- free(conf_file);
- conf_file = NULL;
- // look up the node manager group in the config file
- char *nm_group = get_value(LAUNCHER_GROUP_KEY);
- if (nm_group == NULL) {
+ // look up the worker launcher group in the config file
+ char *wl_group = get_value(LAUNCHER_GROUP_KEY);
+ if (wl_group == NULL) {
fprintf(ERRORFILE, "Can't get configured value for %s.\n", LAUNCHER_GROUP_KEY);
exit(INVALID_CONFIG_FILE);
}
- struct group *group_info = getgrnam(nm_group);
+ struct group *group_info = getgrnam(wl_group);
if (group_info == NULL) {
- fprintf(ERRORFILE, "Can't get group information for %s - %s.\n", nm_group,
+ fprintf(ERRORFILE, "Can't get group information for %s - %s.\n", wl_group,
strerror(errno));
fflush(LOGFILE);
exit(INVALID_CONFIG_FILE);
@@ -119,10 +120,16 @@ int main(int argc, char **argv) {
setgid(group_info->gr_gid);
if (check_executor_permissions(executable_file) != 0) {
- fprintf(ERRORFILE, "Invalid permissions on worker-launcher binary.\n");
+ fprintf(LOGFILE, "worker-launcher config file: %s \n", conf_file);
+ free(conf_file);
+ conf_file = NULL;
+ fprintf(ERRORFILE, "ERROR: Invalid permissions on worker-launcher binary.\n");
return INVALID_CONTAINER_EXEC_PERMISSIONS;
}
+ free(conf_file);
+ conf_file = NULL;
+
if (do_check_setup != 0) {
// basic setup checks done
// verified configs available and valid
http://git-wip-us.apache.org/repos/asf/storm/blob/75830c0b/storm-core/src/native/worker-launcher/impl/worker-launcher.c
----------------------------------------------------------------------
diff --git a/storm-core/src/native/worker-launcher/impl/worker-launcher.c b/storm-core/src/native/worker-launcher/impl/worker-launcher.c
index 8fed085..02c0bec 100644
--- a/storm-core/src/native/worker-launcher/impl/worker-launcher.c
+++ b/storm-core/src/native/worker-launcher/impl/worker-launcher.c
@@ -104,7 +104,7 @@ int check_executor_permissions(char *executable_file) {
}
if (binary_gid != getgid()) {
- fprintf(LOGFILE, "The configured nodemanager group %d is different from"
+ fprintf(LOGFILE, "ERROR: The configured worker-launcher group %d is different from"
" the group of the executable %d\n", getgid(), binary_gid);
return -1;
}
@@ -309,10 +309,10 @@ int set_user(const char *user) {
}
/**
- * Open a file as the node manager and return a file descriptor for it.
+ * Open a file as the worker-launcher user and return a file descriptor for it.
* Returns -1 on error
*/
-static int open_file_as_nm(const char* filename) {
+static int open_file_as_wl(const char* filename) {
uid_t user = geteuid();
gid_t group = getegid();
if (change_effective_user(launcher_uid, launcher_gid) != 0) {
@@ -320,7 +320,7 @@ static int open_file_as_nm(const char* filename) {
}
int result = open(filename, O_RDONLY);
if (result == -1) {
- fprintf(LOGFILE, "Can't open file %s as node manager - %s\n", filename,
+ fprintf(LOGFILE, "Can't open file %s as worker-launcher user - %s\n", filename,
strerror(errno));
}
if (change_effective_user(user, group)) {
@@ -536,9 +536,9 @@ int signal_container_as_user(const char *user, int pid, int sig) {
}
/**
- * Delete a final directory as the node manager user.
+ * Delete a final directory as the worker-launcher user.
*/
-static int rmdir_as_nm(const char* path) {
+static int rmdir_as_wl(const char* path) {
int user_uid = geteuid();
int user_gid = getegid();
int ret = change_effective_user(launcher_uid, launcher_gid);
@@ -621,7 +621,7 @@ int recursive_delete(const char *path, int supervisor_owns_dir) {
// Delete the actual directory.
if (supervisor_owns_dir) {
- return rmdir_as_nm(path);
+ return rmdir_as_wl(path);
}
else if (rmdir(path) != 0) {
fprintf(LOGFILE, "Couldn't delete directory %s - %s\n", path, strerror(errno));
@@ -651,7 +651,7 @@ int exec_as_user(const char * working_dir, const char * script_file) {
}
// open launch script
- int script_file_source = open_file_as_nm(script_file);
+ int script_file_source = open_file_as_wl(script_file);
if (script_file_source == -1) {
return -1;
}
@@ -693,7 +693,7 @@ int fork_as_user(const char * working_dir, const char * script_file) {
}
// open launch script
- int script_file_source = open_file_as_nm(script_file);
+ int script_file_source = open_file_as_wl(script_file);
if (script_file_source == -1) {
return -1;
}
[2/2] storm git commit: Merge branch 'agresch_worker_launcher' of
https://github.com/agresch/storm into asfgit-master
Posted by sr...@apache.org.
Merge branch 'agresch_worker_launcher' of https://github.com/agresch/storm into asfgit-master
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/57658f7f
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/57658f7f
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/57658f7f
Branch: refs/heads/master
Commit: 57658f7fb83149cd16acbad5b089b8c268b729db
Parents: 1117a37 75830c0
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Wed May 2 16:35:57 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Wed May 2 16:35:57 2018 +0200
----------------------------------------------------------------------
.../src/native/worker-launcher/impl/main.c | 23 +++++++++++++-------
.../worker-launcher/impl/worker-launcher.c | 18 +++++++--------
2 files changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------