Changeset 714
- Timestamp:
- 03/08/10 19:49:12 (2 years ago)
- Location:
- trunk/daemon
- Files:
-
- 6 modified
-
openvcpd.conf (modified) (1 diff)
-
src/get.c (modified) (2 diffs)
-
src/main.c (modified) (1 diff)
-
src/parseconfig.c (modified) (2 diffs)
-
src/parseconfig.h (modified) (1 diff)
-
src/set.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/openvcpd.conf
r654 r714 28 28 AdminEmail=openvcp@lists.openvcp.org 29 29 30 # options for cgroup handling 31 CGroupMountPoint=/dev/cgroup 32 CGroupMountOptions=cpu,cpuset,memory,cpuacct,devices,freezer,net_cls 33 -
trunk/daemon/src/get.c
r708 r714 465 465 response = ovcp_response_new(); 466 466 467 ovcp_response_struct_new(response);468 469 467 while(cgroup_params[i] != NULL) 470 468 { … … 473 471 if(file_exist(path)) 474 472 { 475 value = file_read(path); 476 473 ovcp_response_struct_new(response); 474 475 ovcp_response_struct_add_string(response, "name", cgroup_params[i]); 476 477 value = file_read(path); 477 478 if(value != NULL) 478 479 { 479 480 trim_string(value); 480 ovcp_response_struct_add_string(response, cgroup_params[i], value);481 ovcp_response_struct_add_string(response, "value", value); 481 482 free(value); 482 483 } 484 else 485 { 486 ovcp_response_struct_add_string(response, "value", ""); 487 } 488 489 ovcp_response_struct_end(response); 483 490 } 484 491 485 492 i++; 486 493 } 487 488 ovcp_response_struct_end(response);489 494 490 495 return response; -
trunk/daemon/src/main.c
r711 r714 120 120 if(!fs_cgroup_support()) 121 121 { 122 if(!dir_exist( "/dev/cgroup"))123 mkdir( "/dev/cgroup", 0755);124 execb_cmd("mount", "mount", "-ocpu,cpuset", "-t", "cgroup", "none", "/dev/cgroup",NULL);122 if(!dir_exist(config_st.cgroupdir)) 123 mkdir(config_st.cgroupdir, 0755); 124 execb_cmd("mount", "mount", config_st.cgroupmountoptions, "-t", "cgroup", "none", config_st.cgroupdir NULL); 125 125 } 126 126 -
trunk/daemon/src/parseconfig.c
r671 r714 157 157 config->adminemail = (char *) malloc(strlen(directives[1])+1); 158 158 strcpy(config->adminemail, directives[1]); 159 } 160 else 161 if(strcasecmp(directives[0], "CGroupMountPoint") == 0) 162 { 163 config->cgroupdir = (char *) malloc(strlen(directives[1])+1); 164 strcpy(config->cgroupdir, directives[1]); 165 } 166 else 167 if(strcasecmp(directives[0], "CGroupMountOptions") == 0) 168 { 169 config->cgroupmountoptions = (char *) malloc(strlen(directives[1])+1); 170 strcpy(config->cgroupmountoptions, directives[1]); 159 171 } 160 172 … … 203 215 if(config->userbackup_dir == NULL) 204 216 die("ERROR: UserBackupDir Directive not Found\n"); 217 if(config->cgroupdir == NULL) 218 die("ERROR: CGroupMountPoint Directive not Found\n"); 219 if(config->cgroupmountoptions == NULL) 220 die("ERROR: CGroupMountOptions Directive not Found\n"); 205 221 206 222 if(!dir_exist(config->root_dir)) -
trunk/daemon/src/parseconfig.h
r654 r714 45 45 46 46 char *adminemail; 47 char *cgroupdir; 48 char *cgroupmountoptions; 47 49 }; 48 50 -
trunk/daemon/src/set.c
r712 r714 727 727 728 728 //try to apply the new limits directly 729 sconcat(filepath, BUF_SIZE, "/dev/cgroup/", name, cgroup_params[i], NULL);729 sconcat(filepath, BUF_SIZE, global_settings.cgroupdir, name, cgroup_params[i], NULL); 730 730 if(file_exist(filepath)) 731 731 {
