daemon_init(): Do not set umask to zero. 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. 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. 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 /. This is pointless because we immediately cd back into the destination dir anyway.
daemon.c: Open /dev/null read-write. 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. 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' 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. 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. 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. 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. Better late than never..
Change copyright year from 2008 to 2009. A bit late, but better late than never.
Implement logfile and daemon mode.
Initial git checkin. Dyadic intervals are so harmonic. Do you feel it?