1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
Commit Graph

23301 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b7cf9ac00a Rework file trigger scripts to fire at the right time
This turns out to be more complicated than it looked initially...
%transfiletriggerun is called early, while %transfiletriggerin is
called late, and neither satifisfies the requirement to call
daemon-reload after new unit files have been installed, but before
%postun scripts in packages get to fire.

It seems that the only solution is to use %filetriggerun (which
is called once per package) to do the reload, and keep state in
/var/lib/rpm-state/systemd/ to avoid calling the reload multiple
times.

https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Saving_state_between_scriptlets
says that /var/lib/rpm-state/systemd/ is the right dir.
2015-11-22 20:09:17 -05:00
Zbigniew Jędrzejewski-Szmek
873e413323 Move daemon-reload from package %post scripts to file triggers
This uses new functionality added in rpm 4.13. Instead of doing
one daemon-reload per packages, we do just one or two
(When both installing and uninstalling packages, we do
two. Unfortunately this also includes the common case of upgrades.
When only installing or when only installing, we do just one.)

New file triggers.systemd can be built, but the contents have
to be copied into the rpm spec file by hand. Using %{load} does
not seem to work. It can serve as documentation.
2015-11-15 18:38:37 -05:00
Daniel Mack
e3c4a681db Merge pull request #1835 from poettering/grabbag-of-stuff
Lots of small fixes
2015-11-10 21:01:35 +01:00
Lennart Poettering
092b6e188b Merge pull request #1785 from ssahani/word
core: unit deps port to extract_first_word
2015-11-10 19:55:30 +01:00
Lennart Poettering
b95292a152 Merge pull request #1834 from filbranden/testexecute2
test-execute: Fix systemd escaping and shell issues (v2)
2015-11-10 19:49:51 +01:00
Lennart Poettering
79b7278da0 Merge pull request #1793 from filbranden/extract1
More refactorings in extract_first_word
2015-11-10 19:43:09 +01:00
Lennart Poettering
f63be4b2b6 Merge pull request #1783 from vcaputo/still_make_progress_when_throttling
core: still make progress when throttling the manager loop
2015-11-10 19:33:27 +01:00
Lennart Poettering
7fa89e2fe2 Merge pull request #1812 from evverx/test-fixes
tests: various fixes
2015-11-10 19:31:22 +01:00
Evgeny Vereshchagin
5c404f1ab8 tests: various fixes
* remove journal flushing (systemd-journal-flush.service runs journalctl --flush on boot)
* use sh -c and PATH instead of @SYSTEMCTL@ expansion
* remove unnecessary semicolons etc
2015-11-10 18:01:15 +00:00
Susant Sahani
3d793d2905 core: unit deps port to extract_first_word 2015-11-10 22:24:00 +05:30
Lennart Poettering
930a079693 Merge pull request #1823 from whot/hwdb-updates
Updated axis ranges/resolutions for Lenovo T510 and Dell Inspiron N5040
2015-11-10 17:46:28 +01:00
Lennart Poettering
de7399eb74 update TODO 2015-11-10 17:36:53 +01:00
Lennart Poettering
2d49a208f8 parse-util: really refuse parsing negative values as positive ones, even on x86-32
strtoull() doesn't make it particularly easy to detect passed-in
negative numbers, as it silently converts them to positive ones without
generating any error. Since we are not interested in negative values we
should hence explicitly filter them out by looking at the string
directly and returning ERANGE if we see a leading "-".

Fixes: #1829
2015-11-10 17:36:52 +01:00
Lennart Poettering
b374689c02 journald: dispatch SIGTERM/SIGINT with a low priority
Let's make sure to process all queued log data before exiting, so that
we don't unnecessary lose messages when shutting down.

https://github.com/systemd/systemd/pull/1812#issuecomment-155149871
2015-11-10 17:36:52 +01:00
Lennart Poettering
a4c1800284 core: accept time units for time-based resource limits
Let's make sure "LimitCPU=30min" can be parsed properly, following the
usual logic how we parse time values. Similar for LimitRTTIME=.

While we are at it, extend a bit on the man page section about resource
limits.

Fixes: #1772
2015-11-10 17:36:46 +01:00
Lennart Poettering
d580265eb4 core: when parsing resource limits, be more careful with types and corner cases
Let's not convert RLIM_INFINITY to "unsigned long long" and then back to
rlim_t, but let's leave it in the right type right-away.

Parse resource limits as 64 bit in all cases, as according to the man
page that's what libc does anyway.

Make sure setting a resource limit to (uint64_t) -1 results in a parsing
error, and isn't implicitly converted to RLIM_INFINITY.
2015-11-10 17:31:31 +01:00
Lennart Poettering
65dce26488 core: simplify parsing of capability bounding set settings
Let's generate a simple error, and that's it. Let's not try to be smart
and record the last word that failed.

Also, let's make sure we don't compare numeric values with 0 by relying
on C's downgrade-to-bool feature, as suggested in CODING_STYLE.
2015-11-10 17:31:31 +01:00
Lennart Poettering
519cffec89 time-util: add parse_time(), which is like parse_sec() but allows specification of default time unit if none is specified
This is useful if we want to parse RLIMIT_RTTIME values where the common
UNIX syntax is without any units but refers to a non-second unit (µs in
this case), but where we want to allow specification of units.
2015-11-10 17:31:31 +01:00
Lennart Poettering
75eb615480 defs: rework CONF_DIRS_NULSTR() macro
The macro is generically useful for putting together search paths, hence
let's make it truly generic, by dropping the implicit ".d" appending it
does, and leave that to the caller. Also rename it from
CONF_DIRS_NULSTR() to CONF_PATHS_NULSTR(), since it's not strictly about
dirs that way, but any kind of file system path.

Also, mark CONF_DIR_SPLIT_USR() as internal macro by renaming it to
_CONF_PATHS_SPLIT_USR() so that the leading underscore indicates that
it's internal.
2015-11-10 17:31:31 +01:00
Lennart Poettering
b1f044bbc4 cgls: when showing root slice, put -.slice at top of tree 2015-11-10 17:31:31 +01:00
Lennart Poettering
a6a4d3c46b cgls: suppress output of controller name, if it's the systemd one 2015-11-10 17:31:31 +01:00
Lennart Poettering
f499daf4b3 virt: make sure that we detect unknown container managers as VIRTUALIZATION_CONTAINER_OTHER
If we don't know a container manager, we should consider it as "other"
rather than as no container manager at all, to provide a somwhat useful
upgrade path.
2015-11-10 17:31:30 +01:00
Lennart Poettering
fa195fa775 CODING_STYLE: elaborate on usage of C99 fixed size integer types 2015-11-10 17:31:30 +01:00
Lennart Poettering
9905e698b4 man: fix reference to description of time span syntax 2015-11-10 17:31:30 +01:00
Filipe Brandenburger
cdaf507048 test-execute: Fix systemd escaping and shell issues
In most cases, systemd requires escaping $ (for systemd variable
substitution) and % (for specifiers) by doubling them. This was somewhat
of an issue in tests like exec-environment*.service where systemd was
doing the substitutions and we were not really checking that those were
available in the actual environment of the command. Fix that.

Expressions such as `exit $(test ...)` are incorrect. They only work
because $(test ...) will produce no output, so the command will become a
bare "exit" which will exit with the status of the latest executed
command which turns out to be the test... The direct approach is simply
calling "test" as the last command, for which the shell will propagate
the exit status.

One situation where this was breaking tests was on `exit $(test ...) &&
$(test ...) && $(test ...)` where the second and third tests were not
really executing, since the first command is actually `exit` so && was
doing nothing there. Fixed it by just using `test ... && test ... &&
test ...` as it was initially intended.

Pass -x to all shell executions for them to produce useful debugging
output to stderr. Consequently, removed most of the explicit `echo`s
that are no longer needed.

Mark all units as Type=oneshot explicitly.

Also made sure all shell variables are properly quoted.

v2: Added an explicit LC_ALL=C to ionice invocations since some locales
(such as French) will add a space before the colon in the output.

Tested by running `sudo ./test-execute` and confirming all tests enabled
on my system (essentially all of them except for the s390 one) passed.
Tweaked the variables or options or expected values and confirmed the
tests do indeed fail when the values are not exactly the expected ones.

v2: Also tested with `LANG=fr_FR.UTF-8 sudo ./test-execute` to confirm
it still works in a different locale.
2015-11-10 07:58:29 -08:00
Tom Gundersen
8f84882240 Merge pull request #1825 from ssahani/ipv61-1
networkd: add support to configure IPv6 hop limit
2015-11-10 15:03:37 +01:00
Tom Gundersen
3b6a025a4f Merge pull request #1827 from davidreynolds/use_extract_first_word
conf-parser: use extract_first_word
2015-11-10 14:46:53 +01:00
Tom Gundersen
64d4e8f90b Merge pull request #1830 from jsynacek/journalctl-time
man/journalctl: mention systemd.time(7) where appropriate
2015-11-10 14:46:02 +01:00
Tom Gundersen
5af12d8b09 Merge pull request #1831 from keszybz/todo-trimming
Todo trimming
2015-11-10 14:43:42 +01:00
Tom Gundersen
76fba3ca60 Merge pull request #1735 from thom311/master
lldp: avoid compiler warnings in lldp_tfl_package_read* functions
2015-11-10 14:41:35 +01:00
Zbigniew Jędrzejewski-Szmek
9f6434a675 man: describe the reason why runlevels are obsolete
Put it at the top of the file, where it's hard to miss.

Also add the mapping of runlevel → target because since it is now
static.

I'm not adding runlevel(7), because we do not want to make obsolete
stuff even more prominent.
2015-11-10 08:16:08 -05:00
Zbigniew Jędrzejewski-Szmek
28f90ea25f man: tweak description of machinectl show
Also, machinectl status is anything but terse. Remove "terse".
2015-11-10 07:53:43 -05:00
Zbigniew Jędrzejewski-Szmek
474acc9870 TODO: update for lz4/xz stuff
No point in fixing xz now that lz4 is the default.
2015-11-10 07:46:22 -05:00
Jan Synacek
20b2aec031 man/journalctl: mention systemd.time(7) where appropriate
Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1182661
2015-11-10 13:05:48 +01:00
David Reynolds
34f253f087 conf-parser: use extract_first_word 2015-11-09 23:57:49 -08:00
Peter Hutterer
3872f4d3ab hwdb: add axis range corrections for Lenovo T510
From https://bugzilla.redhat.com/show_bug.cgi?id=1247958
2015-11-10 14:19:29 +10:00
Susant Sahani
a86cba89be man: add man for IPV6 hop limit 2015-11-10 09:29:24 +05:30
Susant Sahani
b69c318040 networkd: Add support to configure IPV6 hop limit
This patch adds support to configure IPV6 hop limit.

For example:
/proc/sys/net/ipv6/conf/wlp3s0/hop_limit
2015-11-10 09:26:38 +05:30
Peter Hutterer
30d980b22a hwdb: add Dell Inspiron N5040 touchpad corrections
From https://bugzilla.redhat.com/show_bug.cgi?id=1275070
2015-11-10 12:54:32 +10:00
Peter Hutterer
3cf23b62ea hwdb: sort the brand names alphabetically 2015-11-10 12:52:01 +10:00
Lennart Poettering
b18fc75b07 Merge pull request #1790 from endocode/kayrus/fix_man_kernel_cl
Fixed kernel-command-line links
2015-11-10 01:01:51 +01:00
Tom Gundersen
89c22dc342 Merge pull request #1629 from ssahani/vxlan
networkd: vxlan add option to set FDB entries
2015-11-09 23:36:59 +01:00
Lennart Poettering
64204b9545 Merge pull request #1821 from darkcircle/ko-catalog-translation
l10n: add a new Korean translation for the catalog
2015-11-09 23:19:37 +01:00
Daniel Mack
b0bc8dbd73 Merge pull request #1820 from michich/errno-v2
[v2] treewide: treatment of errno and other cleanups
2015-11-09 21:56:49 +01:00
Seong-ho Cho
decb24f38a add a new Korean translation for the catalog 2015-11-10 05:09:14 +09:00
Lennart Poettering
70d54fca18 Merge pull request #1762 from endocode/dongsu/l10n-ko-msgs
po: update Korean translation
2015-11-09 20:09:49 +01:00
Michal Schmidt
e1427b138f treewide: apply errno.cocci
with small manual cleanups for style.
2015-11-09 20:01:06 +01:00
Michal Schmidt
b3e3bb19a0 coccinelle: additional errno.cocci hunk
rewrites:
  log_error_errno(errno, ...);
  return -errno;
into:
  return log_error_errno(errno, ...);
2015-11-09 20:01:06 +01:00
Michal Schmidt
351825cc73 coccinelle: errno.cocci improvements
Apply to all log_*_errno loglevels.
2015-11-09 20:01:06 +01:00
Lennart Poettering
32d38c584e Merge pull request #1798 from evverx/fix-test-udev
test-udev: small fixes
2015-11-09 18:33:22 +01:00