mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 18:07:57 +00:00
New message: ERROR: Required file /usr/lib64/libcrypto.so.3.0.1 not found. Exiting Old message: File "/home/criu/coredump/criu_coredump/coredump.py", line 693, in _gen_mem_chunk f = open(fname, 'rb') FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib64/libcrypto.so.3.0.1' Signed-off-by: Adrian Reber <areber@redhat.com>
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
import argparse
|
|
import os
|
|
import sys
|
|
|
|
import criu_coredump
|
|
|
|
|
|
def coredump(opts):
|
|
generator = criu_coredump.coredump_generator()
|
|
cores = generator(os.path.realpath(opts['in']))
|
|
for pid in cores:
|
|
if opts['pid'] and pid != opts['pid']:
|
|
continue
|
|
with open(os.path.realpath(opts['out']) + "/core." + str(pid), 'wb+') as f:
|
|
cores[pid].write(f)
|
|
|
|
|
|
def main():
|
|
desc = 'CRIU core dump'
|
|
parser = argparse.ArgumentParser(description=desc,
|
|
formatter_class=argparse.RawTextHelpFormatter)
|
|
|
|
parser.add_argument('-i',
|
|
'--in',
|
|
default='.',
|
|
help='directory where to get images from')
|
|
parser.add_argument('-p',
|
|
'--pid',
|
|
type=int,
|
|
help='generate coredump for specific pid(all pids py default)')
|
|
parser.add_argument('-o',
|
|
'--out',
|
|
default='.',
|
|
help='directory to write coredumps to')
|
|
|
|
opts = vars(parser.parse_args())
|
|
|
|
try:
|
|
coredump(opts)
|
|
except SystemExit as error:
|
|
print('ERROR: %s' % error)
|
|
print('Exiting')
|
|
sys.exit(1)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|