summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* | Simplify split_args().Andre Noll2019-10-13
|/ | | | | Both callers pass the same value for the delimiters, so we can remove the last argument of the function.
* Merge branch 'refs/heads/t/multiple-source-dirs'Andre Noll2019-09-18
|\ | | | | | | | | | | | | | | Was cooking for more than a year. * refs/heads/t/multiple-source-dirs: create_rsync_argv(): Allocate correctly sized arg array. Support multiple source directories.
| * create_rsync_argv(): Allocate correctly sized arg array.Andre Noll2019-09-03
| | | | | | | | | | | | In the calculation of the length of the argv array we did not take into account that --source-dir may be given multiple times. This can result in an invalid write at the end of the allocated space.
| * Support multiple source directories.Andre Noll2018-06-08
| | | | | | | | | | | | | | | | | | | | | | rsync is capable of copying multiple source directories to a single destination, but this is currently not supported by dss. This commit adds this functionality. The implementation is straight-forward, except that we don't want to add a trailing slash to every source directory. The new comment in dss.c explains this in more detail. Suggested-By: Sanja Jasek <sanja.jasek@tuebingen.mpg.de> Tested-By: Sanja Jasek <sanja.jasek@tuebingen.mpg.de>
* | Remove stale comment.Andre Noll2019-02-10
| | | | | | | | | | | | This comment went stale ten years ago in commit 360bcc95d588 (Clean up snapshot removal logic) which changed the type of the return value of find_redundant_snapshot() from int to struct snapshot *.
* | Improve comment of snapshot_currently_being_removed.Andre Noll2019-02-10
| | | | | | | | The old comment did not provide any information at all..
* | Add link to author homepage.Andre Noll2019-02-01
|/ | | | | People who like dss might also be interested in other projects of the author.
* Fixed typo.Sanja Jasek2018-06-04
| | | | Signed-off-by: Andre Noll <maan@tuebingen.mpg.de>
* dss-1.0.0.v1.0.0Andre Noll2017-11-19
|
* Add missing newline to --version output.Andre Noll2017-11-19
|
* run: Don't kill children twice.Andre Noll2017-11-19
| | | | | | | | | | | | | | | When handle_signal(), the signal dispatcher of the run subcommand, detects that SIGINT or SIGTERM was received, it calls kill_children() to terminate any running rsync or rm processes. It then returns negative which terminates the select loop. However, after select_loop() returns, kill_children() is called again. Also the error message is logged twice. Not a biggie, but let's get rid of this redundancy by removing the first call to kill_children(). Since handle_signal() is only called from com_run(), this patch affects only the run subcommand.
* Fix compute_next_snapshot_time().Andre Noll2017-11-19
| | | | | | | | | | | | | | | | | The function computes the average idle time between snapshots and adds this value to the completion time of the last snapshot to obtain the start time for the next snapshot. However, if the last snapshot happens to be incomplete, its completion time is set to -1. Hence the computed next snapshot time is going to be in the past, so we start the next snapshot immediately. Although this is incorrect, the bug is benign because the correct next snapshot time should also be in the past since we decided earlier to create the snapshot which was now found incomplete. Fix this by using the completion time of the last _complete_ snapshot instead.
* ipc.c: Remove a dead store.Andre Noll2017-11-19
| | | | | scan-build correctly points out that the value stored to 'name' is never read.
* Silence a bogus scan-build warning.Andre Noll2017-11-19
| | | | | | | We never pass a NULL pointer to create_snapshot(), but scan-build is unable to prove this and claims that the array access results in a null pointer dereference. The added assertion helps the reader of the code, and it quietens scan-build.
* 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.
| * run: Wait for children to die.Andre Noll2017-11-02
| | | | | | | | | | | | | | | | When the select loop returns and dss is about to terminate, it sends SIGTERM to any running rm or rsync processes and exits. It does not wait for these processes to die, however. This is trivial to implement, and it makes life easier for shutdown scripts which like to proceed with unmounting file systems.
* | Merge branch 'refs/heads/t/exit-hook'Andre Noll2017-11-17
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | A fix for a long standing issue with the exit hook. Cooking for a week. * refs/heads/t/exit-hook: Allow word-splitting for exit hook.
| * | Allow word-splitting for exit hook.Andre Noll2017-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All hooks except the exit hook are run via dss_exec_cmdline_pid(), which performs word splitting to create the argument vector for exec(2). For the exit hook, however, we build the argument vector manually, so the command line for the exit hook is not split. This commit removes this inconsistency. However, we can't use dss_exec_cmdline_pid() here because we need to append the error string which caused dss to exit to the argument vector as a single argument, and this string may well contain whitespace characters. Hence we run split_args() on the argument to --exit-hook to obtain an argument vector, append the error string as another element, and then run dss_exec().
* | | Merge branch 'refs/heads/t/ls-incomplete-duration'Andre Noll2017-11-16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple patch which improves the ls output. Cooking for 10 days. * refs/heads/t/ls-incomplete-duration: ls: Print current duration of incomplete snapshots.
| * | | ls: Print current duration of incomplete snapshots.Andre Noll2017-11-06
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Currently the duration of incomplete (and orphaned) snapshots is shown as 0:00. It's more interesting to see for how long the snapshot is already being created, so print the difference of the current time and the start time instead. Fix an overlong line and a whitespace issue while at it.
* | | Merge branch 'refs/heads/t/mountpoint'Andre Noll2017-11-15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new main option which aborts dss if the destination file system is not mounted. Cooking for two weeks. * refs/heads/t/mountpoint: New option: --mountpoint.
| * | | 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).
* | | Merge branch 'refs/heads/t/short-log'Andre Noll2017-11-14
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few patches which change dss_log() to only print the time stamp and the function if dss is executing the "run" subcommand. Cooking for a week. * refs/heads/t/short-log: Subcommand sensitive logging. Save the subcommand pointer in a global variable. main(): Don't initialize user data pointer.
| * | | Subcommand sensitive logging.Andre Noll2017-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's kind of silly to log the current time and the function name for subcommands other than "run", since these commands run only for a short time. This commit changes dss_log() to only print this additional information when dss run is being executed.
| * | | Save the subcommand pointer in a global variable.Andre Noll2017-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for subcommand sensitive logging which will be introduced in a subsequent commit. For now it allows to drop the argument of check_config(), which is good given that handle_sighup() already played dirty games by "knowing" it is only called from the run subcommand.
| * | | main(): Don't initialize user data pointer.Andre Noll2017-10-28
| |/ / | | | | | | | | | | | | | | | It is never used uninitialized. The unnecessary initialization only hides the warning from the compiler if it ever should ever be used uninitialized.
* | | find_orphaned_snapshot(): Improve log message.Andre Noll2017-11-14
| | | | | | | | | | | | | | | | | | It is kind of obvious that find_orphaned_snapshot() looks for, well, orphaned snapshots. The new message at least gives the user a vague idea what this means.
* | | Add log message to send_signal().Andre Noll2017-11-14
| | | | | | | | | | | | Sending a signal is a significant event which deserves a log message.
* | | Remove a noisy log message.Andre Noll2017-11-14
| | | | | | | | | | | | | | | This message does not add any information and just spams the log file. Remove it.
* | | Fix bad grammar "allows <infinitive>".Andre Noll2017-11-14
| | | | | | | | | | | | | | | In standard English, the verb "allows" can never take an infinitive as its direct object.
* | | gcc-compat.h: Remove _static_inline_ macro.Andre Noll2017-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only purpose of this macro is to have a way to include static inline functions into the doxygen source code documentation (but omit normal static functions in .c files). Since dss does not use doxygen, the macro is pointless. Remove the equally pointless documentation of dss_rename(), one of the two users of _static_inline_, while converting it to plain static inline.
* | | Clean up gcc-compat.h.Andre Noll2017-11-14
| | | | | | | | | | | | It contained three macros which are no longer used.
* | | Merge branch 'refs/heads/t/configtest'Andre Noll2017-11-13
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single patch which adds the new configtest subcommand, plus a fixup for a formatting issue which was noticed only after the branch had already been merged to next. * refs/heads/t/configtest: show_subcommand_summary(): Increase column width. New subcommand: configtest.
| * | | show_subcommand_summary(): Increase column width.Andre Noll2017-11-04
| | | | | | | | | | | | | | | | | | | | Since the new configtest command is 10 characters long, there was no whitespace between the command name and the short description.
| * | | New subcommand: configtest.Andre Noll2017-10-28
| |/ / | | | | | | | | | | | | | | | | | | | | | Similar to the identically named subcommand of apache2ctl. This is trivial to implement because we only need to describe the subcommand in dss.suite and create a command handler which prints an OK message and returns success. If the config file contains errors, we abort earlier anyway.
* | | Merge branch 'maint'Andre Noll2017-11-13
|\ \ \ | |_|/ |/| | | | | | | | * maint: Fix snapshot removal reason.
| * | Fix snapshot removal reason.maintAndre Noll2017-11-13
| | | | | | | | | | | | | | | If the oldest snapshot has to be removed because disk space is low, we currently log "orphaned" as the reason, which is incorrect.
* | | Update .gitignore.Andre Noll2017-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | We never had .a files in the tree, and the .cmdline.[ch] files went away when we switched to lopsub. The generated index.html was always missing. Moreover, let's add *.swp, the swap files created by vim to recover crashed editing sessions.
* | | README/INSTALL: Fix typo: snaphot.Andre Noll2017-11-06
| | | | | | | | | | | | | | | | | | | | | The typo in README was introduced two years ago in commit 05e75054 (README: Explain that there are no incremental backups) while the one in INSTALL is more than five years old, see commit a0b6810b (doc: Add a second example config file).
* | | INSTALL: Switch to https for rsync link.Andre Noll2017-11-06
| | | | | | | | | | | | | | | The http link gives 502 (Couldn't parse server headers) at the moment while https works.
* | | NEWS: Fix lopsub link.Andre Noll2017-11-06
| | | | | | | | | | | | The tilde caused the URL to 404.
* | | Merge branch 'refs/heads/t/im-logo'Andre Noll2017-11-06
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | One commit which changes the way dss.png is built and another one which adds the generated dss.png to .gitignore. * refs/heads/t/im-logo: Add dss.png to .gitignore. Replace dss.dia by a shell script.
| * | Add dss.png to .gitignore.Andre Noll2017-07-17
| | | | | | | | | | | | It's a generated file which should never be under version control.
| * | Replace dss.dia by a shell script.Andre Noll2017-07-17
| |/ | | | | | | | | | | | | | | | | | | | | | | The dia command line tool misaligns the text on the dss logo, and the dia application started to segfault on my home box after a library upgrade. This patch replaces the dia source file by the mklogo bash script which runs the convert utility of ImageMagick to write the dss logo in png format to stdout. The result looks almost identical.
* | Merge branch 'refs/heads/t/lopsub'Andre Noll2017-10-15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion to lopsub and a few other improvements on top of it. * refs/heads/t/lopsub: INSTALL: Explain how to use CPPFLAGS and LDFLAGS. build: Introduce DSS_CPPFLAGS. build: Fix cc command which creates dependencies, build: Combine CFLAGS and DEBUG_CFLAGS. Implement --checksum. run: Improve error diagnostics for chdir(2) failure. run: Improve error message if dss is already running. run: Fix exit status in case another dss process is running. build: Add target install and install-strip. Convert dss to lopsub. Remove --no-resume.
| * | INSTALL: Explain how to use CPPFLAGS and LDFLAGS.Andre Noll2017-07-13
| | |
| * | build: Introduce DSS_CPPFLAGS.Andre Noll2017-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with CFLAGS, it is good practice to leave CPPFLAGS unset in the Makefile and append it to the cc command after our own flags, to give the user a chance to override our settings. This patch initializes DSS_CPPFLAGS with the VERSION_STRING define which was part of the receipe and adds -Wunused macros, which is a preprocessor flag rather than a compiler flag. DSS_CPPFLAGS and CPPFLAGS are added to the two relevant commands, in addition to the existing DSS_CFLAGS and CFLAGS.
| * | build: Fix cc command which creates dependencies,Andre Noll2017-07-13
| | | | | | | | | | | | | | | | | | The command to create Makefile.deps was hardcoded as gcc in Makefile. This patch changes the command to $(CC) and adds the usual set of flags which we use for compiling.