pull/143/head
midoks 3 years ago
parent 2300efe748
commit 3b503ae61c
  1. 5
      plugins/rsyncd/index.py
  2. 3
      plugins/rsyncd/init.d/lsyncd.service.tpl

@ -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, '')

@ -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

Loading…
Cancel
Save