From 8ee5a8283251792cf2f5c5e2c21309816fddc859 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 2 May 2015 17:05:09 +0200 Subject: [PATCH] ceph-disk: implement activate --no-start-daemon And improve the --mark-init documentation as well. Signed-off-by: Loic Dachary --- doc/man/8/ceph-disk.rst | 22 ++++++++++++++++++++-- src/ceph-disk | 10 ++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/doc/man/8/ceph-disk.rst b/doc/man/8/ceph-disk.rst index 8de9f0970896e..79da14c2ce28e 100644 --- a/doc/man/8/ceph-disk.rst +++ b/doc/man/8/ceph-disk.rst @@ -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 ---------------- diff --git a/src/ceph-disk b/src/ceph-disk index 92a649c0e27bd..a0bf9efc5b217 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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', -- 2.39.5