首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用supervisord运行lsyncd脚本

使用supervisord运行lsyncd脚本
EN

Stack Overflow用户
提问于 2018-04-09 09:51:37
回答 1查看 442关注 0票数 2

我试图运行我的lsynd的脚本与监督,以便让它始终运行。我已经为我的主管编写了这个文件

代码语言:javascript
复制
[program:autostart_lsyncd]
command=bash -c "lsyncd /home/sync/lsyncd_script.lua"
autostart=true
autorestart=unexpected
numprocs=1
startsecs = 0
stderr_logfile=/var/log/autostart_sync.err.log
stdout_logfile=/var/log/autostart_sync.out.log

脚本在启动时运行正常,但它总是退出。

代码语言:javascript
复制
2018-04-09 09:48:49,638 INFO success: autostart_lsyncd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2018-04-09 09:48:49,639 INFO exited: autostart_lsyncd (exit status 0; expected)

我不明白这是否是保持lsynd脚本存活的正确方法。有什么建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-09 10:36:52

我正在使用这个配置来监控文件/etc/主管/conf.d/lsyncd.conf中的etc。

代码语言:javascript
复制
[program:lsyncd]
command=/usr/bin/lsyncd -nodaemon /etc/lsyncd/lsyncd.conf.lua
autostart=true
autorestart=unexpected
startretries=3

这个配置到lsyncd (/etc/lsyncd/lsyncd.conf.etc):

代码语言:javascript
复制
settings {
    logfile = "/var/log/lsyncd/lsyncd.log",
    statusFile = "/var/log/lsyncd/lsyncd.status"
}

sync {
    default.rsync,
    source="/var/www/html/sites/default/files",
    target="root@cdn:/var/www/html/sites/default/files",
    exclude = {"*.php", "*.po", "\.ht*"},
    rsync = {
        archive = false,
        acls = false,
        compress = true,
        links = false,
        owner = false,
        perms = false,
        verbose = true,        
        rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
    }
}

此外,我还配置了ssh键,并在服务器中安装了rsync。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49730097

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档