]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: implement activate --no-start-daemon
authorLoic Dachary <ldachary@redhat.com>
Sat, 2 May 2015 15:05:09 +0000 (17:05 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 5 May 2015 23:54:36 +0000 (01:54 +0200)
And improve the --mark-init documentation as well.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
doc/man/8/ceph-disk.rst
src/ceph-disk

index 8de9f0970896ee99365c631c2579fbc1bd0f14cf..79da14c2ce28ed3b2a815b20e4d103469269cc1a 100644 (file)
@@ -13,6 +13,8 @@ Synopsis
        [--fs-type *xfs|ext4|btrfs*] [*data-path*] [*journal-path*]
 
 | **ceph-disk** **activate** [*data-path*] [--activate-key *path*]
+        [--mark-init *sysvinit|upstart|systemd|auto|none*]
+        [--no-start-daemon]
 
 | **ceph-disk** **activate-all**
 
@@ -76,8 +78,24 @@ Usage::
 
        ceph-disk activate [PATH] [--activate-key PATH]
 
-Another option :option:`--mark-init` can also be used with this subcommand.
-``--mark-init`` provides init system to manage the OSD directory.
+Another option :option:`--mark-init` can also be used with this
+subcommand.  ``--mark-init`` provides init system to manage the OSD
+directory. It defaults to ``auto`` which detects the init system
+suitable for ceph (either ``sysvinit``, ``systemd`` or
+``upstart``). The argument can be used to override the init system. It
+may be convenient when an operating system supports multiple init
+systems, such as Debian GNU/Linux jessie with ``systemd`` and
+``sysvinit``. If the argument is ``none``, the OSD is not marked with
+any init system and ``ceph-disk activate`` needs to be called
+explicitely after each reboot.
+
+
+Usage::
+
+       ceph-disk activate [PATH] [--mark-init *sysvinit|upstart|systemd|auto|none*]
+
+If the option :option:`--no-start-daemon` is given, the activation
+steps are performed but the OSD daemon is not started.
 
 activate-journal
 ----------------
index 92a649c0e27bdfa8bfae3023cff2ad4c568f24a8..a0bf9efc5b2178ba0590ab9b5c1fe39b6c12559c 100755 (executable)
@@ -2216,7 +2216,7 @@ def main_activate(args):
         else:
             raise Error('%s is not a directory or block device' % args.path)
 
-        if args.mark_init == 'none':
+        if (not args.no_start_daemon and args.mark_init == 'none'):
             command_check_call(
                 [
                     'ceph-osd',
@@ -2227,7 +2227,8 @@ def main_activate(args):
                 ],
             )
 
-        if args.mark_init not in (None, 'none' ):
+        if (not args.no_start_daemon and
+            args.mark_init not in (None, 'none' )):
 
             start_daemon(
                 cluster=cluster,
@@ -2884,6 +2885,11 @@ def parse_args():
         default='auto',
         choices=INIT_SYSTEMS,
         )
+    activate_parser.add_argument(
+        '--no-start-daemon',
+        action='store_true', default=None,
+        help='do not start the daemon',
+        )
     activate_parser.add_argument(
         'path',
         metavar='PATH',