summaryrefslogtreecommitdiff
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.
* dss-1.0.2.v1.0.2Andre Noll2024-08-08
|
* New subcommand: help.Andre Noll2024-07-18
| | | | | It's sometimes handy to just type e.g. "dss help run" to see the synopsis and the options of the ls subcommand.
* Provide a static binary.Andre Noll2024-07-02
| | | | For users which can't be bothered to use git or compile from source.
* build: Move m4-only definitions to separate file.Andre Noll2024-07-02
| | | | | | | | | | | | | | | | | | We currently pass a number of variables to m4 by specifying command line options of the form -D var=val. This approach makes the output of "make V=1" very verbose due to the three multi-line descriptions. To addresses this issue, introduce defs.m4 which contains one m4 macro definition for each former make variable. The end result should be identical. We tweak the M4 make variable to always read defs.m4 before the first regular input file so that the suite and the web page see the definitions. The third user of the former make variables is the README phony target. To convert this as well, we rename the README file to README.m4 and adjust the rule of the README phony target to run m4 on this file. Switch to saner m4 quoting characters while at it.
* Move snapshot distribution explanation to separate man section.Andre Noll2024-07-02
| | | | | | | | | | | | Since the new section contains a table, we have to tell groff to run the tbl preprocessor to generate the html version of the man page. We now pass -I image to the groff postprocessor so that the png image file gets a predictable name. We'd love to pass --image‐directory=build/ to place the png file in the build directory, but this also creates html like <img src="build/image1.png">, which does not work because index.html is in build/. Change the cwd to the build directory to work around this.
* Add phony targets distclean and maintainer-clean.Andre Noll2024-07-02
| | | | | | With the patch applied, "make clean" keeps files generated by lopsub and m4, "make distclean" removes the build directory, and "make maintainer-clean" removes all untracked files except Makefile.local.
* index.html: Inline the svg image.Andre Noll2024-07-02
| | | | | | This way the web page can be installed by copying a single html file. It also speeds up page loading since no additional http request is needed to download the image file.
* build: New phony target "www".Andre Noll2024-07-02
| | | | | This saves some typing as the simple "make www" now builds index.html and the html version of the man page.
* build: Move recipe for index.html to proper place.Andre Noll2024-07-02
| | | | There's no reason for this to be after the README stuff.
* build: Generate intermediate files in build/.Andre Noll2024-07-02
| | | | | This way the intermediate files don't clobber the top level of the working directory. Also the clean phony target becomes simpler.
* index.html: Adjust font size for code.Andre Noll2024-07-02
| | | | | At least on some firefox versions, the characters of the default monospace font look a bit small.
* index.html: Right-justify the text.Andre Noll2024-07-02
| | | | This looks much better. We don't want that for table cells, though.
* index.html: Remove navigation menu.Andre Noll2024-07-02
| | | | | | The page has become simple enough, making the navigation links useless. The page no longer contains any <hr> tags, so remove the corresponding part of the style sheet.
* index.html: Inline style sheet.Andre Noll2024-07-02
| | | | | This should speed up page loading because it saves the additional http connection to the web server to download dss.css.
* No longer include NEWS in index.html.Andre Noll2024-07-02
| | | | | | | | | It's not like the dss project saw lots of news lately, and the old news items only clutter the web page. This removes the last invocation of markdown(1), making the build independent of the discount converter. We keep maintaining the NEWS file in the repo, however. It's just no longer part of the web page.
* index.html: Simplify make rule.Andre Noll2024-07-02
| | | | This avoids index.html.in and parses index.html.m4 only once.
* Kill INSTALL.Andre Noll2024-07-02
| | | | | | | | Move the installation instructions to index.html.m4 and the configuration bits to the new examples section of the man page. Streamline the installation instructions and recommend to install the debian package of lopsub.
* index.html: Move man page to separate web page.Andre Noll2024-07-02
| | | | | | This shortens index.html and simplifies the build because we can ditch the sed command which cuts out the body of the html generated by groff(1).
* index.html: Replace license section from index.html by simple link.Andre Noll2024-07-02
| | | | | No need to have a full section for a single sentence. Just add an item in the resource section which states the same information.
* Centralize meta information about dss.Andre Noll2024-07-02
| | | | | | | | | This defines a couple of package related variables in Makefile, renames dss.suite -> dss.suite.m4 and index.html.in -> index.html.m4, and tweaks the recipes to generate dss.suite and index.html.in from the m4 files, referring to these variables. The contents of the README file are moved into Makefile so that the three paragraphs can be printed with make README.
* Improve README.Andre Noll2024-07-02
| | | | | This streamlines the text to some extent, omitting the comparison to tape backups, which is not really interesting for most users.
* build: Compress the man page.Andre Noll2024-07-02
| | | | Run gzip with -n to make the build reproducible.
* Avoid rebuilds of lopsub-generated files.Andre Noll2024-07-02
| | | | | | Without having the .PRECIOUS special target depending on these, the files get removed after a successful build and a subsequent make run has to rebuild them.
* build: Use variables for lobsubgen, groff and rm commands.Andre Noll2024-07-02
|
* Make the build quiet by default.Andre Noll2024-07-02
| | | | | | | This teaches make(1) to give all lines of the recipe to a single shell invocation, speeding up the build and facilitating the simple SAY function to quieten the build. The old verbose output can still be obtained by running make V=1.
* build: Dynamic dependency creation and versioning.Andre Noll2024-07-02
| | | | | | | This gets rid of Makefile.deps in favor of one auto-generated .d file per .c file, and adds version-gen.sh, a shell script executed by make(1) which tries to determine the version number that is going to be incorporated into the executable via the generated version.c.
* Consult $HOME and $LOGNAME rather than calling getpwuid(),Andre Noll2024-06-26
| | | | | | | | | | | | Quiting getpwnam(3): An application that wants to determine its user’s home directory should inspect the value of HOME (rather than the value getpwuid(getuid())->pw_dir) since this allows the user to modify their notion of "the home directory" during a login session. The old behaviour of get_homedir() to return "/tmp" in the error case is misleading at best, so abort in this case.
* Kill COMPILE_TIME_LOGLEVEL.Andre Noll2024-06-26
| | | | | Nobody has ever used this, and the build gets never tested with non-default compile time loglevel, so...
* Compute ipc key only once.Andre Noll2024-05-23
| | | | | It's easier if dss.c passes the hash of the the config file path to the ipc functions than to pass a char pointer.
* Resolve config file path only once.Andre Noll2024-05-23
| | | | | | | | Currently we call get_config_file_name() before each call call to a public function of ipc.c because those functions compute the IPC key from the filename. This is unnecessary and caused several bugs. Clean up this mess by computing the filename only once and store it in a global variable.
* Use standard realpath(3).Andre Noll2024-05-23
| | | | | These days we may rely on the POSIX 2008 semantics of this function, so remove our open-coded version.
* Support local make files.Andre Noll2024-04-25
| | | | | | 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.
* Fix --config-file for relative paths.Andre Noll2023-11-07
| | | | | | | | | | | | | | | | | | | | | | 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.
* Avoid duplicate error message.Andre Noll2020-05-17
| | | | | | 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().
* dss-1.0.1.v1.0.1Andre Noll2019-11-08
|
* Merge branch 'refs/heads/t/prune'Andre Noll2019-11-07
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Introduce prune --disk-space.Andre Noll2019-09-21
| | | | | | | | | | | | | | 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.
| * 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.
| * Factor out find_removable_snapshot().Andre Noll2019-09-21
| | | | | | | | | | | | | | | | | | | | 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().
| * prune Simplify rm exit code logic.Andre Noll2019-09-21
| | | | | | | | | | We can rely on the fact that wait_for_remove_process() sets snapshot_removal_status to the correct value on success.
| * find_oldest_removable_snapshot(): Improve log message.Andre Noll2019-09-21
| | | | | | | | | | | | 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.
| * prune: Print a message if there is nothing to prune.Andre Noll2019-09-21
| | | | | | | | | | | | 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.
| * get_snapshot_list(): Add comment about sorting.Andre Noll2019-09-21
| | | | | | | | | | Callers rely on the returned snapshot list being sorted by creation time, so let's document this fact.
| * prune: Fail gracefully if pre-rm hook fails.Andre Noll2019-09-21
| | | | | | | | | | | | 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.
* | Merge branch 'refs/heads/t/svg-logo'Andre Noll2019-10-30
|\ \ | | | | | | | | | | | | | | | | | | | | | 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.
| * | Redo the logo as svg.Andre Noll2019-09-18
| |/ | | | | | | | | | | | | | | | | 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.
* | daemon_init(): Do not set umask to zero.Andre Noll2019-10-25
| | | | | | | | | | | | | | | | | | 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.
* | Fix logic to append slash to the source directory.Andre Noll2019-10-25
| | | | | | | | | | | | This bug was introduced recently in commit dd3f58c0bdf1 (create_rsync_argv(): Allocate correctly sized arg array) which redefined N.