Apache Mesos
mount.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __MESOS_CONTAINERIZER_MOUNT_HPP__
18 #define __MESOS_CONTAINERIZER_MOUNT_HPP__
19 
20 #include <stout/option.hpp>
21 #include <stout/subcommand.hpp>
22 
23 namespace mesos {
24 namespace internal {
25 namespace slave {
26 
27 // "mount" subcommand functions similarly to the mount program.
28 // However, this subcommand is necessary because of the following reasons:
29 // - `mount --make-rslave <dir>` doesn't work on ubuntu 14.04 due to an existing
30 // bug.
31 // - mount program only handles mounts that is recorded in /etc/mtab and
32 // /etc/fstab, and ignores mounts that are done via mount syscall.
33 // We need this subcommand so we can effect all mounts.
35 {
36 public:
37  static const std::string NAME;
38  static const std::string MAKE_RSLAVE;
39 
40  struct Flags : public virtual flags::FlagsBase
41  {
42  Flags();
43 
46  };
47 
49 
51 
52 protected:
53  int execute() override;
54  flags::FlagsBase* getFlags() override { return &flags; }
55 };
56 
57 } // namespace slave {
58 } // namespace internal {
59 } // namespace mesos {
60 
61 #endif // __MESOS_CONTAINERIZER_MOUNT_HPP__
Option< std::string > path
Definition: mount.hpp:45
Option< std::string > operation
Definition: mount.hpp:44
MesosContainerizerMount()
Definition: mount.hpp:48
static const std::string NAME
Definition: mount.hpp:37
flags::FlagsBase * getFlags() override
Definition: mount.hpp:54
Definition: subcommand.hpp:41
Definition: flags.hpp:44
Definition: agent.hpp:25
Definition: attributes.hpp:24
static const std::string MAKE_RSLAVE
Definition: mount.hpp:38