| Commit message (Collapse) | Author | Age |
| ... | |
| | | |
|
| | | |
|
| | |
| |
| |
| | |
No biggy since we exit anyway a few lines later, but still..
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Quite a few public functions of tv.c are not used anywhere in dss,
so let's get rid of them. We can easily add them back in case they
are neeed in the future.
Found by cppcheck.
|
| | |
| |
| |
| |
| |
| |
| | |
The variable p is initialized to a different value a few lines later
and the value set in the definition is not used in between.
Found by cppcheck.
|
| |/
|
|
|
|
|
| |
It's nice to have references to ssh and rsync in the SEE ALSO section
of the man page. On the web page, however, they do not add much value
since the links generated by man2html do not work. This patch omits
the broken links.
|
| | |
|
| |
|
|
| |
The old colors looked a little like the 90s ;)
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently dss cowardly refuses to remove the last complete snapshot
even if disk space is low, and fails if there is not enough disk space
left for a second snapshot. However, in some situations it is more
important to have a recent snapshot and to to keep dss up and running.
This commit introduces a new integer option, --min-complete, which
defaults to one to resemble the old behaviour.
If it is set to zero, dss will happily remove the last complete
snapshot, even if it is used as the reference directory for rsync's
--link-dest option. This is dangerous, but it's the only way to keep
dss going.
Conversely, --min-complete may be set to a value greater than one
to guarantee there is always a certain number of complete snapshots
available.
|
| | |
| |
| |
| | |
The generated html looked terrible. No real changes.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Apparently the symlink workaround for the gitweb pages on
git.tuebingen.mpg.de does not work any more although the symlink
dss->dss.git is still in place.
This commit changes the link on the web page to include the .git
suffix.
|
| |/
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
The -Wno-sign-compare option is supposed to not print the noisy
warnings for comparisons between signed and unsigned values.
Currently, in DEBUG_CFLAGS this option is followed by -W which causes
clang (but not gcc) to turn on these warnings again. As CFLAGS contains
-Wall, the -W option was redundant anyway, so this patch removes it.
|
| | |
|
| |\
| |
| |
| | |
Was cooking since 2013-10.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If dss is about to die because it received SIGINT or SIGTERM, we first
restart the rsync process by sending SIGCONT, then send SIGTERM to
both the rsync and the rm process to get rid of any child processes.
This works fine, but there are other fatal errors for which we miss
to clean up as thoroughly, most importantly if there is not enough
free disk space for a single snapshot.
This patch moves the signal-related cleanup part to the new function
kill_children(), and changes handle_signal() and com_run() to call
this function right before the exit hook is invoked.
|
| | | |
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
The single commit of this branch is more than one year old. I totally
forgot about it, but here it is:
311ec5 Switch logo from skencil to dia.
The web page has been updated to contain the new image.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The sketch/skencil project appears to be inactive for years, and
it is no longer shipped on recent Linux distributions. This commit
replaces the sketch source file dss.sk by dss.dia, a source file for
dia, an GTK+ based diagram creation program. The new logo looks very
similar to the old one but was created from scratch.
dia allows to convert a .dia file to PNG image data. This patch also
adjusts the Makefile to produce the dss.png logo from dss.dia.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When running in daemon mode, the stdout and stderr stream of dss and
all its child processes are redirected to /dev/null. In particular any
output from the rsync process is discarded. Therefore, whenever a new
snapshot is created, dss currently passes --quiet to the underlying
rsync command, along with --archive and --delete.
However, as was pointed out by Sebastian Schultheiß, if the rsync
command fails for unknown reasons, the --quiet option complicates
debugging for the questionable benefit of saving the I/O for a few
writes to /dev/null.
This patch removes the --quiet option.
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This can only happen if all of the follwing are true:
(a) source and destination directories are small
(b) rsync completes successfully within one second
(c) At most two snapshots are missing
In this case the rename() call which changes the snapshot name from
*-incomplete to the proper name fails for the second snapshot with
EEXIST. This is because the previous snapshot name coincides with
the name of the second snapshot.
The fix is a bit ugly but also non-invasive and simple: Just sleep
one second in this case.
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Nobody needs more than 2^30 snapshots. More importantly, values
larger than 32 for --num_intervals cause an integer overflow in
desired_number_of_snapshots() because the number of snapshots in
interval zero does not fit in an unsigned int in this case.
This patch adds a test to check_config() that rejects values larger
than 30 for the --num_intervals option.
Many thanks to Klaus Kopec for pointing out this bug.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
This replaces the C99-only initializations in mutex_lock() and
mutex_try_lock() by equivalent but portable code.
|
| | |
| |
| |
| |
| | |
This is both to ensure function signature consistency, and to
eliminate GCC's "no previous declaration for _____" warnings.
|
| |/
|
|
| |
It is not used outside the source file in which it is defined.
|
| |\
| |
| |
| | |
* e1f886 Only define gcc function attributes on gcc.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
These gcc extensions help the compiler optimize function calls,
but are unavailable if dss is not compiled with gcc.
This patch defines the corresponding macros to empty if __GNUC__
is not defined, or if the gcc version is too old to support the
particular function attribute.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The changes in this branch are an attempt to make dss compile cleanly
with the more strict compiler flags (GCC 4.6 on Linux).
-pedantic -fno-common -W -Wall -Wcast-align -Wformat=2
-Wpointer-arith -Wundef -Waggregate-return -Wcast-qual
-Wmissing-declarations -Wnested-externs -Wstrict-prototypes
This is only a first step that addresses the easier warnings. Some,
like the ones stemming from the variadic macros, have yet to be fixed.
* 9e6c2f Remove some debug messages.
* 899f88 string.c: Fix a statement-before-declaration issue.
* 83ebb4 Remove trailing commas.
* 2ed0d7 snap.h: Fix HSA_ITEM.
* 508350 Fix "comma after last element" warning.
* 97fbf4 compare_snapshots(): Add const keyword.
* b28495 Avoid per-element initializers.
* 9528cf dss.c: Fix initialization of argv[].
* 4526f9 dss.c: Remove redundant const.
* 2183c6 Makefile: Split CPPFLAGS.
Conflicts:
error.h
|
| | | |
| | |
| | |
| | |
| | | |
These were only helpful during development and are commented out
for quite some time now. Remove them.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
This changes the second definition of HSA_ITEM to avoid C99
subscripted element initializers.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This changes the definition of DSS_ERRORS so that it includes the commas,
and removes the comma from both definitions of DSS_ERROR. This
avoids "comma after last element" warnings, which on some compilers
produces an error.
|
| | | |
| | |
| | |
| | | |
This fixes a "cast drops const qualifier" warning.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Per-element struct initializers are not supported in ANSI C. This
construct doesn't gain much in terms of readability, and breaks
compatibility with older/stricter compilers.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
argv[] can't be declared in this way because the initializers are not
computable at compile time. GCC allows this construct, but stricter
compilers don't.
|
| | | |
| | |
| | |
| | | |
hook_status_description[] had a redundant const keyword, per GCC.
|
| | |/
| |
| |
| |
| | |
-W*/-O*/-g options belong in CFLAGS, not CPPFLAGS. CPPFLAGS is for
preprocessor-specific (-D*/-I*) options.
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
4d9f41 mutex_get(): Change parameter from key_t to int.
55c90e Implement --reload.
492928 Add the --kill subcommand.
dd42f7 Use semaphore locking to avoid starting dss multiple times.
17eea8 Introduce get_config_file_name().
That topic was cooking in next for a quite some time now.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The two callers obtain the key from get_key_or_die(), which
returns int. So pass an int anyway. This fixes a warning on
NetBSD:
ipc.c:263: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'key_t'
|
| | |
| |
| |
| |
| | |
This is literally the same as --kill, the only difference being that
SIGHUP rather than SIGTERM is sent.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It works as follows: Whenever a semaphore operation is performed, the
PID of the process is stored in the sempid field of the semaphore.
This PID can be obtained from a different process by calling semctl
with the GETPID command.
com_kill() first tries to acquire the lock by calling the new
mutex_try_lock() function of ipc.c. In contrast to mutex_lock(),
mutex_try_lock() only operates on the first semaphore in the semaphore
set, leaving the sempid field of the second semaphore unchanged. If
mutex_try_lock() succeeds, no running dss process is holding the lock
and the kill command fails. Otherwise, some dss process is running
whose PID can be obtained by calling semctl() on the second semaphore.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's trickier than one might expect but it is hopefully also much
better than any pidfile-based approach.
This patch adds ipc.c and ipc.h containing the public lock_dss()
function which acquires a semaphore-based lock whose key is based
on the hash of the resolved path name of the dss config file. This
allows different instances of dss to coexist.
All semaphore operations are called with both the SEM_UNDO and the
IPC_NOWAIT flag. SEM_UNDO guarantees that no stale lock remains after
dss was killed by SIGKIlL while IPC_NOWAIT makes the call to lock_dss()
fail if another process is already holding the lock.
The prune/create/run commands simply take the lock at startup and
exit if it could not be acquired.
The underlying semaphore set contains two semaphores. This is necessary
to implement the --kill subcommand which is done in a subsequent patch.
|
| | |
| |
| |
| |
| |
| | |
ATM, the config file name is computed in parse_config(). However, for the ipc
stuff we'll need that information as well, so move the computation to a separate
helper function().
|
| | |
| |
| |
| | |
This inline function is unused.
|