diff --git a/ChangeLog b/ChangeLog index f92e5f8..e90e59b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ fix: no longer stops syslogging on HUP signals fix: OSX event watcher no longer misses moves into and out of the watch tree fix: not refinding a relative path to the config file in case of HUP. + fix: rsync doing error 13 and killing Lsyncd. + see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659941 change: Lsyncd now remembers the absolute path of its config file during HUPs 25-08-2011: 2.0.5 diff --git a/lsyncd.c b/lsyncd.c index 60d1bf5..5a6c791 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -479,6 +479,7 @@ close_exec_fd(int fd) logstring("Error", "cannot get descriptor flags!"); exit(-1); // ERRNO } + flags |= FD_CLOEXEC; if (fcntl(fd, F_SETFD, flags) == -1) { logstring("Error", "cannot set descripptor flags!"); @@ -904,6 +905,7 @@ l_exec(lua_State *L) if (!freopen(settings.log_file, "a", stdout)) { printlogf(L, "Error", "cannot redirect stdout to '%s'.", settings.log_file); } + if (!freopen(settings.log_file, "a", stderr)) { printlogf(L, "Error", "cannot redirect stderr to '%s'.", settings.log_file); } @@ -1466,8 +1468,8 @@ daemonize(lua_State *L) // disconnects stdstreams if (!freopen("/dev/null", "r", stdin) || - !freopen("/dev/null", "r", stdout) || - !freopen("/dev/null", "r", stderr) + !freopen("/dev/null", "w", stdout) || + !freopen("/dev/null", "w", stderr) ) { printlogf(L, "Error", "Failure in daemonize at freopen(/dev/null, std[in|out|err])"); }