summaryrefslogtreecommitdiff
path: root/daemon.c (follow)
Commit message (Collapse)AuthorAge
* Switch back to variadic log macros.HEADpumasterAndre Noll2025-03-23
| | | | | | | | | | | | | This essentially reverts commit 66cdd5bc99a5 which aimed to make the dss log facility C89 conform. While this was a worthwhile goal in 2012, it has little value today, since in 2025 we can safely assume a C99 compliant compiler. The patch was created with git revert -Xours 66cdd5bc followed by manual tweaks to make it compile again.
* Dedoxify the source.Andre Noll2025-02-01
| | | | | | The doxygen comments actually make the source code harder to read, because they tend to document the obvious. Besides, they are not used uniformly accross the code base anyway.
* daemon_init(): Do not set umask to zero.Andre Noll2019-10-25
| | | | | | | | | We don't need this because we actively want rsync to respect the file creation mask. This does not matter in the common case of a single source directory because the permission bits will be copied from the source directory anyway. However, for multiple source directories it does matter because with umask(0) the top level snapshot directory is created with mode 777.
* Replace license boilerplate with single line SPDX comments.Andre Noll2017-11-19
| | | | | | | | | | | | | | | | | | | | This gets rid of existing copyright templates in favor of just the one-liner SPDX (Software Package Data Exchange) notice. All files are licensed under the GPL-2.0, so the same tag is added to each file. No copyright is changed by this commit. Several files (mostly the very short ones) did not contain a license text so far. By default all files without license information are under the default license of this package, which is GPL version 2. This commit adds the missing SPDX line so that now all files except dss.css, index.html.in, INSTALL, NEWS and README have it. We also remove author and copyright year, since the author is the same everywhere, and the year hasn't been updated any more since at least six years. Accurate information is available from the git log. The COPYING file can also be removed because the license text at https://spdx.org/licenses/GPL-2.0.html is immutable.
* run: Fix exit status in case another dss process is running.Andre Noll2017-07-13
| | | | | | | | | | | | | | | | In daemon mode, we must acquire the semaphore lock in the child process because the child does not inherit semaphore adjustments. Currently the parent exits successfully after the fork, so the command appears to succeed even if the child dies immediately because it was unable to acquire the lock because another dss process is holding the lock. This commit introduces a mechanism which enables the parent to tell whether the child completed its setup successfully. We create a pipe prior to calling fork(2), and let the child write to one end of the pipe after setup is complete and just before it enters the main select loop. The parent reads from the other end of the pipe and exits once the read(2) call returns. If the child dies early, read(2) returns zero, indicating failure.
* daemon: Do not change to /.Andre Noll2016-08-21
| | | | | This is pointless because we immediately cd back into the destination dir anyway.
* daemon.c: Open /dev/null read-write.Andre Noll2015-04-14
| | | | | | | While daemonizing we redirect stdin, stdout and stderr to /dev/null, which is considered good practice. We should, however, open these two devices in read-write mode rather than read-only, since not being able to write to stdout/stderr might confuse rsync and the hooks.
* Change email address and URLs.Andre Noll2014-08-19
| | | | | | | | The web and email service of systemlinux.org was down for two weeks. Meanwhile the dss web pages found a new home at the MPI campus of Tübingen. This commit changes the email addresses and the home page URL.
* Merge branch 't/rename_system_files'Andre Noll2012-09-16
|\ | | | | | | | | | | | | | | | | | | | | | | Has been cooking for several weeks. The conflicts daemon.c exec.c file.c ipc.c sig.c are trivial and can be resolved easily.
| * Rename source files which also exist as system headers.Andre Noll2012-08-15
| | | | | | | | | | | | | | | | | | As pointed out by Daniel Richard G. some of the dss header files are named the same as system header files. This patch renames these headers as well as their corresponding .c files. Specifically, error.h, fd.h, signal.h, string.h and time.h become err.h, file.h, sig.h, str.h and tv.h.
* | Make the dss log facility C89 conform.Daniel Richard G2012-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variadic macros were introduced in C99, so they are not supported on ANSI C compilers. Since currently all DSS_*_LOG macros are variadic, we need a replacement for these. Moreover, since not all compilers support __func__ or an equivalent, we need to check for this feature as well and provide a workaround if necessary. This patch introduces the new public function dss_log_set_params() which saves the given log level, filename, line number and the function name in global variables. The DSS_*_LOG macros are changed to receive a single argument only, which is the usual variadic list, enclosed in additional parentheses. The new DSS_*_LOG macros first set the log parameters by calling dss_log_set_params(), then call dss_log() with the variadic list as the argument. dss_log() is patched to print the function name only if __func__ is supported and fall back to file name and the line number otherwise. All DSS_*_LOG() calls are changed to the new syntax.
* | Have foo.c #include foo.h.Daniel Richard G2012-08-15
|/ | | | | This is both to ensure function signature consistency, and to eliminate GCC's "no previous declaration for _____" warnings.
* Change copyright year from 2009 to 2010.Andre Noll2010-11-06
| | | | Better late than never..
* Change copyright year from 2008 to 2009.Andre Noll2009-07-03
| | | | A bit late, but better late than never.
* Implement logfile and daemon mode.Andre Noll2008-03-16
|
* Initial git checkin.Andre Noll2008-03-11
Dyadic intervals are so harmonic. Do you feel it?