Skip to content

Commit 6bbed5a

Browse files
committed
docs: further usage updates and clarifications
[skip ci]
1 parent c617863 commit 6bbed5a

File tree

2 files changed

+80
-45
lines changed

2 files changed

+80
-45
lines changed

USAGE.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,19 @@ and responsiveness.
3131

3232
# SETUP
3333

34-
`/etc/asd.conf` contains all user-managed settings. The configuration file
35-
location can be overridden by specifying a pathname in the `ASDCONF`
36-
environment variable. For instance, to load `asd` settings from
34+
The `asd` configuration file contains all user-managed settings. See the entry
35+
on `ASDCONF` in the [`ENVIRONMENT VARIABLES`](#environment-variables) section
36+
for information on the default `asd` configuration file location. The
37+
configuration file location can be overridden by specifying a pathname in the
38+
`ASDCONF` environment variable. For instance, to load `asd` settings from
3739
`/here/for/some/reason/lives/asd.conf`:
3840

3941
```shell-session
4042
$ ASDCONF=/here/for/some/reason/lives/asd.conf asd <subcommand>
4143
```
4244

43-
**Note** that edits made to `/etc/asd.conf` while `asd` is running will be
44-
applied only after `asd` has been restarted.
45+
**Note** that edits made to the `asd` configuration file while `asd` is running
46+
will be applied only after `asd` has been restarted.
4547

4648
In the `asd` configuration file, you may define the following variables:
4749

@@ -56,8 +58,10 @@ In the `asd` configuration file, you may define the following variables:
5658

5759
: A path that lives on a tmpfs or zram mount. This is where `asd` will store
5860
the data eventually synchronized back to the physical disk. By default,
59-
`asd` sets `VOLATILE=/tmp`. **Note** that it is a fatal error to set
60-
`VOLATILE` to a path that does not live on a tmpfs or zram mount.
61+
when running as `root` and `ASDNOV1PATHS` is unset or set to a false value,
62+
`asd` sets `VOLATILE=/tmp`. Otherwise, `VOLATILE` defaults to `ASDRUNDIR`.
63+
**Note** that it is a fatal error to set `VOLATILE` to a path that does not
64+
live on a tmpfs or zram mount.
6165

6266
`USE_OVERLAYFS`
6367

@@ -79,12 +83,12 @@ In the `asd` configuration file, you may define the following variables:
7983

8084
: A boolean variable controlling whether to issue debugging output.
8185

82-
**Note** that the default value of `/tmp` should work just fine for the
83-
`VOLATILE` setting. If using [`bleachbit`][BleachBit], do NOT invoke it with
84-
the `--clean system.tmp` switch or you will remove a key dot file (`.foo`) from
85-
`/tmp` that `asd` needs to keep track of sync status. Also note that using a
86-
value of `/dev/shm` can cause problems with systemd's `NAMESPACE` spawning only
87-
when users enable the OverlayFS option.
86+
**Note** that the default values of `/tmp`/`ASDRUNDIR` should work just fine
87+
for the `VOLATILE` setting. If using [`bleachbit`][BleachBit], do NOT invoke
88+
it with the `--clean system.tmp` switch or you will remove a key dot file
89+
(`.foo`) from `/tmp` that `asd` needs to keep track of sync status. Also note
90+
that using a value of `/dev/shm` can cause problems with systemd's `NAMESPACE`
91+
spawning only when users enable the OverlayFS option.
8892

8993
Example:
9094

@@ -110,33 +114,38 @@ WHATTOSYNC=(
110114

111115
`ASDCONF`
112116

113-
: Path to the `asd` configuration file. Defaults to `/etc/asd.conf` when
114-
`ASDNOV1PATHS` is disabled; otherwise, defaults to `${ASDCONFDIR}/asd.conf`.
117+
: Path to the `asd` configuration file. Defaults to `/etc/asd.conf` when `asd`
118+
is running as `root` and `ASDNOV1PATHS` is unset or set to a false value;
119+
otherwise, defaults to `${ASDCONFDIR}/asd.conf`.
115120

116121
`ASDNOV1PATHS`
117122

118123
: A boolean variable controlling whether to use "version 1" paths or not. When
119124
set to a false value, `asd` will use old-style defaults for its daemon file
120-
(`/run/asd`), lock file (`/run/asd-lock`), configuration file
121-
(`/etc/asd.conf`) . **NOTE** that this variable is
122-
ignored when `asd` is running as a non-`root` user. Defaults to disabled
123-
(effectively, `ASDNOV1PATHS=0`).
125+
(`/run/asd`), lock file (`/run/asd-lock`), and configuration file
126+
(`/etc/asd.conf`). **NOTE** that this variable is ignored when `asd` is
127+
running as a non-`root` user. Defaults to disabled (effectively,
128+
`ASDNOV1PATHS=0`).
124129

125130
`ASDCONFDIR`
126131

127132
: Parent directory of `asd.conf` if `ASDCONF` is not defined. Ignored when
128133
running as `root` and `ASDNOV1PATHS` is unset or set to a false value.
129-
Otherwise, defaults to `CONFIGURATION_DIRECTORY` (which is set when `asd`
130-
runs under systemd), falling back to `/etc/asd` when running as `root` and
131-
`${XDG_CONFIG_DIR}/asd` when running as a non-`root` user.
134+
Otherwise, defaults to the first (leftmost) of the colon-separated paths in
135+
the `CONFIGURATION_DIRECTORY` environment variable (which is set when `asd`
136+
runs under systemd and the `asd.service` unit defines at least one
137+
`ConfigurationDirectory` entry), falling back to `/etc/asd` when running as
138+
`root` and `${XDG_CONFIG_DIR}/asd` when running as a non-`root` user.
132139

133140
`ASDRUNDIR`
134141

135142
: Directory where `asd` should store runtime state. Ignored when running as
136143
`root` and `ASDNOV1PATHS` is unset or set to a false value. Otherwise,
137-
defaults to `RUNTIME_DIRECTORY` (which is set when `asd` runs under systemd),
138-
falling back to `/run/asd` when running as `root` and
139-
`${XDG_RUNTIME_DIR}/asd` when running as a non-`root` user.
144+
defaults to the first (leftmost) of the colon-separated paths in the
145+
`RUNTIME_DIRECTORY` (which is set when `asd` runs under systemd and the
146+
`asd.service` unit defines at least one `RuntimeDirectory` entry), falling
147+
back to `/run/asd` when running as `root` and `${XDG_RUNTIME_DIR}/asd` when
148+
running as a non-`root` user.
140149

141150
`ASDCONFTIMEOUT`
142151

@@ -360,6 +369,11 @@ Discover a bug? Please open an issue on the project page linked below.
360369
- Project page: https://github.com/graysky2/anything-sync-daemon
361370
- Wiki page: https://wiki.archlinux.org/index.php/Anything-sync-daemon
362371

372+
# SEE ALSO
373+
374+
`bash`(1), `cron`(8), `crontab`(1), `crontab`(5), `mount`(5),
375+
`systemd.exec`(5), `systemd.service`(5), `systemd.timer`(5), `systemd.unit`(5)
376+
363377
# AUTHOR
364378

365379
graysky (graysky AT archlinux DOT us)

doc/asd.1

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" Automatically generated by Pandoc 2.19.2
1+
.\" Automatically generated by Pandoc 3.1.6
22
.\"
33
.\" Define V font for inline verbatim, using C font in formats
44
.\" that render this, and otherwise B font.
@@ -45,7 +45,10 @@ is redirected from the physical disc to RAM, reducing wear to the
4545
physical disc and improving speed and responsiveness.
4646
.SH SETUP
4747
.PP
48-
\f[V]/etc/asd.conf\f[R] contains all user-managed settings.
48+
The \f[V]asd\f[R] configuration file contains all user-managed settings.
49+
See the entry on \f[V]ASDCONF\f[R] in the
50+
\f[V]ENVIRONMENT VARIABLES\f[R] section for information on the default
51+
\f[V]asd\f[R] configuration file location.
4952
The configuration file location can be overridden by specifying a
5053
pathname in the \f[V]ASDCONF\f[R] environment variable.
5154
For instance, to load \f[V]asd\f[R] settings from
@@ -57,9 +60,9 @@ $ ASDCONF=/here/for/some/reason/lives/asd.conf asd <subcommand>
5760
\f[R]
5861
.fi
5962
.PP
60-
\f[B]Note\f[R] that edits made to \f[V]/etc/asd.conf\f[R] while
61-
\f[V]asd\f[R] is running will be applied only after \f[V]asd\f[R] has
62-
been restarted.
63+
\f[B]Note\f[R] that edits made to the \f[V]asd\f[R] configuration file
64+
while \f[V]asd\f[R] is running will be applied only after \f[V]asd\f[R]
65+
has been restarted.
6366
.PP
6467
In the \f[V]asd\f[R] configuration file, you may define the following
6568
variables:
@@ -75,7 +78,10 @@ list, \f[V]asd\f[R] will complain and bail out.
7578
A path that lives on a tmpfs or zram mount.
7679
This is where \f[V]asd\f[R] will store the data eventually synchronized
7780
back to the physical disk.
78-
By default, \f[V]asd\f[R] sets \f[V]VOLATILE=/tmp\f[R].
81+
By default, when running as \f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is
82+
unset or set to a false value, \f[V]asd\f[R] sets
83+
\f[V]VOLATILE=/tmp\f[R].
84+
Otherwise, \f[V]VOLATILE\f[R] defaults to \f[V]ASDRUNDIR\f[R].
7985
\f[B]Note\f[R] that it is a fatal error to set \f[V]VOLATILE\f[R] to a
8086
path that does not live on a tmpfs or zram mount.
8187
.TP
@@ -97,8 +103,9 @@ keep.
97103
\f[V]DEBUG\f[R]
98104
A boolean variable controlling whether to issue debugging output.
99105
.PP
100-
\f[B]Note\f[R] that the default value of \f[V]/tmp\f[R] should work just
101-
fine for the \f[V]VOLATILE\f[R] setting.
106+
\f[B]Note\f[R] that the default values of
107+
\f[V]/tmp\f[R]/\f[V]ASDRUNDIR\f[R] should work just fine for the
108+
\f[V]VOLATILE\f[R] setting.
102109
If using \f[V]bleachbit\f[R] (https://www.bleachbit.org/), do NOT invoke
103110
it with the \f[V]--clean system.tmp\f[R] switch or you will remove a key
104111
dot file (\f[V].foo\f[R]) from \f[V]/tmp\f[R] that \f[V]asd\f[R] needs
@@ -133,34 +140,42 @@ WHATTOSYNC=(
133140
.TP
134141
\f[V]ASDCONF\f[R]
135142
Path to the \f[V]asd\f[R] configuration file.
136-
Defaults to \f[V]/etc/asd.conf\f[R] when \f[V]ASDNOV1PATHS\f[R] is
137-
disabled; otherwise, defaults to \f[V]${ASDCONFDIR}/asd.conf\f[R].
143+
Defaults to \f[V]/etc/asd.conf\f[R] when \f[V]asd\f[R] is running as
144+
\f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is unset or set to a false
145+
value; otherwise, defaults to \f[V]${ASDCONFDIR}/asd.conf\f[R].
138146
.TP
139147
\f[V]ASDNOV1PATHS\f[R]
140148
A boolean variable controlling whether to use \[lq]version 1\[rq] paths
141149
or not.
142-
When set to a false value, \f[B]FIXME\f[R].
150+
When set to a false value, \f[V]asd\f[R] will use old-style defaults for
151+
its daemon file (\f[V]/run/asd\f[R]), lock file
152+
(\f[V]/run/asd-lock\f[R]), and configuration file
153+
(\f[V]/etc/asd.conf\f[R]).
143154
\f[B]NOTE\f[R] that this variable is ignored when \f[V]asd\f[R] is
144155
running as a non-\f[V]root\f[R] user.
145156
Defaults to disabled (effectively, \f[V]ASDNOV1PATHS=0\f[R]).
146157
.TP
147158
\f[V]ASDCONFDIR\f[R]
148159
Parent directory of \f[V]asd.conf\f[R] if \f[V]ASDCONF\f[R] is not
149160
defined.
150-
Ignored when running as \f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is set
151-
to a false value.
152-
Otherwise, defaults to \f[V]CONFIGURATION_DIRECTORY\f[R] (which is set
153-
when \f[V]asd\f[R] runs under systemd), falling back to
154-
\f[V]/etc/asd\f[R] when running as \f[V]root\f[R] and
161+
Ignored when running as \f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is
162+
unset or set to a false value.
163+
Otherwise, defaults to the first (leftmost) of the colon-separated paths
164+
in the \f[V]CONFIGURATION_DIRECTORY\f[R] environment variable (which is
165+
set when \f[V]asd\f[R] runs under systemd and the \f[V]asd.service\f[R]
166+
unit defines at least one \f[V]ConfigurationDirectory\f[R] entry),
167+
falling back to \f[V]/etc/asd\f[R] when running as \f[V]root\f[R] and
155168
\f[V]${XDG_CONFIG_DIR}/asd\f[R] when running as a non-\f[V]root\f[R]
156169
user.
157170
.TP
158171
\f[V]ASDRUNDIR\f[R]
159172
Directory where \f[V]asd\f[R] should store runtime state.
160-
Ignored when running as \f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is set
161-
to a false value.
162-
Otherwise, defaults to \f[V]RUNTIME_DIRECTORY\f[R] (which is set when
163-
\f[V]asd\f[R] runs under systemd), falling back to \f[V]/run/asd\f[R]
173+
Ignored when running as \f[V]root\f[R] and \f[V]ASDNOV1PATHS\f[R] is
174+
unset or set to a false value.
175+
Otherwise, defaults to the first (leftmost) of the colon-separated paths
176+
in the \f[V]RUNTIME_DIRECTORY\f[R] (which is set when \f[V]asd\f[R] runs
177+
under systemd and the \f[V]asd.service\f[R] unit defines at least one
178+
\f[V]RuntimeDirectory\f[R] entry), falling back to \f[V]/run/asd\f[R]
164179
when running as \f[V]root\f[R] and \f[V]${XDG_RUNTIME_DIR}/asd\f[R] when
165180
running as a non-\f[V]root\f[R] user.
166181
.TP
@@ -403,6 +418,12 @@ if a hung process has something open there, it can be messy.
403418
Project page: https://github.com/graysky2/anything-sync-daemon
404419
.IP \[bu] 2
405420
Wiki page: https://wiki.archlinux.org/index.php/Anything-sync-daemon
421+
.SH SEE ALSO
422+
.PP
423+
\f[V]bash\f[R](1), \f[V]cron\f[R](8), \f[V]crontab\f[R](1),
424+
\f[V]crontab\f[R](5), \f[V]mount\f[R](5), \f[V]systemd.exec\f[R](5),
425+
\f[V]systemd.service\f[R](5), \f[V]systemd.timer\f[R](5),
426+
\f[V]systemd.unit\f[R](5)
406427
.SH AUTHOR
407428
.PP
408429
graysky (graysky AT archlinux DOT us)

0 commit comments

Comments
 (0)