Commit graph

137 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 4b743d679b man: try to explain different actions in tmpfiles a bit better
- do not suggest that vendor configuration files should be in
  /etc, use /usr/lib/tmpfiles.d instead
- split the first example, because the text talked about "needing
  two directories", but then a smack attribute was also set, and
  on a different path, which looked like a typo. Replace that
  with the example from original patch [1] which added 't'.
- fix the example for /var/tmp/abrt. The 'x' line was redundant,
  because /var/tmp/abrt/* is already filtered because "d /var/tmp/abrt"
  overrides "d /var/tmp".

[1] http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/25051
2016-04-20 09:00:39 -04:00
Jan Synacek b908bb63c4 man/tmpfiles.d: add note about permissions and ownership of symlinks
...because this is might not be obvious.
2016-01-13 08:41:54 +01:00
Jakub Wilk 7f3fdb7f19 man: fix typos 2015-12-26 20:37:17 +01:00
Lennart Poettering 2904e949f2 tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subvolume
It's not a good idea to create subvolumes for parts of the OS tree (such
as /home, or /var) if the root directory is not a subvolume too. We
shouldn't assume control of "heavier" objects such as subvolumes, if the
originating object (the root directory) is a "light-weight" object, i.e.
a plain directory.

Effectively this means that chroot() environments that are run on a
plain directory do not have to deal with problems around systemd
creating subvolumes that cannot be removed with a simple "rm" anymore.
However, if the chroot manager creates a proper subvolume for such an
environment it will also get further subvolumes placed in there, under
the assumption that the manager understands the concept of subvolumes in
that case.
2015-11-16 15:25:42 +01:00
Jan Engelhardt a8eaaee72a doc: correct orthography, word forms and missing/extraneous words 2015-11-06 13:45:21 +01:00
Jan Engelhardt b938cb902c doc: correct punctuation and improve typography in documentation 2015-11-06 13:00:02 +01:00
kayrus c30c611ce3 Fixed link to chattr man page 2015-11-03 14:39:47 +01:00
Lennart Poettering 5fb13eb51b tmpfiles: introduce "q" and "Q" for creating quota-enabled btrfs subvolumes
This allows us to set up the quota group hierarchy in a reasonable way
on btrfs file systems.
2015-10-22 01:59:25 +02:00
Evgeny Vereshchagin 9d261cbdbe man: tmpfiles.d: add info about age field
The age field applies to lines starting with `v`, `C`, `X` too.
See the function `clean_item` in the file `src/tmpfiles/tmpfiles.c`
2015-10-19 13:34:31 +00:00
Tom Gundersen 12b42c7667 man: revert dynamic paths for split-usr setups
This did not really work out as we had hoped. Trying to do this upstream
introduced several problems that probably makes it better suited as a
downstream patch after all. At any rate, it is not releaseable in the
current state, so we at least need to revert this before the release.

 * by adjusting the path to binaries, but not do the same thing to the
   search path we end up with inconsistent man-pages. Adjusting the search
   path too would be quite messy, and it is not at all obvious that this is
   worth the effort, but at any rate it would have to be done before we
   could ship this.

 * this means that distributed man-pages does not make sense as they depend
   on config options, and for better or worse we are still distributing
   man pages, so that is something that definitely needs sorting out before
   we could ship with this patch.

 * we have long held that split-usr is only minimally supported in order
   to boot, and something we hope will eventually go away. So before we start
   adding even more magic/effort in order to make this work nicely, we should
   probably question if it makes sense at all.
2015-06-18 19:47:44 +02:00
Filipe Brandenburger 681eb9cf2b man: generate configured paths in manpages
In particular, use /lib/systemd instead of /usr/lib/systemd in distributions
like Debian which still have not adopted a /usr merge setup.

Use XML entities from man/custom-entities.ent to replace configured paths while
doing XSLT processing of the original XML files. There was precedent of some
files (such as systemd.generator.xml) which were already using this approach.

This addresses most of the (manual) fixes from this patch:
http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/patches/Fix-paths-in-man-pages.patch?h=experimental-220

The idea of using generic XML entities was presented here:
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032240.html

This patch solves almost all the issues, with the exception of:
- Path to /bin/mount and /bin/umount.
- Generic statements about preference of /lib over /etc.

These will be handled separately by follow up patches.

Tested:
- With default configure settings, ran "make install" to two separate
  directories and compared the output to confirm they matched exactly.
- Used a set of configure flags including $CONFFLAGS from Debian:
  http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/rules
  Installed the tree and confirmed the paths use /lib/systemd instead of
  /usr/lib/systemd and that no other unexpected differences exist.
- Confirmed that `make distcheck` still passes.
2015-05-28 19:28:19 +02:00
Lennart Poettering 6d785b6d07 man: elaborate on the order by which tmpfiles operations are executed 2015-04-22 18:24:47 +02:00
Lennart Poettering 1ae705fb3d man: slightly fewer paragraphs can help readability 2015-04-13 15:23:53 +02:00
Lennart Poettering bd1100898d man: fix examples indentation in tmpfiles.d(5) 2015-04-13 15:23:52 +02:00
Lennart Poettering 0ac0b1e720 man: add information about more lines to explanation of argument field 2015-04-13 15:23:52 +02:00
Lennart Poettering 6a9171d2ec man: document which tmpfiles line types follow symlinks
Generally, we will not follow symlinks, except for "w".

Avoid documentation for now for fifo, device node, directory lines,
which currently follow symlinks but better shouldn't.
2015-04-13 15:23:52 +02:00
Goffredo Baroncelli fa3f5fd2d3 man: add h/H to tmpfiles.d(5) 2015-03-19 22:23:01 -04:00
daurnimator 657cf7f4f8 tmpfiles: port to unquote_many_words() 2015-03-10 16:08:20 +01:00
Zbigniew Jędrzejewski-Szmek 00c53f4283 man: explain time units in tmpfiles
https://bugzilla.redhat.com/show_bug.cgi?id=1195294
2015-02-23 20:08:05 -05:00
Zbigniew Jędrzejewski-Szmek dd4105b0a9 shared/acl-util: add mask only when needed, always add base ACLs
For ACLs to be valid, a set of entries for user, group, and other
must be always present. Always add those entries.

While at it, only add the mask ACL if it is actually required, i.e.
when at least on ACL for non-owner group or user exists.
2015-01-22 01:14:53 -05:00
Zbigniew Jędrzejewski-Szmek 50d9e46dbb tmpfiles: implement augmenting of existing ACLs
This is much more useful in practice (equivalent to setfacl -m).
2015-01-22 01:14:53 -05:00
Zbigniew Jędrzejewski-Szmek b705ab6a83 tmpfiles: make t and a globby, add their recursive versions T and A
For types which adapt existing files it is generally more useful to accept
globs.

In analogy to z and Z, add recursive versions using uppercase letters.

Technically, making a accept globs is backwards incompatible, but in
practice it probably isn't yet widely used and we can assume that most
people don't create files with wildcards in names.

Functions which are used as callbacks, but not directly on items, are
renamed not to have "item_" prefix.
2015-01-22 01:14:53 -05:00
Zbigniew Jędrzejewski-Szmek f8eeeaf9b7 tmpfiles: add 'a' type to set ACLs 2015-01-22 01:14:53 -05:00
Zbigniew Jędrzejewski-Szmek 3f93da9879 tmpfiles: attach an array of items to each path
The data structure used by tmpfiles is changed: instead of hashmaps
mapping {path → Item*} we now have hashmaps containing
{path -> ItemArray}, where ItemArray contains a pointer
to an array of Items.

For current code it doesn't matter much, but when we add new types it
is easier to simply add a new Item for a given path, then to coalesce
multiple lines into one Item.

In the future, this change will also make it possible to remember the
file and line where each Item originates, and use that in reporting
errors. Currently this is not possible, since each Item can be created
from multiple lines.
2015-01-22 01:14:53 -05:00
Zbigniew Jędrzejewski-Szmek 302fbdf29e man: reindent tmpfiles.d(5)
Reindent to 2 spaces, use more markup.
2015-01-18 19:06:48 -05:00
Lennart Poettering d7b8eec7dc tmpfiles: add new line type 'v' for creating btrfs subvolumes 2014-12-28 02:08:40 +01:00
Maciej Wereski ebf4e8013b tmpfiles, man: Add xattr support to tmpfiles
This patch makes it possible to set extended attributes on files created
by tmpfiles. This can be especially used to set SMACK security labels on
volatile files and directories.

It is done by adding new line of type "t". Such line should contain
attributes in Argument field, using following format:

name=value

All other fields are ignored.

If value contains spaces, then it must be surrounded by quotation marks.
User can also put quotation mark in value by escaping it with backslash.

Example:
D /var/run/cups - - - -
t /var/run/cups - - - - security.SMACK64=printing
2014-12-04 20:21:45 +01:00
Jan Synacek ff8d1aba53 man/tmpfiles.d: fix typo 2014-11-04 20:00:31 +01:00
Tom Gundersen 1dfcee5985 man: tmpfiles.d - recommend using b! and c!
We should avoid creating static device nodes at runtime.
2014-10-27 17:40:24 +01:00
Jan Engelhardt 45df8656eb doc: typographical improvements and choice of words 2014-06-28 00:06:31 -04:00
Jan Engelhardt 8d0e0ddda6 doc: grammatical corrections 2014-06-28 00:06:30 -04:00
Kay Sievers 2f3b873a49 tmpfiles: copy/link /usr/share/factory/ files when the source argument is omitted 2014-06-20 15:57:43 +02:00
Lennart Poettering e156347e04 tmpfiles: make sure "C" doesn't copy anything if the destination already exists
Previously it would recursively copy the entire tree in, and descend
into subdirectories even if the destination already exists. Let's do
what the documentation says and not do that.

If files down the tree shall be copied too, they should get their own
"C" lines.
2014-06-19 19:36:08 +02:00
Lennart Poettering 1554afae54 tmpfiles: add "+" modifier support to b, c, p lines in addition to L 2014-06-18 00:09:46 +02:00
Lennart Poettering 2e78fa79bb tmpfiles: add new "L+" command as stronger version of "L", that removes the destination before creating a symlink
Also, make use of this for mtab as long as mount insists on creating it
even if we invoke it with "-n".
2014-06-16 13:21:07 +02:00
Lennart Poettering abef3f91ce tmpfiles: add ability to mask access mode by pre-existing access mode on files/directories
This way it makes a lot more sense to specify an access mode for "Z"
lines.
2014-06-11 10:14:07 +02:00
Lennart Poettering 1910cd0e05 tmpfiles: when processing lines, always process prefixes before suffixes
If two lines refer to paths that are suffix and prefix of each other,
then always process the prefix first, the suffix second. In all other
cases strictly process rules in the order they appear in the files.

This makes creating /var/run as symlink to /run a lot more fun, since it
is automatically created first.
2014-06-11 01:37:35 +02:00
Lennart Poettering e73a03e059 tmpfiles: get rid of "m" lines, make them redundant by "z"
"m" so far has been a non-globbing version of "z". Since this makes it
quite redundant, let's get rid of it. Remove "m" from the man pages,
beef up "z" docs instead, and make "m" nothing more than a compatibility
alias for "z".
2014-06-10 23:42:16 +02:00
Lennart Poettering 849958d1ba tmpfiles: add new "C" line for copying files or directories 2014-06-10 23:02:40 +02:00
Jan Engelhardt b8bde11658 doc: comma placement corrections and word order
Set commas where there should be some.
Some improvements to word order.
2014-05-07 20:13:27 -04:00
Lennart Poettering e66cf1a3f9 core: introduce new RuntimeDirectory= and RuntimeDirectoryMode= unit settings
As discussed on the ML these are useful to manage runtime directories
below /run for services.
2014-03-03 17:55:32 +01:00
Zbigniew Jędrzejewski-Szmek 41a55c46ab Replace /var/run with /run in remaining places
/run was already used almost everywhere, fix the remaining places
for consistency.
2014-02-25 20:41:24 -05:00
Lennart Poettering 9fccdb0f64 man: always place <programlisting> and </programlisting> in a line with actual sources, so that we don't get spurious newlines in the man page output 2014-02-14 15:56:19 +01:00
Lennart Poettering 82adf6af7c nspawn,man: use a common vocabulary when referring to selinux security contexts
Let's always call the security labels the same way:

  SMACK: "Smack Label"
  SELINUX: "SELinux Security Context"

And the low-level encapsulation is called "seclabel". Now let's hope we
stick to this vocabulary in future, too, and don't mix "label"s and
"security contexts" and so on wildly.
2014-02-10 13:18:16 +01:00
Zbigniew Jędrzejewski-Szmek 8181565124 tmpfiles: rename --unsafe to --boot
As suggested by Kay, it is better to describe what is done,
not what might happen.
2013-12-30 13:01:27 -05:00
Jan Engelhardt 494a668218 man: resolve word omissions
This is a recurring submission and includes corrections to:
word omissions and word class choice.
2013-12-25 22:53:45 -05:00
Zbigniew Jędrzejewski-Szmek c4708f1323 tmpfiles: introduce the concept of unsafe operations
Various operations done by systemd-tmpfiles may only be safely done at
boot (e.g. removal of X lockfiles in /tmp, creation of /run/nologin).
Other operations may be done at any point in time (e.g. setting the
ownership on /{run,var}/log/journal). This distinction is largely
orthogonal to the type of operation.

A new switch --unsafe is added, and operations which should only be
executed during bootup are marked with an exclamation mark in the
configuration files. systemd-tmpfiles.service is modified to use this
switch, and guards are added so it is hard to re-start it by mistake.

If we install a new version of systemd, we actually want to enforce
some changes to tmpfiles configuration immediately. This should now be
possible to do safely, so distribution packages can be modified to
execute the "safe" subset at package installation time.

/run/nologin creation is split out into a separate service, to make it
easy to override.

https://bugzilla.redhat.com/show_bug.cgi?id=1043212
https://bugzilla.redhat.com/show_bug.cgi?id=1045849
2013-12-24 15:48:06 -05:00
Zbigniew Jędrzejewski-Szmek ef72c1f06e man,units: tmpfiles.d(5) cleanup
Condition for /lib (necessary for split /usr) was missing from the unit.

Some changes which were done in tmpfiles.d(5) were not carried over to
systemd-tmpfiles(1).

Also use markup where possible.
2013-12-24 15:48:06 -05:00
Jan Engelhardt 72f4d9669c man: wording and grammar updates
This is a recurring submission and includes corrections to various
issue spotted. I guess I can just skip over reporting ubiquitous comma
placement fixes…
2013-10-15 08:19:49 -04:00
Václav Pavlín e776c8cfcd man: Improve the description of parameter X in tmpfiles.d page 2013-10-03 15:49:03 +02:00
Lennart Poettering 265ffa1e05 tmpfiles: add a new "m" line type that adjusts user/group/mode of a file if it exists 2013-09-17 16:55:37 -05:00
Lennart Poettering 1731e34a4e tmpfiles: support simple specifier expansion for specified paths 2013-09-17 11:02:54 -05:00
Jan Engelhardt 7964042405 man: wording and grammar updates
This is a recurring submission and includes corrections to various
issue spotted. I guess I can just skip over reporting ubiquitous
comma placement fixes…

Highligts in this particular commit:
- the "unsigned" type qualifier is completed to form a full type
  "unsigned int"
- alphabetic -> lexicographic (that way we automatically define how
  numbers get sorted)
2013-09-12 22:09:57 +02:00
Kay Sievers 7b4977254c man: fix description of file order application 2013-09-12 04:01:20 +02:00
Lukas Nykryn 1e44448168 man: one more example in tmpfiles.d 2013-09-10 18:51:43 +02:00
Jan Engelhardt 6b4991cfde man: wording and grammar updates
This includes regularly-submitted corrections to comma setting and
orthographical mishaps that appeared in man/ in recent commits.

In this particular commit:
- the usual comma fixes
- expand contractions (this is prose)
2013-09-10 18:34:41 +02:00
Jason St. John e9dd9f9547 man: improve grammar and word formatting in numerous man pages
Use proper grammar, word usage, adjective hyphenation, commas,
capitalization, spelling, etc.

To improve readability, some run-on sentences or sentence fragments were
revised.

[zj: remove the space from 'file name', 'host name', and 'time zone'.]
2013-07-02 23:06:22 -04:00
Michal Sekletar 78a92a5a23 tmpfiles: introduce type X
Type X will exclude path itself from clean-up. However, if the path is a
directory systemd-tmpfiles will clean-up its content.

In contrast to type x, where path is ignored completely, type X needs some
Age parameter. In order to determine Age parameter, we will look for config
entries of type d or D and pick the best match.  Best match is either
exact match or longest prefix match.
2013-01-25 10:38:46 -05:00
Thomas Hindoe Paaboel Andersen bb31a4ac19 man: typo fixes
https://bugs.freedesktop.org/show_bug.cgi?id=55890

Fixed typos, serial comma, and removed "either" as there were more
than two options. Also did an extra rename of "system-shutdown"
to "systemd-shutdown" that was forgotten in commit
8bd3b8620c
2012-10-26 00:16:47 +02:00
Tom Gundersen ef44ed4e2d man: fix typo in tmpfiles.d
Reported-by: Jason St. John <jstjohn@purdue.edu>
2012-10-23 22:15:05 +02:00
Tom Gundersen a2558205f7 tmpfiles: allow Age to be set to 0
Mostly useful for testing purposes. Setting Age to 1s works just as
well, but it is surprising that using 0s (or just 0) does not work.

Also clarify this in the documentation.
2012-10-23 21:53:20 +02:00
Dave Reisner 54693d9bfa tmpfiles: use write(2) for the 'w' action
This resolves problems with filesystems which do not implement the
aio_write file operation. In this case, the kernel will fall back using
a loop writing technique for each pointer in a received iovec. The
result is strange errors in dmesg such as:

[   31.855871] elevator: type  not found
[   31.856262] elevator: switch to
[   31.856262]  failed

It does not make sense to implement a synchronous aio_write method for
sysfs as this isn't a real filesystem where a reasonable use case for
using writev exists, nor is there an expectation that tmpfiles will be
used to write more data than can be reasonably written in a single write
syscall.

In addition, some sysfs attrs are currently buggy and will NOT reject
the second write with the newline, causing the sysfs value to be zeroed
out. This of course should be fixed in the kernel regardless of any
wrongdoing in userspace, but this simple change makes us immune to such
a bug.

This change means that we do not write a trailing newline by default, as
the expected use case of 'w' is for sysfs and procfs. In exchange, honor
C-style backslash escapes so that if the newline is really needed, the
user can add it.
2012-09-16 17:18:04 +02:00
Dave Reisner d4e9eb91ea tmpfiles: support globbing for w option
Break out the write logic into a separate function and simply use it as
a callback to glob_item.

This allows users to consolidate writes to sysfs with multiple similar
pathnames, e.g.

  w /sys/class/block/sd[a-z]/queue/read_ahead_kb - - - - 1024
2012-09-12 08:46:03 +02:00
Paul Menzel 1532449274 man/tmpfiles.d.xml: Add missing full stop 2012-07-09 15:57:58 +02:00
Lennart Poettering 75945badd2 man: add reference to systemd-delta to tmpfiles 2012-06-27 16:30:57 +02:00
Lennart Poettering 24f3a374b9 tmpfiles: exclude the first level directories in /run/user from automatic clean up
It's logind's job to maintain those user dirs, so avoid automatic clean
up for them. However, we do cover everything within them.
2012-06-20 09:05:50 +02:00
Kay Sievers 0e25e94ea7 man: replace tabs with spaces 2012-06-10 18:32:11 +02:00
Kay Sievers 6110885c2c man: systemd-tmpfiles - document proper config-file-stack order 2012-06-10 18:26:11 +02:00
Lennart Poettering 5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Lennart Poettering fc1a2e06a2 conf: when looking for configurations look in /etc first, in /run second
After long consideration we came to the conclusion that user
configuration in /etc should always override the (generally computer
generated) configuration in /run. User configuration should always be
what matters over anything else. Hence rearrange the search orders
accordingly.

In general this should change very little as overriding like this is
seldomn done so far, and the order between /etc and /usr stays the same.
2012-03-14 14:25:05 +01:00
Lennart Poettering 669e49fe2c man: reword tmpfiles selinux bits 2012-03-12 21:51:39 +01:00
Lennart Poettering 31ed59c511 tmpfiles: support writing short strings to files, in order to support /sys manipulations at boot time, a la sysctl 2012-01-18 16:39:04 +01:00
Lennart Poettering 468d726bdd tmpfiles: add support for creating symlinks, char/block device nodes 2012-01-18 13:56:02 +01:00
Michal Schmidt 777b87e702 tmpfiles: add 'z', like 'Z' but not recursive 2011-12-16 18:27:35 +01:00
Michal Schmidt 062e01bbdb tmpfiles: apply chown, chmod for 'Z' entries too
If changing ownership or permissions is not desired, they can be
configured to '-' or omitted entirely.
2011-12-16 18:04:54 +01:00
Michal Schmidt a37b560a63 man: mention that 'Z' ignores uid/gid/mode 2011-12-16 00:38:22 +01:00
Michal Schmidt 462d63db06 man: document 'Z' in tmpfiles 2011-12-16 00:31:21 +01:00
Lennart Poettering ee17ee7c5c tmpfiles: allow creation of named pipes with tmpfiles 2011-07-12 03:56:56 +02:00
Kay Sievers 772f83719e tmpfiles.d: switch to stacked config dirs in /lib, /etc, /run 2011-04-25 21:38:21 +02:00
Lennart Poettering bb29785e0d general: replace a few uses of /var/run by /run 2011-04-01 15:25:46 +02:00
Lennart Poettering 522d4a495a systemd: document systemd-tmpfiles 2011-02-13 15:08:15 +01:00
Lennart Poettering b8bb3e8f34 tmpfiles: support globs 2011-02-12 09:31:25 +01:00
Miklos Vajna 5471472d44 man: remaining spelling fixes 2011-01-01 20:03:56 +01:00
Lennart Poettering a7c64469b6 man: document /etc/modules-load.d/ 2010-11-21 20:41:00 +01:00
Lennart Poettering 88aebb6265 man: reorder things to follow the same order everywhere 2010-11-19 16:14:52 +01:00
Lennart Poettering aeee2322a6 man: minor tmpfiles(5) updates and reindenting 2010-11-10 23:01:20 +01:00
Brandon Philips 4149f86d81 man/tmpfiles.d.xml: add a manpage for tmpfiles.d
Initial commit of a tmpfiles.d manpage.

I ran it through xmllint but I don't know how to make it look pretty
like the rest of the xml files. :-P

Signed-off-by: Brandon Philips <bphilips@suse.de>
2010-11-05 00:20:28 +01:00