*** ceph-disk.orig Sun Nov 17 11:34:33 2013 --- ceph-disk Mon Nov 18 13:21:20 2013 *************** *** 96,101 **** --- 96,102 ---- 'upstart', 'sysvinit', 'systemd', + 'direct', 'auto', ] *************** *** 1438,1443 **** --- 1439,1470 ---- 'osd.{osd_id}'.format(osd_id=osd_id), ], ) + elif os.path.exists(os.path.join(path, 'direct')): + # no idea about which init, start directly and set crush location + subprocess.check_call( + args=[ + '/usr/bin/ceph-osd', + #'--cluster', args.cluster, + #'-c', '/etc/ceph/{cluster}.conf'.format(cluster=args.cluster), + '-i', '{osd_id}'.format(osd_id=osd_id), + ], + ) + + # assume weight 1 (wrong but easy to change)! + subprocess.check_call( + args=[ + '/usr/bin/ceph', + #'--cluster', args.cluster, + #'-c', '/etc/ceph/{cluster}.conf'.format(cluster=args.cluster), + 'osd', + 'crush', + 'add', + 'osd.{osd_id}'.format(osd_id=osd_id), + '1', + 'root=default', + 'host={hostname}'.format(hostname=platform.node()), + ], + ) else: raise Error('{cluster} osd.{osd_id} is not tagged with an init system'.format( cluster=cluster, *************** *** 1683,1690 **** --- 1710,1722 ---- (distro, release, codename) = platform.dist() if distro == 'Ubuntu': init = 'upstart' + if distro == 'unknown' or distro == '': + LOG.debug('distro is empty, assuming init is direct') + init = 'direct' else: init = 'sysvinit' + if init == 'direct': + LOG.debug('init is direct') LOG.debug('Marking with init system %s', init) with file(os.path.join(path, init), 'w'):