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

23916 Commits

Author SHA1 Message Date
Lennart Poettering
8f00f8d6d7 Merge pull request #2006 from keszybz/mymachines-overflow
nss-mymachines: do not allow overlong machine names
2015-11-23 20:51:57 +01:00
Daniel Mack
3a7f4776cc Merge pull request #2005 from eworm-de/vimrc
vimrc: add warning about dangerous exrc mode
2015-11-23 20:25:22 +01:00
Zbigniew Jędrzejewski-Szmek
cb31827d62 nss-mymachines: do not allow overlong machine names
https://github.com/systemd/systemd/issues/2002
2015-11-23 13:59:43 -05:00
Christian Hesse
f1d075ff06 vimrc: add warning about dangerous exrc mode 2015-11-23 19:31:00 +01:00
Christian Hesse
f6875b0a63 virt: add comment about order in virtualization detection 2015-11-23 19:15:25 +01:00
Lennart Poettering
681c8d81bd Merge pull request #1997 from fbuihuu/fix-swap-unit-ordering-dep
make sure all swap units are ordered before the swap target
2015-11-23 18:24:17 +01:00
Lennart Poettering
062fc6d775 Merge pull request #1998 from eworm-de/virt
virt: detect dmi before cpuid
2015-11-23 18:21:06 +01:00
Daniel Mack
9e6a4d57b6 Merge pull request #1996 from eworm-de/editorconfig
add editorconfig configuration
2015-11-23 18:17:57 +01:00
Zbigniew Jędrzejewski-Szmek
3719f851e3 Merge pull request #1999 from evverx/nspawn-kill-signal-completion
bash-completion: nspawn: add completion for --kill-signal
2015-11-23 12:17:06 -05:00
Zbigniew Jędrzejewski-Szmek
8a421d50e0 Merge pull request #1986 from tjanez/fix-systemd_user_post
rpm: fix %systemd_user_post() macro.
2015-11-23 12:06:11 -05:00
Evgeny Vereshchagin
d5d841ff9d bash-completion: nspawn: add completion for --kill-signal 2015-11-23 17:01:26 +00:00
Zbigniew Jędrzejewski-Szmek
12dde791d5 Convert file trigger scripts to lua
At least the %filetriggerpostun script can be invoked hundreds of
times during an upgrade, so it makes sense to optimize it a bit.

assert(exec(...)) is used because of https://bugzilla.redhat.com/show_bug.cgi?id=1094072.

Add -P (--priority) to have %filetriggerpostun run as early as
possible (before any reload/stop actions), and %transfiletriggerin as
late as possible (after any enable/disable/preset actions).
2015-11-23 11:32:20 -05:00
Christian Hesse
050e65ada2 virt: detect dmi before cpuid
Virtualbox should be detected as 'oracle'. This used to work but broke
with commit:

    commit 75f86906c5
    Author: Lennart Poettering <lennart@poettering.net>
    Date:   Mon Sep 7 13:42:47 2015 +0200

    basic: rework virtualization detection API

We swap detection for dmi and cpuid, this fixes Virtualbox with KVM.
Hopefully it does not break anything else.
2015-11-23 14:02:18 +01:00
Christian Hesse
db787e7926 add editorconfig configuration
We want indention with spaces, so specify in editorconfig.
http://editorconfig.org/
2015-11-23 12:32:59 +01:00
Daniel Mack
8a85b710aa Merge pull request #1992 from evverx/tests-add-event-now
tests: add sd_event_now to test_basic
2015-11-23 11:26:25 +01:00
Daniel Mack
2b65dcd631 Merge pull request #1990 from keszybz/html-links
man: include the target name when linking to man pages in html output
2015-11-23 11:26:00 +01:00
Franck Bui
8bf23dc757 make sure all swap units are ordered before the swap target
When shutting down the system, the swap devices can be disabled long
time before the swap target is stopped. They're actually the first
units systemd turns off on my system.

This is incorrect and due to swap devices having multiple associated
swap unit files. The main one is usually created by the fstab
generator and is used to start the swap device.

Once done, systemd creates some 'alias' units for the same swap
device, one for each swap dev link. But those units are missing an
ordering dependencies which was created by the fstab generator for the
main swap unit.

Therefore during shutdown those 'alias' units can be stopped at
anytime before unmount.target target.

This patch makes sure that all swap units are stopped after the
swap.target target.
2015-11-23 11:23:44 +01:00
Evgeny Vereshchagin
591df2b5c3 tests: add sd_event_now to test_basic 2015-11-23 05:58:54 +00:00
Zbigniew Jędrzejewski-Szmek
6098bb0dc3 Merge pull request #1987 from heftig/usertasks
Set user@.service TasksMax=infinity
2015-11-23 00:41:23 -05:00
Zbigniew Jędrzejewski-Szmek
8c93f4ed7b Merge pull request #1988 from phomes/systemctl-uninitialized2
systemctl: do not return uninitialized r
2015-11-23 00:10:37 -05:00
Zbigniew Jędrzejewski-Szmek
958caa58c0 man: include the target name when linking to man pages in html output
Links like http://www.freedesktop.org/software/systemd/man/systemd.socket.html
are changed to http://www.freedesktop.org/software/systemd/man/systemd.socket.html#Accept=.

This implementation is quick & dirty, and misses various corner
cases. A fairly important one is that when a few directives share the
same anchor (which happens when multiple directives are described in
the same paragraph), generated links for everything except the first
one link to an invalid anchor. Another shortcoming is that the
formatting does not use the proper generateID machinery, so the anchor
name could be wrong in some cases. But it seems to work for a large
percentage of links, so seems to be an improvement in usability. When
the anchor is missing, we land at the top of the page, which is the
same as before. If the anchor were to point to different spot, this
would be more confusing... Not sure if that ever happens. Anyway, the
user should be able to recover from landing on the wrong place in the
page.

(Mostly) fixes https://github.com/systemd/systemd/issues/1956.
2015-11-22 23:54:29 -05:00
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
Thomas Hindoe Paaboel Andersen
bf40958019 systemctl: do not return uninitialized r
Regresssed during port to extract_first_word in
5ab22f3321

CID #1338060
2015-11-22 23:11:20 +01:00
Jan Alexander Steffens (heftig)
8c277ddd27 Set user@.service TasksMax=infinity
The user manager is still limited by its parent slice user-UID.slice,
which defaults to 4096 tasks. However, it no longer has an additional
limit of 512 tasks.

Fixes #1955.
2015-11-22 23:05:23 +01:00
Lennart Poettering
b591613f2e Merge pull request #1983 from dmedri/master
Minor updates on po/ files + it.po update
2015-11-22 22:34:37 +01:00
Lennart Poettering
4119d793e2 Merge pull request #1978 from evverx/man-service-watchdog
man: update WatchdogSec section
2015-11-22 22:33:50 +01:00
Lennart Poettering
2a38594dba Merge pull request #1980 from evverx/sd-event-use-prioq-ensure-allocated
sd-event: update tests; small refactoring
2015-11-22 22:32:54 +01:00
Tadej Janež
e67ba78369 rpm: fix %systemd_user_post() macro.
Escape "--user" and "--global" arguments with "\\" since rpm treats
arguments starting with "-" as macro options which causes "Unknown
option" rpm error.
Use %{expand:...} to force expansion of the inner macro. Otherwise %{?*}
is recursively defined as "\--user \--global {%?*}" which causes
"Too many levels of recursion in macro expansion" rpm error.

Thanks to Michael Mráka for helping me fix the above issues.
2015-11-22 20:38:05 +01:00
Thomas Hindoe Paaboel Andersen
74544b4ead networkd: link - fix reading routes
This regressed during the port to extract_first_word in c598ac76
(v228).

CID #1338083
2015-11-22 18:53:36 +01:00
Daniele Medri
871363de54 Italian: language update 2015-11-22 17:03:53 +01:00
Daniele Medri
00ff00260a translations: update-po 2015-11-22 16:43:39 +01:00
Franck Bui
e9fd88f2e9 core: allow 'SetUnitProperties()' to run on inactive units too
'set-property' has been primarly designed to change some properties of
*active* units.

However it can easily work on inactive units as well. In that case
changes are only saved in a drop-in for futur uses and changes will be
effective when unit will be started.

Actually it already works on inactive units but that was not
documented and not fully supported. Indeed the inactive units had to
be known by the manager otherwise it was reported as not loaded:

 $ systemctl status my-test.service
 * my-test.service - My Testing Unit
    Loaded: loaded (/etc/systemd/system/my-test.service; static; vendor preset: disabled)
   Drop-In: /etc/systemd/system/my-test.service.d
    Active: inactive (dead)

 $ systemctl set-property my-test.service MemoryLimit=1000000
 Failed to set unit properties on my-test.service: Unit my-test.service is not loaded.

[ Note: that the unit load state reported by the 'status' command
  might be confusing since it claimed the unit as loaded but
  'set-property' reported the contrary. ]

One can possibily workaround this by making the unit a dependency of
another active unit so the manager will keep it around:

 $ systemctl add-wants multi-user.target my-test.service
 Created symlink from /etc/systemd/system/multi-user.target.wants/my-test.service to /etc/systemd/system/my-test.service.

 $ systemctl set-property my-test.service MemoryLimit=1000000

 $ systemctl status my-test.service
 * my-test.service - My Testing Unit
    Loaded: loaded (/etc/systemd/system/my-test.service; enabled; vendor preset: disabled)
   Drop-In: /etc/systemd/system/my-test.service.d
            `-50-MemoryLimit.conf
    Active: inactive (dead)

This patch simply forces 'SetUnitProperties()' to load the unit if
it's not already the case.

It also documents the fact that 'set-property' can be used on inactive
units.
2015-11-22 15:06:14 +01:00
Franck Bui
000a996dc4 Introduce bus_unit_check_load_state() helper
This function is used to check that a previous unit load succeed and
returns 0 in this case.

In the case the load failed, the function setup a bus error
accordingly and returns -errno.
2015-11-22 15:05:40 +01:00
Evgeny Vereshchagin
509a07ad6d tests: add missing sd_event_add_post to test_basic 2015-11-22 09:11:19 +00:00
Evgeny Vereshchagin
5657c75f91 tests: check exit handler invocation 2015-11-22 08:23:59 +00:00
Evgeny Vereshchagin
c983e776c4 sd-event: use prioq_ensure_allocated where possible 2015-11-22 06:41:31 +00:00
Daniel Mack
0c203f1dd1 Merge pull request #1979 from evverx/build-install-systemd-path-completion
build: install bash completion for systemd-path
2015-11-21 11:57:52 +01:00
Evgeny Vereshchagin
ceb2840951 build: install bash completion for systemd-path
This is a follow-up for commit e50e53876f
2015-11-21 07:19:12 +00:00
Evgeny Vereshchagin
a0533c6d2c man: update WatchdogSec section
* add info about sd_event_set_watchdog
* add missing Restart values
2015-11-21 04:17:47 +00:00
Daniel Mack
aedf698f3e Merge pull request #1966 from evverx/fix-initrd-searching-on-debian
tests: fix initrd searching on Debian/Ubuntu
2015-11-20 16:00:32 +01:00
Evgeny Vereshchagin
61fea35e14 tests: fix initrd searching on Debian/Ubuntu 2015-11-20 12:10:12 +00:00
Lennart Poettering
1bd4903c8f Merge pull request #1950 from evverx/man-systemd-exec-env
man: systemd.exec: add missing variables
2015-11-20 12:24:43 +01:00
Martin Pitt
fd4f59076e Merge pull request #1964 from poettering/sd-event-man
Finish the documentation for sd-event.h
2015-11-20 05:16:03 +01:00
Tom Gundersen
c665ffa9b1 Merge pull request #1962 from mbiebl/install-completion-networkctl
build: install bash completion for networkctl
2015-11-20 04:04:24 +01:00
Lennart Poettering
dc83f27a7c man: fully document sd-event interfaces
This completes the set of man pages for sd-event and contains some minor
other fixes for other man pages too.

The sd_event_set_name(3) man page is renamed to
sd_event_source_set_description(3), which is the correct name of the
concept today.
2015-11-19 23:38:54 +01:00
Lennart Poettering
0be6c2f617 sd-event: define a new PREPARING state
We already have a state RUNNING and EXITING when we dispatch regular and
exit callbacks. Let's introduce a new state called PREPARING that is
active while we invoke preparation callbacks. This way we have a state
each for all three kinds of event handlers.

The states are currently not documented, hence let's add a new state to
the end, before we start documenting this.
2015-11-19 23:36:03 +01:00
Lennart Poettering
6680dd6b66 sd-event: make _ref() calls NOPs when NULL is passed to them
Let's make _ref() calls happy when NULL is passed to them, and simply
return NULL without any assertion logic. This makes them nicely
symmetric to the _unref() calls which also are happy to take NULL and
become NOPs then.
2015-11-19 23:36:03 +01:00
Lennart Poettering
bb54817f3b Merge pull request #1947 from phomes/sort-includes2
tree-wide: sort includes in *.h
2015-11-19 23:32:30 +01:00
Michael Biebl
e7035a4779 build: install bash completion for networkctl
This is a follow-up for commit e4f246b1b5.
2015-11-19 17:41:41 +01:00
Daniel Mack
6f9d3b08cf test: 01-basic: mask some services that currently don't run in qemu 2015-11-19 17:15:26 +01:00