Look for an option 'init' in ceph.conf. Otherwise, check if we're ubuntu.
If so, use upstart. Otherwise, use sysvinit.
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit
d1904b2a848af3c02d2065ac2a42abe0e2699d0f)
import logging
import os
import os.path
+import platform
import re
import subprocess
import stat
'upstart',
'sysvinit',
'systemd',
+ 'auto',
]
log_name = __name__
)
if init is not None:
+ if init == 'auto':
+ c = get_conf(
+ cluster=cluster,
+ variable='init'
+ )
+ if c is not None:
+ init = c
+ else:
+ (distro, release, codename) = platform.dist()
+ if distro == 'Ubuntu':
+ init = 'upstart'
+ else:
+ init = 'sysvinit'
+
log.debug('Marking with init system %s', init)
with file(os.path.join(path, init), 'w'):
pass
'--mark-init',
metavar='INITSYSTEM',
help='init system to manage this dir',
+ default='auto',
choices=init_systems,
)
parser.set_defaults(