summaryrefslogtreecommitdiff
path: root/err.h (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.
* Revamp com_prune().Andre Noll2019-09-21
| | | | | | | | | | | | | | | | The prune subcommand implements its own logic for picking the snapshot to remove. The algorithm is similar but not identical to how the run subcommand gets rid of snapshots. This patch eliminates this inconsistency by changing com_prune() to call the find_removable_snapshot() helper which was introduced in the previous commit. Since find_removable_snapshot() returns a dynamically allocated string via the "why" pointer, we have to introduce another label for freeing this memory. The patch also improves the help text of the prune subcommand slightly.
* 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.
* Merge branch 'refs/heads/t/kill-w'Andre Noll2017-11-18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Two patches which make life easier for shutdown scripts which need to terminate the dss process, but would like to wait until the exit hook completed. The merge conflicted in dss.suite, but this was trivial to fix. Cooking for a week. * refs/heads/t/kill-w: kill: New option --wait. run: Wait for children to die.
| * kill: New option --wait.Andre Noll2017-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply running "dss kill" during system shutdown to terminate the dss process does not work as expected because the kill subcommand exits after the signal has been sent, which might be long before the targeted dss process terminates. For example, the dss main process might be running its exit hook to inform the system administrator about the fact that the dss service is going down when the shutdown procedure already has deactivated the network. Or the shutdown procedure kills the exit hook with SIGKILL during its normal "killing remaining processes" phase before file systems are unmounted. With the --wait option, the kill subcommand will not return until the dss process has died or the timeout expires. We hardcode the timeout in send_signal() for the time being. It can be made configurable if this turns out to be necessary.
* | New option: --mountpoint.Andre Noll2017-10-21
|/ | | | | | | | | The new option applies to run, create, ls and prune. The feature could be implemented as a pre-create hook, but since it is so common, it makes sense to add it to dss proper. As for the implementation we simply check that "." and ".." are on different devices (or are identical).
* run: Improve error message if dss is already running.Andre Noll2017-07-13
| | | | | | | | | | | | The current error message, "child terminated unexpectedly", is not very comprehensive. The most likely reason for the child to terminate is that it could not obtain the semaphore lock because another dss process is running. This commit adds a test to com_run() that check this condition in the parent before the child process is born. This way, if another process is holding the lock, we can fail with a nice error message that also includes the pid of the process that holds the lock.
* Convert dss to lopsub.Andre Noll2017-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit ditches gengetopt for the command line and config file parsers in favor of the lopsub library. Hence from now on, lopsub must be installed in order to compile dss while gengetopt is no longer needed. The mutually exclusive gengetopt group options --create, --prune, --ls, --run, --kill and --reload are replaced by lopsub subcommands. However, the --reload and --kill options have been combined to the new "kill" subcommand which allows to send arbitrary signals to a running dss process. Due to the conversion, the syntax of the dss command changes slightly. For example, dss --run becomes dss run while dss -Rdc foo needs to be spelled as dss -c foo -- run -d so that -d is regarded as an option to the "run" subcommand rather than an option to dss. With lopsub each subcommand has its own command line and config file parser. Options to subcommands can be added to the configuration file like this: [run] daemon logfile=/var/log/dss.log As for the implementation, the bulk of the changes is the conversion of dss.ggo to the new dss.suite. The necessary adjustments to the code are relatively simple. In particular, only dss.c needs to be changed while all other .c files don't require any modifications. The examples in INSTALL are adjusted to the new syntax. The commit also drops support for Mac OS and Solaris, since lopsub is not supported on these platforms yet.
* Rework restart logic, introduce --max-errors.Andre Noll2015-01-27
| | | | | | | | | | | | | | | | | It has happened several times in the past that dss made no progress because the underlying rsync command terminates with exit code 13 (Errors with program diagnostics). Currently dss special cases this exit code as a non-fatal error, i.e. it does not terminate but restarts the rsync command after 60 seconds. If the problem is permanent, no new snapshots will be created, but the exit hook is not called either, which is unfortunate. This commit tries to improve on this. With this patch applied, the only non-fatal exit code from rsync is 24 (Partial transfer due to vanished source files), which is actually considered success. All other non-zero exit codes cause dss to restart the rsync command, but only at most N times, where N is the argument given to the new --max-rsync-errors option.
* 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.