hifilove / bro_water

bro_water touching fish
0 stars 0 forks source link

Touching fish #1

Open hifilove opened 2 years ago

hifilove commented 2 years ago

试了一下就酱紫?

hifilove commented 1 year ago

From 3c894fa1a929c36de366627061c7db115e31eac2 Mon Sep 17 00:00:00 2001 From: Wenchao Hao haowenchao@huawei.com Date: Tue, 11 Oct 2022 16:14:00 +0800 Subject: [PATCH] daemon


utils/blkmapd/device-discovery.c | 48 +++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c index 2736ac89..4d97ac72 100644 --- a/utils/blkmapd/device-discovery.c +++ b/utils/blkmapd/device-discovery.c @@ -507,28 +507,44 @@ int main(int argc, char **argv) if (fg) { openlog("blkmapd", LOG_PERROR, 0); } else {

hifilove commented 1 year ago

When started nfs-blkmap.service, the PID file can't be opened, The cause is that the child process does not create the PID file before the systemd reads the PID file. Adding "ExecStartPost=/bin/sleep 0.1" to /usr/lib/systemd/system/nfs-blkmap.service will probably solve this problem, However, there is no guarantee that the above solutions are effective under high cpu pressure.So replace the daemon function with the fork function, and put the behavior of creating the PID file in the parent process to solve the above problems.