| Commit message (Collapse) | Author | Age |
| |\
| |
| |
| |
| | |
* master:
Support local make files.
|
| | |
| |
| |
| |
| |
| | |
These additional targets are handy for site-local targets such as
installing the web files or deploying the executable and the man page
on a remote server.
|
| |\|
| |
| |
| |
| | |
* master:
Fix --config-file for relative paths.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The dss lock works by first turning the given config file path
argument into a canonical absolute path using dss_realpath(), then
hashing this absolute path to obtain a key ID for semget(2).
If the given path is relative, we have to compute the ID before
changing to the destination directory because dss_realpath() needs to
call stat(2) to detect symlinks, and this system call will fail if the
current working directory has changed. This is currently not the case
as we change to the destination directory early in check_config().
If dss_realpath() fails, we silently use the unmodified path argument
for hashing to deal with the case that the default config does not
exist. As a result, if relative paths are given, the key ID depends
on whether or not change_to_dest_dir() was called. This is the case
for the run subcommanmd, but not for the kill subcommand. Thus the
kill subcommand does not work as expected if a relative path is given.
Fix this by grabbing the lock before changing the working directory
in all cases.
|
| |\|
| |
| |
| |
| |
| | |
* master:
Avoid duplicate error message.
dss-1.0.1.
|
| | |
| |
| |
| |
| |
| | |
If parse_config_file() encounters an error, it logs the error *and*
returns the error code, which causes the error message to be logged
again. Fix this by removing the log statement from parse_config_file().
|
| | | |
|
| |\|
| |
| |
| | |
* master:
|
| | |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A couple of cleanups and unifications for the snapshot pruning code,
which is executed by the prune and run subcommands. With the patches
applied, both subcommands behave identically, i.e. they consider
the same set of snapshots as candidates for pruning. Also the prune
command gained the new --disk-space option to force it to act as if
disk space was high or low.
Cooking for six weeks.
* refs/heads/t/prune:
Introduce prune --disk-space.
Revamp com_prune().
Factor out find_removable_snapshot().
prune Simplify rm exit code logic.
find_oldest_removable_snapshot(): Improve log message.
prune: Print a message if there is nothing to prune.
get_snapshot_list(): Add comment about sorting.
prune: Fail gracefully if pre-rm hook fails.
|
| | |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Cooking for about a month. The web page has been updated today to
use the new logo.
* refs/heads/t/svg-logo:
Redo the logo as svg.
|
| |\| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* master:
daemon_init(): Do not set umask to zero.
Fix logic to append slash to the source directory.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This bug was introduced recently in commit dd3f58c0bdf1
(create_rsync_argv(): Allocate correctly sized arg array) which
redefined N.
|
| |\| | |
| | | |
| | | |
| | | |
| | | | |
* master:
Simplify split_args().
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
Both callers pass the same value for the delimiters, so we can
remove the last argument of the function.
|
| |\ \ \ \
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* refs/heads/t/prune:
Introduce prune --disk-space.
Revamp com_prune().
Factor out find_removable_snapshot().
prune Simplify rm exit code logic.
find_oldest_removable_snapshot(): Improve log message.
prune: Print a message if there is nothing to prune.
get_snapshot_list(): Add comment about sorting.
prune: Fail gracefully if pre-rm hook fails.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The new option takes a mandatory argument of the set {check, high,
low}. The latter two make the command act as if disk space was
high/low without actually performing the check. This is mostly useful
for debugging.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Both the run and the prune subcommand contain code for picking a
suitable snapshot to remove, with slightly different semantics.
This is a preparatory patch for eliminating the differences between
the two implementations. It introduces a new helper which can be
shared. After this patch, only the run subcommand uses the helper. A
subsequent patch will convert the second caller, com_prune().
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
We can rely on the fact that wait_for_remove_process() sets
snapshot_removal_status to the correct value on success.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The other three functions which return a candidate for removal print
one debug message but not the name of the selected snapshot, so make
find_oldest_removable_snapshot() follow this pattern too.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When the prune subcommand finds there are no snapshots to prune, the
command stays silent, which is confusing. Make it print "nothing to
prune" in this case.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
Callers rely on the returned snapshot list being sorted by creation
time, so let's document this fact.
|
| | |/ /
| | |
| | |
| | |
| | |
| | | |
In this case wait_for_remove_process() returns non-negative and we
miss to set the exit code, making the command appear to succeed even
if the rm process has not been created.
|
| |\ \ \
| | |/
| |/|
| | |
| | | |
* refs/heads/t/svg-logo:
Redo the logo as svg.
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| | |
Scalable vector graphics are much nicer for web pages than bitmaps. The
mklogo script can be removed and there is no more dependency on
ImageMagick. What a deal.
The new logo was made with vi. It is a bit smaller than the old logo
but looks similar.
|
| |\|
| |
| |
| | |
* master:
|
| | |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \ \
| | |/
| |/|
| | |
| | | |
* refs/heads/t/multiple-source-dirs:
create_rsync_argv(): Allocate correctly sized arg array.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \ \
| | |/
| |/|
| | |
| | |
| | | |
* master:
Remove stale comment.
Improve comment of snapshot_currently_being_removed.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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 *.
|
| | | |
| | |
| | |
| | | |
The old comment did not provide any information at all..
|
| |\ \ \
| | | |
| | | |
| | | | |
* refs/remotes/bthcx/next:
|
| | |\| |
| | |/
| |/|
| | |
| | | |
* master:
Add link to author homepage.
|
| |\ \ \
| |/ /
|/| /
| |/
| | |
* master:
Add link to author homepage.
|
| | |
| |
| |
| |
| | |
People who like dss might also be interested in other projects of
the author.
|
| |/
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Andre Noll <maan@tuebingen.mpg.de>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
scan-build correctly points out that the value stored to 'name'
is never read.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|