Home | History | Annotate | Download | only in init

Lines Matching defs:args

129 static int do_class_start(const std::vector<std::string>& args) {
135 ForEachServiceInClass(args[1], [] (Service* s) { s->StartIfNotDisabled(); });
139 static int do_class_stop(const std::vector<std::string>& args) {
141 ForEachServiceInClass(args[1], [] (Service* s) { s->Stop(); });
145 static int do_class_reset(const std::vector<std::string>& args) {
147 ForEachServiceInClass(args[1], [] (Service* s) { s->Reset(); });
151 static int do_class_restart(const std::vector<std::string>& args) {
153 ForEachServiceInClass(args[1], [] (Service* s) { s->Restart(); });
157 static int do_domainname(const std::vector<std::string>& args) {
158 return write_file("/proc/sys/kernel/domainname", args[1]) ? 0 : 1;
161 static int do_enable(const std::vector<std::string>& args) {
162 Service* svc = ServiceManager::GetInstance().FindServiceByName(args[1]);
169 static int do_exec(const std::vector<std::string>& args) {
170 return ServiceManager::GetInstance().Exec(args) ? 0 : -1;
173 static int do_exec_start(const std::vector<std::string>& args) {
174 return ServiceManager::GetInstance().ExecStart(args[1]) ? 0 : -1;
177 static int do_export(const std::vector<std::string>& args) {
178 return add_environment(args[1].c_str(), args[2].c_str());
181 static int do_hostname(const std::vector<std::string>& args) {
182 return write_file("/proc/sys/kernel/hostname", args[1]) ? 0 : 1;
185 static int do_ifup(const std::vector<std::string>& args) {
186 return __ifupdown(args[1].c_str(), 1);
189 static int do_insmod(const std::vector<std::string>& args) {
191 auto it = args.begin() + 1;
199 std::string options = android::base::Join(std::vector<std::string>(it, args.end()), ' ');
203 static int do_mkdir(const std::vector<std::string>& args) {
209 if (args.size() >= 3) {
210 mode = std::strtoul(args[2].c_str(), 0, 8);
213 ret = make_dir(args[1].c_str(), mode);
216 ret = fchmodat(AT_FDCWD, args[1].c_str(), mode, AT_SYMLINK_NOFOLLOW);
222 if (args.size() >= 4) {
223 uid_t uid = decode_uid(args[3].c_str());
226 if (args.size() == 5) {
227 gid = decode_uid(args[4].c_str());
230 if (lchown(args[1].c_str(), uid, gid) == -1) {
236 ret = fchmodat(AT_FDCWD, args[1].c_str(), mode, AT_SYMLINK_NOFOLLOW);
244 if (e4crypt_set_directory_policy(args[1].c_str())) {
247 "--reason=set_policy_failed:"s + args[1]};
256 static int do_umount(const std::vector<std::string>& args) {
257 return umount(args[1].c_str());
285 static int do_mount(const std::vector<std::string>& args) {
294 for (na = 4; na < args.size(); na++) {
296 if (!args[na].compare(mount_flags[i].name)) {
303 if (!args[na].compare("wait"))
306 else if (na + 1 == args.size())
307 options = args[na].c_str();
311 system = args[1].c_str();
312 source = args[2].c_str();
313 target = args[3].c_str();
372 * start_index: index of the first path in the args list
374 static void import_late(const std::vector<std::string>& args, size_t start_index, size_t end_index) {
392 parser.ParseConfig(args[i]);
502 static int do_mount_all(const std::vector<std::string>& args) {
507 const char* fstabfile = args[1].c_str();
508 std::size_t path_arg_end = args.size();
511 for (na = args.size() - 1; na > 1; --na) {
512 if (args[na] == "--early") {
517 } else if (args[na] == "--late") {
533 import_late(args, 2, path_arg_end);
545 static int do_swapon_all(const std::vector<std::string>& args) {
549 fstab = fs_mgr_read_fstab(args[1].c_str());
556 static int do_setprop(const std::vector<std::string>& args) {
557 const char* name = args[1].c_str();
558 const char* value = args[2].c_str();
563 static int do_setrlimit(const std::vector<std::string>& args) {
566 if (android::base::ParseInt(args[1], &resource) &&
567 android::base::ParseUint(args[2], &limit.rlim_cur) &&
568 android::base::ParseUint(args[3], &limit.rlim_max)) {
571 LOG(WARNING) << "ignoring setrlimit " << args[1] << " " << args[2] << " " << args[3];
575 static int do_start(const std::vector<std::string>& args) {
576 Service* svc = ServiceManager::GetInstance().FindServiceByName(args[1]);
578 LOG(ERROR) << "do_start: Service " << args[1] << " not found";
586 static int do_stop(const std::vector<std::string>& args) {
587 Service* svc = ServiceManager::GetInstance().FindServiceByName(args[1]);
589 LOG(ERROR) << "do_stop: Service " << args[1] << " not found";
596 static int do_restart(const std::vector<std::string>& args) {
597 Service* svc = ServiceManager::GetInstance().FindServiceByName(args[1]);
599 LOG(ERROR) << "do_restart: Service " << args[1] << " not found";
606 static int do_trigger(const std::vector<std::string>& args) {
607 ActionManager::GetInstance().QueueEventTrigger(args[1]);
611 static int do_symlink(const std::vector<std::string>& args) {
612 return symlink(args[1].c_str(), args[2].c_str());
615 static int do_rm(const std::vector<std::string>& args) {
616 return unlink(args[1].c_str());
619 static int do_rmdir(const std::vector<std::string>& args) {
620 return rmdir(args[1].c_str());
623 static int do_sysclktz(const std::vector<std::string>& args) {
625 if (android::base::ParseInt(args[1], &tz.tz_minuteswest) && settimeofday(NULL, &tz) != -1) {
631 static int do_verity_load_state(const std::vector<std::string>& args) {
646 static int do_verity_update_state(const std::vector<std::string>& args) {
650 static int do_write(const std::vector<std::string>& args) {
651 return write_file(args[1], args[2]) ? 0 : 1;
654 static int do_copy(const std::vector<std::string>& args) {
656 if (read_file(args[1], &data)) {
657 return write_file(args[2], data) ? 0 : 1;
662 static int do_chown(const std::vector<std::string>& args) {
664 if (args.size() == 3) {
665 if (lchown(args[2].c_str(), decode_uid(args[1].c_str()), -1) == -1)
667 } else if (args.size() == 4) {
668 if (lchown(args[3].c_str(), decode_uid(args[1].c_str()),
669 decode_uid(args[2].c_str())) == -1)
690 static int do_chmod(const std::vector<std::string>& args) {
691 mode_t mode = get_mode(args[1].c_str());
692 if (fchmodat(AT_FDCWD, args[2].c_str(), mode, AT_SYMLINK_NOFOLLOW) < 0) {
698 static int do_restorecon(const std::vector<std::string>& args) {
712 for (size_t i = 1; i < args.size(); ++i) {
713 if (android::base::StartsWith(args[i], "--")) {
720 if (args[i] == flags[j].name) {
727 LOG(ERROR) << "restorecon - bad flag " << args[i];
732 if (restorecon(args[i].c_str(), flag) < 0) {
740 static int do_restorecon_recursive(const std::vector<std::string>& args) {
741 std::vector<std::string> non_const_args(args);
746 static int do_loglevel(const std::vector<std::string>& args) {
749 android::base::ParseInt(args[1], &log_level);
768 static int do_load_persist_props(const std::vector<std::string>& args) {
773 static int do_load_system_props(const std::vector<std::string>& args) {
778 static int do_wait(const std::vector<std::string>& args) {
779 if (args.size() == 2) {
780 return wait_for_file(args[1].c_str(), kCommandRetryTimeout);
781 } else if (args.size() == 3) {
783 if (android::base::ParseInt(args[2], &timeout)) {
784 return wait_for_file(args[1].c_str(), std::chrono::seconds(timeout));
790 static int do_wait_for_prop(const std::vector<std::string>& args) {
791 const char* name = args[1].c_str();
792 const char* value = args[2].c_str();
828 static int do_installkey(const std::vector<std::string>& args) {
832 auto unencrypted_dir = args[1] + e4crypt_unencrypted_folder;
842 static int do_init_user0(const std::vector<std::string>& args) {