MCPcopy Create free account
hub / github.com/ceph/ceph / ceph_log

Function ceph_log

qa/tasks/ceph.py:128–304  ·  view source on GitHub ↗

Create /var/log/ceph log directory that is open to everyone. Add valgrind and profiling-logger directories. :param ctx: Context :param config: Configuration

(ctx, config)

Source from the content-addressed store, hash-verified

126
127@contextlib.contextmanager
128def ceph_log(ctx, config):
129 """
130 Create /var/log/ceph log directory that is open to everyone.
131 Add valgrind and profiling-logger directories.
132
133 :param ctx: Context
134 :param config: Configuration
135 """
136 log.info('Making ceph log dir writeable by non-root...')
137 run.wait(
138 ctx.cluster.run(
139 args=[
140 'sudo',
141 'chmod',
142 '777',
143 '/var/log/ceph',
144 ],
145 wait=False,
146 )
147 )
148 log.info('Disabling ceph logrotate...')
149 run.wait(
150 ctx.cluster.run(
151 args=[
152 'sudo',
153 'rm', '-f', '--',
154 '/etc/logrotate.d/ceph',
155 ],
156 wait=False,
157 )
158 )
159 log.info('Creating extra log directories...')
160 run.wait(
161 ctx.cluster.run(
162 args=[
163 'sudo',
164 'install', '-d', '-m0777', '--',
165 '/var/log/ceph/valgrind',
166 '/var/log/ceph/profiling-logger',
167 ],
168 wait=False,
169 )
170 )
171
172 # Add logs directory to job's info log file
173 update_archive_setting(ctx, 'log', '/var/log/ceph')
174
175 class Rotater(object):
176 stop_event = gevent.event.Event()
177
178 def invoke_logrotate(self):
179 # 1) install ceph-test.conf in /etc/logrotate.d
180 # 2) continuously loop over logrotate invocation with ceph-test.conf
181 while not self.stop_event.is_set():
182 self.stop_event.wait(timeout=30)
183 try:
184 procs = ctx.cluster.run(
185 args=['sudo', 'logrotate', '/etc/logrotate.d/ceph-test.conf'],

Callers 1

taskFunction · 0.70

Calls 11

beginMethod · 0.95
endMethod · 0.95
write_rotate_confFunction · 0.85
RotaterClass · 0.85
update_archive_settingFunction · 0.70
infoMethod · 0.45
waitMethod · 0.45
runMethod · 0.45
getMethod · 0.45
joinMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected