summaryrefslogtreecommitdiff
path: root/src/tmpfiles
Commit message (Collapse)AuthorAge
* Add set_consume which always takes ownershipZbigniew Jędrzejewski-Szmek2013-04-24
| | | | Freeing in error path is the common pattern with set_put().
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-18
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* Fix spelling errors using 'codespell' toolAnatol Pomozov2013-04-15
|
* Add _cleanup_globfree_Zbigniew Jędrzejewski-Szmek2013-04-05
| | | | Fixes a memleak in error path in exec_context_load_environment.
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-05
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* util: add a bit of syntactic sugar to run short code fragments with a ↵Lennart Poettering2013-04-04
| | | | different umask
* util: rename parse_usec() to parse_sec() sinds the default unit is secondsLennart Poettering2013-04-03
| | | | | | | | Internally we store all time values in usec_t, however parse_usec() actually was used mostly to parse values in seconds (unless explicit units were specified to define a different unit). Hence, be clear about this and name the function about what we pass into it, not what we get out of it.
* tmpfiles: fix obscure leak in error pathZbigniew Jędrzejewski-Szmek2013-03-31
| | | | | The leak was because of the single return in midst of all 'goto finish'es. Using automatic cleanup simplifies things.
* Always use errno > 0 to help gccZbigniew Jędrzejewski-Szmek2013-03-29
| | | | | | gcc thinks that errno might be negative, and functions could return something positive on error (-errno). Should not matter in practice, but makes an -O4 build much quieter.
* tmpfiles: add missing missing.h includeZbigniew Jędrzejewski-Szmek2013-03-13
| | | | | | | mbiebl> src/tmpfiles/tmpfiles.c:221:13: error: ‘MAX_HANDLE_SZ’ undeclared (first use in this function) Fixup for 427b47c4abaf4b5.
* tmpfiles: --clean -- check for bind mounts of the same filesystem and skip themKay Sievers2013-03-13
|
* tmpfiles: use cleanup func. to save a few linesZbigniew Jędrzejewski-Szmek2013-03-03
|
* tmpfiles: move exclamation mark into right placeLukas Nykryn2013-03-03
| | | | | Unary not has higher precedence than comparisons, so the condition was bogus.
* binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services ↵Lennart Poettering2013-02-11
| | | | | | | | | | | | | | | | | | | that work on .d/ directories This unifies much of the logic behind them: - All four will now ofllow the rule that the earlier file and earlier assignment in the .d/ directories wins. Before, sysctl was the only outlier, where the later setting always won. - All four now support getopt() and --help on the command line. - All four can now handle specification of configuration file names on the command line to apply. The tools will automatically find them, and apply them. Previously only tmpfiles could do that. This is useful for %post scripts in RPMs and suchlike. - This fixes various error path issues in conf_files_list()
* shared: conf-files - add root parameterKay Sievers2013-02-08
|
* tmpfiles: introduce type XMichal Sekletar2013-01-25
| | | | | | | | | | 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.
* tmpfiles: Fix file descriptor leak on errorThomas Jarosch2013-01-03
| | | | Detected by cppcheck
* tmpfiles: allow Age to be set to 0Tom Gundersen2012-10-23
| | | | | | | 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.
* udev: add hardware database supportKay Sievers2012-10-23
|
* tmpfiles: restore previous behavior for F/fDave Reisner2012-09-27
| | | | | | 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().
* util: define union dirent_storage and make use of it everywhereLennart Poettering2012-09-19
| | | | | | Make sure to allocate enough space for readdir_r(). https://bugzilla.redhat.com/show_bug.cgi?id=858754
* tmpfiles: use write(2) for the 'w' actionDave Reisner2012-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* tmpfiles: plug file descriptor leak.Dave Reisner2012-09-13
| | | | Introduced in d4e9eb91.
* tmpfiles: support globbing for w optionDave Reisner2012-09-12
| | | | | | | | | | 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
* tmpfiles: don't attempt creation of device nodes when we run in a containerLennart Poettering2012-09-05
|
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-26
| | | | | | 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
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-25
| | | | | | | | 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
* tmpfiles: also look in /lib/tmpfiles.d on split /usr systemsLennart Poettering2012-07-20
| | | | | | | | 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.
* unit: introduce %s specifier for the user shellLennart Poettering2012-07-16
|
* util: rename join() to strjoin()Lennart Poettering2012-07-13
| | | | This is to match strappend() and the other string related functions.
* util: rm_rf() refuse cleaning non-memory file systems, as extra paranoiaLennart Poettering2012-07-10
|
* mount-setup: don't complain if we try to fix the label of a dir beneath a ↵Lennart Poettering2012-07-03
| | | | mount but can't due to EROFS
* update TODOLennart Poettering2012-06-20
|
* tmpfiles: exclude the first level directories in /run/user from automatic ↵Lennart Poettering2012-06-20
| | | | | | | 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.
* tmpfiles: create char devices with correct SELinux contextMichal Schmidt2012-06-14
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=824059
* tmpfiles: fix error messageKay Sievers2012-06-10
|
* tmpfiles: print error if basename lookup fails; document it in manpageKay Sievers2012-06-10
|
* tmpfiles: allow to specify basename only: systemd-tmpfiles <program.conf>Dave Reisner2012-06-10
| | | | | | | | | | 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.
* mkdir: append _label to all mkdir() calls that explicitly set the selinux ↵Kay Sievers2012-05-31
| | | | context
* tmpfiles: if we are supposed to write a string to a file, it's OK if we ↵Lennart Poettering2012-05-15
| | | | can't write the trailing newline
* util: split-out path-util.[ch]Kay Sievers2012-05-08
|
* util: split-out conf-file.[ch]Kay Sievers2012-05-07
|
* tmpfiles: fix error messageMichal Schmidt2012-04-20
|
* selinux: unify systemd and udev codeKay Sievers2012-04-17
|
* build-sys: add stub makefiles to all subdirs to ease development with emacsLennart Poettering2012-04-13
|
* move all tools to subdirsKay Sievers2012-04-12