Commit Graph

29 Commits

Author SHA1 Message Date
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
Kay Sievers 796b06c21b udev: add hardware database support 2012-10-23 16:43:32 +02:00
Dave Reisner 1845fdd967 tmpfiles: restore previous behavior for F/f
d4e9eb91ea changed the behavior for the F and f actions, wrongly sending
them to glob_item(). Restore the old behavior and shortcut straight to
write_one_file().
2012-09-27 20:53:05 -04:00
Lennart Poettering 7d5e9c0f60 util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().

https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-19 22:21:09 +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 3612fbc1e4 tmpfiles: plug file descriptor leak.
Introduced in d4e9eb91.
2012-09-13 00:10:35 +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
Lennart Poettering cb7ed9dfca tmpfiles: don't attempt creation of device nodes when we run in a container 2012-09-05 23:42:05 -07:00
Shawn Landden 0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Shawn Landden 669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Lennart Poettering 3f2afb2914 tmpfiles: also look in /lib/tmpfiles.d on split /usr systems
https://bugs.freedesktop.org/show_bug.cgi?id=38686

I don't think the usecase case in that bug makes much sense, but all the
other tools do honour /lib in the search path so we probably should do
that here, too.
2012-07-20 16:57:13 +02:00
Lennart Poettering d05c5031ad unit: introduce %s specifier for the user shell 2012-07-16 12:34:54 +02:00
Lennart Poettering b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00
Lennart Poettering f56d5db919 util: rm_rf() refuse cleaning non-memory file systems, as extra paranoia 2012-07-10 19:05:58 +02:00
Lennart Poettering c9bc076461 mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS 2012-07-03 16:25:50 +02:00
Lennart Poettering d139b24a80 update TODO 2012-06-20 14:31:00 +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
Michal Schmidt e7aee75932 tmpfiles: create char devices with correct SELinux context
https://bugzilla.redhat.com/show_bug.cgi?id=824059
2012-06-14 16:01:19 +02:00
Kay Sievers 94f7a71442 tmpfiles: fix error message 2012-06-10 19:31:39 +02:00
Kay Sievers ca2e894bdb tmpfiles: print error if basename lookup fails; document it in manpage 2012-06-10 19:21:50 +02:00
Dave Reisner 9125670f9a tmpfiles: allow to specify basename only: systemd-tmpfiles <program.conf>
Allow passing of basename only, instead of the absolute path; letting
systemd-tmpfiles perform a path lookup for the proper fragment path in
the config directories.

This allows distributions to call: systemd-tmpfiles <program.conf> on
upgrade of a package, with respecting the possibly overriden (or even
masked) tmpfile.
2012-06-10 19:05:20 +02:00
Kay Sievers d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Lennart Poettering 03ad1136ba tmpfiles: if we are supposed to write a string to a file, it's OK if we can't write the trailing newline 2012-05-15 14:35:51 +02:00
Kay Sievers 9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Kay Sievers 2c21044f05 util: split-out conf-file.[ch] 2012-05-07 19:01:24 +02:00
Michal Schmidt a48f3d1566 tmpfiles: fix error message 2012-04-20 17:12:27 +02:00
Kay Sievers e9a5ef7cdd selinux: unify systemd and udev code 2012-04-17 16:05:28 +02:00
Lennart Poettering b562f5a57d build-sys: add stub makefiles to all subdirs to ease development with emacs 2012-04-13 21:37:59 +02:00
Kay Sievers dce818b390 move all tools to subdirs 2012-04-12 17:54:42 +02:00