Commit graph

22 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 72cdb3e783 build-sys: drop automake support
v2:
- also mention m4
2017-07-18 10:04:44 -04:00
Zbigniew Jędrzejewski-Szmek 872c403963 update-done: use newly added library function to write the file
Fixes #5861.
2017-05-11 13:43:53 -04:00
codekipper 5a1d67639d update-done: Create using a temporary file (#5789)
'/etc/.updated' is created without using a temporary file, this can be
problematic with filesystems that cache writes. Modify so that the
timestamp is written to a temporary file and then use an atomic move
to move it to its correct place.
2017-04-26 19:49:06 -04:00
Lucas Werkmeister cc7de2ba32 tree-wide: add man: to manpage references (#5402)
Found with:

    git grep '"[^"]*[a-z0-9]([0-9]\+p\?)' src/ | grep -vF man:
2017-02-20 18:45:35 -05:00
Lennart Poettering ec2ebfd524 update-done: minor clean-ups
This is a follow-up for fb8b0869a7, and makes a
couple of minor clean-up changes:

- The field name in the timestamp file is changed from "TimestampNSec=" to
  "TIMESTAMP_NSEC=". This is done simply to reflect the fact that we parse the
  file with the env var file parser, and hence the contents should better
  follow the usual capitalization of env vars, i.e. be all uppercase.

- Needless negation of the errno parameter log_error_errno() and friends has
  been removed.

- Instead of manually calculating the nsec remainder of the timestamp, use
  timespec_store().

- We now check whether we were able to write the timestamp file in full with
  fflush_and_check() the way we usually do it.
2016-10-24 17:29:51 +02:00
Ivan Shapovalov fb8b0869a7 update-done, condition: write the timestamp to the file as well and use it to prevent false-positives
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=90192 and #4130
for real. Also, remove timestamp check in update-done.c altogether since
the whole operation is idempotent.
2016-09-15 06:36:42 +03:00
Zbigniew Jędrzejewski-Szmek c3dacc8bbf selinux: always try to load the full selinux db
https://github.com/systemd/systemd/pull/2508#issuecomment-190901170
Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
2016-03-01 20:39:30 -05:00
Daniel Mack b26fa1a2fb tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Lennart Poettering c004493cde util-lib: split out IO related calls to io-util.[ch] 2015-10-26 01:24:38 +01:00
Lennart Poettering 3ffd4af220 util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over.
2015-10-25 13:19:18 +01:00
Lennart Poettering 329c542585 update-done: ignore nanosecond file timestamp components, they are not reliable
https://bugs.freedesktop.org/show_bug.cgi?id=90192
2015-04-27 17:25:57 +02:00
Lennart Poettering 0a2f9085e2 update-done: minor simplification 2015-04-27 17:22:55 +02:00
Thomas Hindoe Paaboel Andersen 2eec67acbb remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
2015-02-23 23:53:42 +01:00
Lennart Poettering d7b8eec7dc tmpfiles: add new line type 'v' for creating btrfs subvolumes 2014-12-28 02:08:40 +01:00
Lennart Poettering 755bde375f udev,update-done: more log_xyz_errno() conversions 2014-11-28 16:32:26 +01:00
Michal Schmidt da927ba997 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
2014-11-28 13:29:21 +01:00
Michal Schmidt 0a1beeb642 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
2014-11-28 12:04:41 +01:00
Lennart Poettering ecabcf8b6e selinux: clean up selinux label function naming 2014-10-23 21:36:56 +02:00
WaLyong Cho cc56fafeeb mac: rename apis with mac_{selinux/smack}_ prefix 2014-10-23 17:13:15 +02:00
Zbigniew Jędrzejewski-Szmek 4aa4d2ae97 update-done: include a short description in .updated
People might be confused where the file comes from, since the name is not
at all specific.

https://bugzilla.redhat.com/show_bug.cgi?id=1121301#c8
2014-07-26 15:08:42 -04:00
Zbigniew Jędrzejewski-Szmek 7dbb1d08f6 update-done: set proper selinux context for .updated
https://bugzilla.redhat.com/show_bug.cgi?id=1121806
2014-07-21 20:57:39 -04:00
Lennart Poettering 8ea48dfcd3 update-done: add minimal tool to manage system updates for /etc and /var, if /usr has changed
In order to support offline updates to /usr, we need to be able to run
certain tasks on next boot-up to bring /etc and /var in line with the
updated /usr. Hence, let's devise a mechanism how we can detect whether
/etc or /var are not up-to-date with /usr anymore: we keep "touch
files" in /etc/.updated and /var/.updated that are mtime-compared with
/usr. This means:

Whenever the vendor OS tree in /usr is updated, and any services that
shall be executed at next boot shall be triggered, it is sufficient to
update the mtime of /usr itself. At next boot, if /etc/.updated and/or
/var/.updated is older than than /usr (or missing), we know we have to
run the update tools once. After that is completed we need to update the
mtime of these files to the one of /usr, to keep track that we made the
necessary updates, and won't repeat them on next reboot.

A subsequent commit adds a new ConditionNeedsUpdate= condition that
allows checking on boot whether /etc or /var are outdated and need
updating.

This is an early step to allow booting up with an empty /etc, with
automatic rebuilding of the necessary cache files or user databases
therein, as well as supporting later updates of /usr that then propagate
to /etc and /var again.
2014-06-13 13:26:32 +02:00