Changeset 2466
- Timestamp:
- 01/21/07 09:02:44 (2 years ago)
- Files:
-
- trunk/scripts/vserver.start (modified) (1 diff)
- trunk/src/vsysctl.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/scripts/vserver.start
r2458 r2466 137 137 $_VLIMIT --dir "$VSERVER_DIR"/rlimits --missingok -- \ 138 138 $_VSCHED --xid self --force "${OPTS_VSCHED[@]}" -- \ 139 $_VSYSCTL --xid self --dir "$VSERVER_DIR"/sysctl -- \140 $_VUNAME --xid self --dir "$VSERVER_DIR"/uts --missingok -- \139 $_VSYSCTL --xid self --dir "$VSERVER_DIR"/sysctl --missingok -- \ 140 $_VUNAME --xid self --dir "$VSERVER_DIR"/uts --missingok -- \ 141 141 "${VSERVER_EXTRA_CMDS[@]}" \ 142 142 $_VUNAME --xid self --set -t context="$VSERVER_DIR" -- \ trunk/src/vsysctl.c
r2459 r2466 49 49 #define CMD_XID 0x4000 50 50 #define CMD_DIR 0x4001 51 #define CMD_MISSINGOK 0x4002 51 52 52 53 int wrapper_exit_code = 1; … … 58 59 { "xid", required_argument, 0, CMD_XID }, 59 60 { "dir", required_argument, 0, CMD_DIR }, 61 { "missingok", no_argument, 0, CMD_MISSINGOK }, 60 62 {0,0,0,0} 61 63 }; … … 67 69 WRITE_STR(fd, cmd); 68 70 WRITE_MSG(fd, 69 " --xid <xid> --dir <directory> -- <command> <args>*\n"71 " --xid <xid> --dir <directory> [--missingok] -- <command> <args>*\n" 70 72 "\n" 71 73 "Please report bugs to " PACKAGE_BUGREPORT "\n"); … … 129 131 xid_t xid = VC_NOCTX; 130 132 const char *dir = NULL; 133 bool missing = false; 131 134 132 135 while (1) { … … 139 142 case CMD_XID : xid = Evc_xidopt2xid(optarg, true); break; 140 143 case CMD_DIR : dir = optarg; break; 144 case CMD_MISSINGOK: missing = true; break; 141 145 142 146 default : … … 156 160 Echdir(PROC_SYS_DIRECTORY); 157 161 158 dp = Eopendir(dir); 159 while ((de = Ereaddir(dp)) != NULL) { 160 if (*de->d_name == '.') 161 continue; 162 handle_setting(dir, de->d_name); 162 dp = opendir(dir); 163 if (dp != NULL) { 164 while ((de = Ereaddir(dp)) != NULL) { 165 if (*de->d_name == '.') 166 continue; 167 handle_setting(dir, de->d_name); 168 } 169 Eclosedir(dp); 163 170 } 164 Eclosedir(dp); 171 else if (!missing) { 172 perror(ENSC_WRAPPERS_PREFIX "opendir"); 173 exit(wrapper_exit_code); 174 } 165 175 166 176 Efchdir(curdir);
