From 1b4857db895d4d090e010d38701196f7d4c84b0a Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Sat, 17 Sep 2016 11:12:50 +0200 Subject: [PATCH] Remove old commands which are not supported anymore --- src/CMakeLists.txt | 2 -- src/anbox/cmds/reset.cpp | 40 ------------------------- src/anbox/cmds/reset.h | 36 ----------------------- src/anbox/cmds/start_container.cpp | 47 ------------------------------ src/anbox/cmds/start_container.h | 36 ----------------------- src/anbox/daemon.cpp | 6 +--- 6 files changed, 1 insertion(+), 166 deletions(-) delete mode 100644 src/anbox/cmds/reset.cpp delete mode 100644 src/anbox/cmds/reset.h delete mode 100644 src/anbox/cmds/start_container.cpp delete mode 100644 src/anbox/cmds/start_container.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9aa997c..e105a8e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,9 +125,7 @@ set(SOURCES anbox/cmds/run.cpp anbox/cmds/install_app.cpp anbox/cmds/launch_app.cpp - anbox/cmds/reset.cpp anbox/cmds/container_manager.cpp - anbox/cmds/start_container.cpp anbox/do_not_copy_or_move.h anbox/optional.h diff --git a/src/anbox/cmds/reset.cpp b/src/anbox/cmds/reset.cpp deleted file mode 100644 index 1583f8e..0000000 --- a/src/anbox/cmds/reset.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2016 Simon Fels - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - */ - -#include - -#include "anbox/config.h" -#include "anbox/cmds/reset.h" - -namespace fs = boost::filesystem; - -anbox::cmds::Reset::Reset() - : CommandWithFlagsAndAction{cli::Name{"reset"}, cli::Usage{"reset"}, cli::Description{"Reset the container to its default settings"}} -{ - action([this](const cli::Command::Context &) { - // FIXME(morphis): check if container is currently running and if stop here. - - if (!fs::is_directory(config::data_path())) - return EXIT_SUCCESS; - - // FIXME(morphis): This currently requires us to run as root as otherwise we can't - // remove some of the files stored there even if they are created from a user namespace!? - fs::remove_all(config::data_path()); - - return EXIT_SUCCESS; - }); -} diff --git a/src/anbox/cmds/reset.h b/src/anbox/cmds/reset.h deleted file mode 100644 index 430aa63..0000000 --- a/src/anbox/cmds/reset.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2016 Simon Fels - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - */ - -#ifndef ANBOX_CMDS_RESET_H_ -#define ANBOX_CMDS_RESET_H_ - -#include -#include -#include - -#include "anbox/cli.h" - -namespace anbox { -namespace cmds { -class Reset : public cli::CommandWithFlagsAndAction { -public: - Reset(); -}; -} // namespace cmds -} // namespace anbox - -#endif diff --git a/src/anbox/cmds/start_container.cpp b/src/anbox/cmds/start_container.cpp deleted file mode 100644 index c689f70..0000000 --- a/src/anbox/cmds/start_container.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2016 Simon Fels - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - */ - -#include "anbox/cmds/start_container.h" -#include "anbox/container/lxc_container.h" -#include "anbox/runtime.h" -#include "anbox/logger.h" - -#include "core/posix/signal.h" - -anbox::cmds::StartContainer::StartContainer() - : CommandWithFlagsAndAction{cli::Name{"start-container"}, cli::Usage{"start-container"}, cli::Description{"Start a container"}} -{ - action([](const cli::Command::Context& ctxt) { - auto trap = core::posix::trap_signals_for_process({core::posix::Signal::sig_term, - core::posix::Signal::sig_int}); - trap->signal_raised().connect([trap](const core::posix::Signal &signal) { - INFO("Signal %i received. Good night.", static_cast(signal)); - trap->stop(); - }); - - auto rt = Runtime::create(); - auto container = std::make_shared(); - container::Configuration config; - - rt->start(); - container->start(config); - trap->run(); - rt->stop(); - - return 0; - }); -} diff --git a/src/anbox/cmds/start_container.h b/src/anbox/cmds/start_container.h deleted file mode 100644 index 1d7e107..0000000 --- a/src/anbox/cmds/start_container.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2016 Simon Fels - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - */ - -#ifndef ANBOX_CMDS_START_CONTAINER_H_ -#define ANBOX_CMDS_START_CONTAINER_H_ - -#include -#include -#include - -#include "anbox/cli.h" - -namespace anbox { -namespace cmds { -class StartContainer : public cli::CommandWithFlagsAndAction { -public: - StartContainer(); -}; -} // namespace cmds -} // namespace anbox - -#endif diff --git a/src/anbox/daemon.cpp b/src/anbox/daemon.cpp index 1b553ce..53a7eb8 100644 --- a/src/anbox/daemon.cpp +++ b/src/anbox/daemon.cpp @@ -26,9 +26,7 @@ #include "anbox/cmds/run.h" #include "anbox/cmds/install_app.h" #include "anbox/cmds/launch_app.h" -#include "anbox/cmds/reset.h" #include "anbox/cmds/container_manager.h" -#include "anbox/cmds/start_container.h" #include @@ -42,9 +40,7 @@ Daemon::Daemon() : .command(std::make_shared()) .command(std::make_shared()) .command(std::make_shared()) - .command(std::make_shared()) - .command(std::make_shared()) - .command(std::make_shared()); + .command(std::make_shared()); } int Daemon::Run(const std::vector &arguments)