Commit graph

68 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek d3b6d0c21e fileio: in envfiles, do not skip lines following empty lines
https://bugs.freedesktop.org/show_bug.cgi?id=63477
2013-04-13 20:24:39 -04:00
Lennart Poettering 574d5f2dfc util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming.
2013-04-03 20:12:56 +02:00
Eelco Dolstra 6f6fad96ad systemd-sysctl: Handle missing /etc/sysctl.conf properly
Since fabe5c0e5f, systemd-sysctl returns
a non-zero exit code if /etc/sysctl.conf does not exist, due to a
broken ENOENT check.
2013-03-27 12:01:44 -04:00
Harald Hoyer a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Zbigniew Jędrzejewski-Szmek f04e95ba6b sysctl: fix uninitalized memory access in error path
src/sysctl/sysctl.c: In function ‘parse_file’:
src/sysctl/sysctl.c:172:41: warning: ‘property’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2013-02-13 09:55:52 -05:00
Lennart Poettering fabe5c0e5f binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services 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()
2013-02-11 23:54:30 +01:00
Kay Sievers 7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Michal Sekletar 91b32fa987 sysctl: parse all keys in a config file
https://bugzilla.redhat.com/show_bug.cgi?id=869779
2012-10-26 01:12:22 +02:00
Dave Reisner 1a3f40f912 sysctl: avoiding exiting with error on -EEXIST
If the final key in any sysctl.d file is a duplicate, systemd-sysctl
will exit with an error (and no explaination why). Ignore this, as
duplicate keys are to be expected when overriding settings in the
directory hierarchy.
2012-10-06 16:41:30 -04:00
Lennart Poettering 0187f62bb5 sysctl: always return the last error we encountered 2012-09-21 17:03:40 +02:00
Lukas Nykryn 089d4a08d0 sysctl: fix error code handling
After  if (r <= 0) r can't  be 0 so
if (k < 0 && r == 0) never happens.
2012-09-21 16:12:47 +02:00
Michal Sekletar 86fc77c47f sysctl: apply configuration at once
https://bugzilla.redhat.com/show_bug.cgi?id=767795

[ Simplified by iterating the config files in the backwards order -
  no need for hashmap_update(). Other minor cleanups. -- michich ]
2012-08-06 18:24:05 +02: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
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
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