I deleted it and got this output:
[aaa@ddd mongo]$ sudo rm -fr mongod.lock
[aaa@ddd mongo]$ sudo systemctl restart mongod.service
Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details.
[aaa@ddd mongo]$ sudo journalctl -xe
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=AVC msg=audit(1686684211.349:492648): avc: denied { search } for pid=98411 comm="mongod"
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SYSCALL msg=audit(1686684211.349:492648): arch=c000003e syscall=2 success=no exit=-13 a0=55
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=CWD msg=audit(1686684211.349:492648): cwd="/"
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PATH msg=audit(1686684211.349:492648): item=0 name="/sys/fs/cgroup/memory/memory.limit_in_b
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PROCTITLE msg=audit(1686684211.349:492648): proctitle=2F7573722F62696E2F6D6F6E676F64002D660
Jun 13 21:23:31 ddd mongod[98411]: about to fork child process, waiting until server is ready for connections.
Jun 13 21:23:31 ddd mongod[98411]: forked process: 98414
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=AVC msg=audit(1686684211.392:492649): avc: denied { write } for pid=98414 comm="mongod"
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SYSCALL msg=audit(1686684211.392:492649): arch=c000003e syscall=2 success=no exit=-13 a0=55
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=CWD msg=audit(1686684211.392:492649): cwd="/"
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PATH msg=audit(1686684211.392:492649): item=0 name="/mongo/" inode=64 dev=fd:02 mode=040755
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PATH msg=audit(1686684211.392:492649): item=1 name="/mongo/mongod.lock" objtype=CREATE cap_
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PROCTITLE msg=audit(1686684211.392:492649): proctitle=2F7573722F62696E2F6D6F6E676F64002D660
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=ANOM_ABEND msg=audit(1686684211.407:492650): auid=4294967295 uid=776 gid=598 ses=4294967295
Jun 13 21:23:31 ddd mongod[98411]: ERROR: child process failed, exited with error number 51
Jun 13 21:23:31 ddd mongod[98411]: To see additional information in this output, start without the "--fork" option.
Jun 13 21:23:31 ddd systemd[1]: mongod.service: control process exited, code=exited status=51
Jun 13 21:23:31 ddd systemd[1]: Failed to start MongoDB Database Server.
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Jun 13 21:23:31 ddd systemd[1]: Unit mongod.service entered failed state.
Jun 13 21:23:31 ddd systemd[1]: mongod.service failed.
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SERVICE_START msg=audit(1686684211.416:492651): pid=1 uid=0 auid=4294967295 ses=4294967295
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SYSCALL msg=audit(1686684211.418:492652): arch=c000003e syscall=62 success=yes exit=0 a0=18
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=OBJ_PID msg=audit(1686684211.418:492652): opid=98399 oauid=303693 ouid=0 oses=25537 obj=unc
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PROCTITLE msg=audit(1686684211.418:492652): proctitle=73797374656D63746C0072657374617274006
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SYSCALL msg=audit(1686684211.418:492653): arch=c000003e syscall=62 success=yes exit=0 a0=18
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=OBJ_PID msg=audit(1686684211.418:492653): opid=98400 oauid=303693 ouid=0 oses=25537 obj=unc
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PROCTITLE msg=audit(1686684211.418:492653): proctitle=73797374656D63746C0072657374617274006
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=SYSCALL msg=audit(1686684211.419:492654): arch=c000003e syscall=62 success=yes exit=0 a0=18
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=OBJ_PID msg=audit(1686684211.419:492654): opid=98400 oauid=303693 ouid=0 oses=25537 obj=unc
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=PROCTITLE msg=audit(1686684211.419:492654): proctitle="(null)"
Jun 13 21:23:31 ddd sudo[98397]: pam_unix(sudo:session): session closed for user root
Jun 13 21:23:31 ddd polkitd[1028]: Unregistered Authentication Agent for unix-process:98398:453299266 (system bus name :1.51413, object path /org/fre
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=USER_END msg=audit(1686684211.422:492655): pid=98397 uid=0 auid=303693 ses=25537 subj=uncon
Jun 13 21:23:31 ddd audispd[988]: node=ddd type=CRED_DISP msg=audit(1686684211.422:492656): pid=98397 uid=0 auid=303693 ses=25537 subj=unco
Jun 13 21:23:41 ddd audispd[988]: node=ddd type=USER_ACCT msg=audit(1686684221.080:492657): pid=98431 uid=303693 auid=303693 ses=25537 subj
Jun 13 21:23:41 ddd audispd[988]: node=ddd type=USER_CMD msg=audit(1686684221.081:492658): pid=98431 uid=303693 auid=303693 ses=25537 subj=
Jun 13 21:23:41 ddd audispd[988]: node=ddd type=CRED_REFR msg=audit(1686684221.081:492659): pid=98431 uid=0 auid=303693 ses=25537 subj=unco
Jun 13 21:23:41 ddd sudo[98431]: pam_unix(sudo:session): session opened for user root by aaa(uid=0)
Jun 13 21:23:41 ddd audispd[988]: node=ddd type=USER_START msg=audit(1686684221.087:492660): pid=98431 uid=0 auid=303693 ses=25537 subj=unc
[aaa@ddd mongo]$ sudo systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2023-06-13 21:23:31 CEST; 2min 2s ago
Docs: https://docs.mongodb.org/manual
Process: 98411 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=51)
Process: 98410 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 98406 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 98404 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Main PID: 1703 (code=killed, signal=ABRT)
Jun 13 21:23:31 ddd systemd[1]: Starting MongoDB Database Server...
Jun 13 21:23:31 ddd mongod[98411]: about to fork child process, waiting until server is ready for connections.
Jun 13 21:23:31 ddd mongod[98411]: forked process: 98414
Jun 13 21:23:31 ddd mongod[98411]: ERROR: child process failed, exited with error number 51
Jun 13 21:23:31 ddd mongod[98411]: To see additional information in this output, start without the "--fork" option.
Jun 13 21:23:31 ddd systemd[1]: mongod.service: control process exited, code=exited status=51
Jun 13 21:23:31 ddd systemd[1]: Failed to start MongoDB Database Server.
Jun 13 21:23:31 ddd systemd[1]: Unit mongod.service entered failed state.
Jun 13 21:23:31 ddd systemd[1]: mongod.service failed.
[aaa@ddd mongo]$ sudo tail /var/log/mongodb/mongod.log -n 60
mongod(+0x2296F2D) [0x55735dd75f2d]
libpthread.so.0(+0xF630) [0x7f2bb77f9630]
libc.so.6(gsignal+0x37) [0x7f2bb7452387]
libc.so.6(abort+0x148) [0x7f2bb7453a78]
mongod(_ZN5mongo22invariantFailedWithMsgEPKcS1_S1_j+0x0) [0x55735c47affe]
mongod(_ZN5mongo20ServiceContextMongoD9_newOpCtxEPNS_6ClientEj+0x158) [0x55735c722878]
mongod(_ZN5mongo14ServiceContext20makeOperationContextEPNS_6ClientE+0x41) [0x55735dc2af31]
mongod(_ZN5mongo6Client20makeOperationContextEv+0x27) [0x55735dc27017]
mongod(+0xA12863) [0x55735c4f1863]
mongod(+0x2292BF5) [0x55735dd71bf5]
mongod(_ZN5mongo8shutdownENS_8ExitCodeERKNS_16ShutdownTaskArgsE+0x364) [0x55735c47c1d7]
mongod(_ZZN5mongo13duration_castINS_8DurationISt5ratioILl1ELl1000EEEES2_ILl1ELl1EEEET_RKNS1_IT0_EEENKUlvE_clEv+0x0) [0x55735c414cbc]
mongod(_ZN5mongo11mongoDbMainEiPPcS1_+0x87A) [0x55735c4f91ea]
mongod(main+0x9) [0x55735c47d129]
libc.so.6(__libc_start_main+0xF5) [0x7f2bb743e555]
mongod(+0xA0235F) [0x55735c4e135f]
----- END BACKTRACE -----
2023-06-13T21:23:31.360+0200 I CONTROL [main] ***** SERVER RESTARTED *****
2023-06-13T21:23:31.393+0200 I CONTROL [initandlisten] MongoDB starting : pid=98414 port=27017 dbpath=/mongo 64-bit host=ddd
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] db version v3.6.17
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] git version: 3d6953c361213c5bfab23e51ab274ce592edafe6
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] allocator: tcmalloc
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] modules: none
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] build environment:
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] distmod: rhel70
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] distarch: x86_64
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] target_arch: x86_64
2023-06-13T21:23:31.394+0200 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid", timeZoneInfo: "/usr/share/zoneinfo" }, storage: { dbPath: "/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2023-06-13T21:23:31.394+0200 I STORAGE [initandlisten] exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /mongo, terminating
2023-06-13T21:23:31.394+0200 F - [initandlisten] Invariant failure globalStorageEngine src/mongo/db/service_context_d.cpp 272
2023-06-13T21:23:31.394+0200 F - [initandlisten]
***aborting after invariant() failure
2023-06-13T21:23:31.408+0200 F - [initandlisten] Got signal: 6 (Aborted).
0x55d61a997831 0x55d61a996a49 0x55d61a996f2d 0x7f59393ad630 0x7f5939006387 0x7f5939007a78 0x55d61909bffe 0x55d619343878 0x55d61a84bf31 0x55d61a848017 0x55d619112863 0x55d61a992bf5 0x55d61909d1d7 0x55d619035cbc 0x55d61911a1ea 0x55d61909e129 0x7f5938ff2555 0x55d61910235f
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"55D618700000","o":"2297831","s":"_ZN5mongo15printStackTraceERSo"},{"b":"55D618700000","o":"2296A49"},{"b":"55D618700000","o":"2296F2D"},{"b":"7F593939E000","o":"F630"},{"b":"7F5938FD0000","o":"36387","s":"gsignal"},{"b":"7F5938FD0000","o":"37A78","s":"abort"},{"b":"55D618700000","o":"99BFFE","s":"_ZN5mongo22invariantFailedWithMsgEPKcS1_S1_j"},{"b":"55D618700000","o":"C43878","s":"_ZN5mongo20ServiceContextMongoD9_newOpCtxEPNS_6ClientEj"},{"b":"55D618700000","o":"214BF31","s":"_ZN5mongo14ServiceContext20makeOperationContextEPNS_6ClientE"},{"b":"55D618700000","o":"2148017","s":"_ZN5mongo6Client20makeOperationContextEv"},{"b":"55D618700000","o":"A12863"},{"b":"55D618700000","o":"2292BF5"},{"b":"55D618700000","o":"99D1D7","s":"_ZN5mongo8shutdownENS_8ExitCodeERKNS_16ShutdownTaskArgsE"},{"b":"55D618700000","o":"935CBC","s":"_ZZN5mongo13duration_castINS_8DurationISt5ratioILl1ELl1000EEEES2_ILl1ELl1EEEET_RKNS1_IT0_EEENKUlvE_clEv"},{"b":"55D618700000","o":"A1A1EA","s":"_ZN5mongo11mongoDbMainEiPPcS1_"},{"b":"55D618700000","o":"99E129","s":"main"},{"b":"7F5938FD0000","o":"22555","s":"__libc_start_main"},{"b":"55D618700000","o":"A0235F"}],"processInfo":{ "mongodbVersion" : "3.6.17", "gitVersion" : "3d6953c361213c5bfab23e51ab274ce592edafe6", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "3.10.0-1160.81.1.el7.x86_64", "version" : "#1 SMP Thu Nov 24 12:21:22 UTC 2022", "machine" : "x86_64" }, "somap" : [ { "b" : "55D618700000", "elfType" : 3, "buildId" : "F5A6F048CC3D823882D3FDB7A4A386EE2E0BC1D4" }, { "b" : "7FFD6F784000", "elfType" : 3, "buildId" : "EFDC01C543E3027D760D04B6BFDD53C3F48C6798" }, { "b" : "7F593A5B3000", "path" : "/lib64/libresolv.so.2", "elfType" : 3, "buildId" : "E0CD0DD5466E6B9E5FB10BFAFF13B1BB50F08EAA" }, { "b" : "7F593A150000", "path" : "/lib64/libcrypto.so.10", "elfType" : 3, "buildId" : "622F79C1AB7612F082403F4987CE1DAC287775C3" }, { "b" : "7F5939EDE000", "path" : "/lib64/libssl.so.10", "elfType" : 3, "buildId" : "7CBCB0322F585236D81B557ED95C708F98A20C33" }, { "b" : "7F5939CDA000", "path" : "/lib64/libdl.so.2", "elfType" : 3, "buildId" : "7F2E9CB0769D7E57BD669B485A74B537B63A57C4" }, { "b" : "7F5939AD2000", "path" : "/lib64/librt.so.1", "elfType" : 3, "buildId" : "3E44DF7055942478D052E40FDD1F5B7862B152B0" }, { "b" : "7F59397D0000", "path" : "/lib64/libm.so.6", "elfType" : 3, "buildId" : "7615604EAF4A068DFAE5085444D15C0DEE93DFBD" }, { "b" : "7F59395BA000", "path" : "/lib64/libgcc_s.so.1", "elfType" : 3, "buildId" : "EDF51350C7F71496149D064AA8B1441F786DF88A" }, { "b" : "7F593939E000", "path" : "/lib64/libpthread.so.0", "elfType" : 3, "buildId" : "E10CC8F2B932FC3DAEDA22F8DAC5EBB969524E5B" }, { "b" : "7F5938FD0000", "path" : "/lib64/libc.so.6", "elfType" : 3, "buildId" : "FC4FA58E47A5ACC137EADB7689BCE4357C557A96" }, { "b" : "7F593A7CD000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "62C449974331341BB08DCCE3859560A22AF1E172" }, { "b" : "7F5938DBA000", "path" : "/lib64/libz.so.1", "elfType" : 3, "buildId" : "E69C3975164331DF84F4E8955CC3F7A0836B05D0" }, { "b" : "7F5938B6D000", "path" : "/lib64/libgssapi_krb5.so.2", "elfType" : 3, "buildId" : "0CAEC124D97114DA40DDEB0FED1FAD5D14C3D626" }, { "b" : "7F5938884000", "path" : "/lib64/libkrb5.so.3", "elfType" : 3, "buildId" : "52C5B6279DA9CD210E5D58D1B1E0E080E5C8B232" }, { "b" : "7F5938680000", "path" : "/lib64/libcom_err.so.2", "elfType" : 3, "buildId" : "E4C7298B74FEEADC4DDE40CDD8C4D6B85FE09ADE" }, { "b" : "7F593844D000", "path" : "/lib64/libk5crypto.so.3", "elfType" : 3, "buildId" : "5FF9D1075A8D5D62F77F5CE56C935FCD92C62EFA" }, { "b" : "7F593823D000", "path" : "/lib64/libkrb5support.so.0", "elfType" : 3, "buildId" : "779381063DAECC27E8480C8F79F0651162586478" }, { "b" : "7F5938039000", "path" : "/lib64/libkeyutils.so.1", "elfType" : 3, "buildId" : "8CA73C16CFEB9A8B5660015B9223B09F87041CAD" }, { "b" : "7F5937E12000", "path" : "/lib64/libselinux.so.1", "elfType" : 3, "buildId" : "805AB866A4573EFEC4D8EA95123E8349B2B9D349" }, { "b" : "7F5937BB0000", "path" : "/lib64/libpcre.so.1", "elfType" : 3, "buildId" : "F5B144F9F5D9BE451C80211B34DB2CE348E039B6" } ] }}
mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x55d61a997831]
mongod(+0x2296A49) [0x55d61a996a49]
mongod(+0x2296F2D) [0x55d61a996f2d]
libpthread.so.0(+0xF630) [0x7f59393ad630]
libc.so.6(gsignal+0x37) [0x7f5939006387]
libc.so.6(abort+0x148) [0x7f5939007a78]
mongod(_ZN5mongo22invariantFailedWithMsgEPKcS1_S1_j+0x0) [0x55d61909bffe]
mongod(_ZN5mongo20ServiceContextMongoD9_newOpCtxEPNS_6ClientEj+0x158) [0x55d619343878]
mongod(_ZN5mongo14ServiceContext20makeOperationContextEPNS_6ClientE+0x41) [0x55d61a84bf31]
mongod(_ZN5mongo6Client20makeOperationContextEv+0x27) [0x55d61a848017]
mongod(+0xA12863) [0x55d619112863]
mongod(+0x2292BF5) [0x55d61a992bf5]
mongod(_ZN5mongo8shutdownENS_8ExitCodeERKNS_16ShutdownTaskArgsE+0x364) [0x55d61909d1d7]
mongod(_ZZN5mongo13duration_castINS_8DurationISt5ratioILl1ELl1000EEEES2_ILl1ELl1EEEET_RKNS1_IT0_EEENKUlvE_clEv+0x0) [0x55d619035cbc]
mongod(_ZN5mongo11mongoDbMainEiPPcS1_+0x87A) [0x55d61911a1ea]
mongod(main+0x9) [0x55d61909e129]
libc.so.6(__libc_start_main+0xF5) [0x7f5938ff2555]
mongod(+0xA0235F) [0x55d61910235f]
----- END BACKTRACE -----