From 3b503ae61c89a28fecb988358f3d1ae277b0ee1c Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 28 Jul 2022 16:01:17 +0800 Subject: [PATCH] up --- plugins/rsyncd/index.py | 5 ++++- plugins/rsyncd/init.d/lsyncd.service.tpl | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index c0d4949e4..42436a931 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -176,11 +176,12 @@ def initDSend(): mw.writeFile(file_bin, content) mw.execShell('chmod +x ' + file_bin) + lock_file = getServerDir() + "/installed.pl" # systemd systemDir = mw.systemdCfgDir() systemService = systemDir + '/lsyncd.service' systemServiceTpl = getPluginDir() + '/init.d/lsyncd.service.tpl' - if os.path.exists(systemDir) and not os.path.exists(systemService): + if not os.path.exists(lock_file): lsyncd_bin = mw.execShell('which lsyncd')[0].strip() if lsyncd_bin == '': print('lsyncd missing!') @@ -192,6 +193,8 @@ def initDSend(): mw.writeFile(systemService, content) mw.execShell('systemctl daemon-reload') + mw.writeFile(lock_file, "ok") + lslog = getLsyncdLog() if os.path.exists(lslog): mw.writeFile(lslog, '') diff --git a/plugins/rsyncd/init.d/lsyncd.service.tpl b/plugins/rsyncd/init.d/lsyncd.service.tpl index 680881d7e..7c6a03c60 100755 --- a/plugins/rsyncd/init.d/lsyncd.service.tpl +++ b/plugins/rsyncd/init.d/lsyncd.service.tpl @@ -3,7 +3,8 @@ Description=Lightweight inotify based sync daemon ConditionPathExists={$SERVER_PATH}/rsyncd/lsyncd.conf [Service] -ExecStart={$LSYNCD_BIN} -pidfile /var/run/lsyncd.pid {$SERVER_PATH}/rsyncd/lsyncd.conf +Type=simple +ExecStart={$LSYNCD_BIN} -nodaemon {$SERVER_PATH}/rsyncd/lsyncd.conf [Install] WantedBy=multi-user.target