1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

10345 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
5f255144ae tmpfiles: detect all combinations of + and !
The same algorithm as with - and @ in ExecStart= is used.
2015-01-22 01:14:52 -05:00
Zbigniew Jędrzejewski-Szmek
505ef0e36c tmpfiles: simplification
Certain conditions were checked more than once. Warning message
is improved.
2015-01-22 01:14:52 -05:00
Zbigniew Jędrzejewski-Szmek
3da7a50f84 shared/cgroup-show: simplify show_pid_array()
int[] should not be used as pid_t[], even if happens to be same thing.
Also deduplicating in a quadratic loop right before sorting is unnecessary.
Remove custom greedy_realloc implementation.
2015-01-22 01:14:52 -05:00
Zbigniew Jędrzejewski-Szmek
1fa2f38f0f Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable.
Too bad.
2015-01-22 01:14:52 -05:00
Zbigniew Jędrzejewski-Szmek
8facc3498e Fix some format strings for enums, they are signed 2015-01-22 00:39:30 -05:00
Zbigniew Jędrzejewski-Szmek
213c305a2f shared/util: use signed printf format for PIDs
gcc 5 started warning about this.
2015-01-22 00:39:30 -05:00
Lennart Poettering
3d7415f43f import: introduce new mini-daemon systemd-importd, and make machinectl a client to it
The old "systemd-import" binary is now an internal tool. We still use it
as asynchronous backend for systemd-importd. Since the import tool might
require some IO and CPU resources (due to qcow2 explosion, and
decompression), and because we might want to run it with more minimal
priviliges we still keep it around as the worker binary to execute as
child process of importd.

machinectl now has verbs for pulling down images, cancelling them and
listing them.
2015-01-22 04:02:07 +01:00
Lennart Poettering
f4c135bf2f impot: minor cleanups 2015-01-22 04:02:07 +01:00
Lennart Poettering
aca83a53ee log: add new log output mode, that prints to console, but prefixes with syslog priority
This is useful when we execute our own programs, reading output from its
STDERR, and want to retain priority information.
2015-01-22 04:02:07 +01:00
Tom Gundersen
07e10d1a7c networkd: plug lldp leak 2015-01-21 23:02:22 +01:00
Tom Gundersen
cfb5b38057 network: dhcp - split out dhcp_identifier_set_{iaid,duid_en} from dhcp6-client
This will also be used in dhcp4-client.
2015-01-21 22:57:55 +01:00
Tom Gundersen
764aad6258 network: dhcp - split out the duid structure into a new header file
We will use the same in both dhcp4 and dhcp6.
2015-01-21 22:57:55 +01:00
Lennart Poettering
ff2670ad11 import: simplify dkr importer, by making use of generic import-job logic, used by the raw and tar importers
This gets us progress output as well xz/bzip2 support.
2015-01-21 20:05:31 +01:00
Lennart Poettering
8b71fce8c2 import: minor cleanups for the tar and raw importers 2015-01-21 20:05:31 +01:00
Martin Pitt
77354c7e6f sysv-generator: Replace Provides: symlinks with real units
Since commit b7e7184 the SysV generator creates symlinks for all "Provides:" in
the LSB header. However, this is too greedy; there are cases where the
creation of a unit .service file fails because of an already existing
symlink with the same name:

 - Backup files such as /etc/init.d/foo.bak still have "Provides: foo", and
   thus get a foo.service -> foo.bak.service link. foo.bak would not be enabled
   in rcN.d/, but we (deliberately) create units for all executables in init.d/
   so that a manual "systemctl start" works. If foo.bak is processed before,
   the symlink already exists.

 - init.d/bar has "Provides: foo", while there also is a real init.d/foo. The
   former would create a link foo.service -> bar.service, while the latter
   would fail to create the real foo.service.

If we encounter an existing symlink, just remove it before writing a real unit.

Note that two init.d scripts "foo" and "bar" which both provide the same name
"common" already work. The first processed init script wins and creates the
"common.service" symlink, and the second just fails to create the symlink
again. Thus create an additional test case for this to ensure that it keeps
working sensibly.

https://bugs.debian.org/775404
2015-01-21 17:01:00 +01:00
Martin Pitt
c7088e4999 util: Add some missing hidden_file() suffixes
dpkg itself also uses *.dpkg-dist, while .dpkg-{bak,backup,remove} are being
used by dpkg-maintscript-helper.
2015-01-21 15:29:37 +01:00
Martin Pitt
29e0e6d8c1 sysv-generator: Handle .sh suffixes when translating Provides:
When deciding whether the provided name equals the file name in
sysv_translate_facility(), also consider them equal if the file name has a
".sh" suffix.

This was uncovered by commit b7e7184 which then created a symlink
"<name>.service" to itself for ".sh" suffixed init.d scripts.

For additional robustness, refuse to create symlinks to itself in add_alias().

Add test case which reproduces the bug.

https://bugs.debian.org/775889
2015-01-21 14:53:38 +01:00
Lennart Poettering
8af3cf74df import: support downloading bzip2-encoded images
This way, we can import CoreOS images unmodified.
2015-01-21 13:44:29 +01:00
Christian Seiler
ccf23ad5fa journal: Fix syslog forwarding without CAP_SYS_ADMIN
In case CAP_SYS_ADMIN is missing (like in containers), one cannot fake pid in
struct ucred (uid/gid are fine if CAP_SETUID/CAP_SETGID are present).

Ensure that journald will try again to forward the messages to syslog without
faking the SCM_CREDENTIALS pid (which isn't guaranteed to succeed anyway, since
it also does the same thing if the process has already exited).

With this patch, journald will no longer silently discard messages
that are supposed to be sent to syslog in these situations.

https://bugs.debian.org/775067
2015-01-21 12:36:58 +01:00
Lennart Poettering
0100b6e1bf import: also add verification support to tar importer 2015-01-21 04:03:54 +01:00
Lennart Poettering
98c3800184 import: make verification code generic, in preparation for using it pull-tar 2015-01-21 04:03:54 +01:00
Lennart Poettering
5a3b1abd0e import: improve logging 2015-01-21 04:03:54 +01:00
Lennart Poettering
90bc083bda import: show download speed while downloading 2015-01-21 04:03:54 +01:00
Lennart Poettering
3576d6315f import: add image verification using gpg
This also adds an initial keyring for the verification, that contains
Ubuntu's and Fedora's key. We should probably add more entries sooner or
later.
2015-01-21 04:03:54 +01:00
Lennart Poettering
c09ef2e4e8 nspawn: work around kernel bug with partition table probing on loopback devices
When we set up a loopback device with partition probing, the udev
"change" event about the configured device is first passed on to
userspace, only the the in-kernel partition prober is started. Since
partition probing fails with EBUSY when somebody has the device open,
the probing frequently fails since udev starts probing/opening the
device as soon as it gets the notification about it, and it might do so
earlier than the kernel probing.

This patch adds a (hopefully temporary) work-around for this, that
compares the number of probed partitions of the kernel with those of
blkid and synchronously asks for reprobing until the numebrs are in
sync.

This really deserves a proper kernel fix.
2015-01-20 20:40:45 +01:00
Lennart Poettering
c660bb0942 import: add a couple of additional suffixes to remove from raw images 2015-01-20 20:40:44 +01:00
Lennart Poettering
8f6950587a import: make image verification optional 2015-01-20 20:40:44 +01:00
Patrik Flykt
950a1705dc sd-dhcp6-client: Remove unnecessary debug printout 2015-01-20 19:39:28 +02:00
Lennart Poettering
85dbc41dc6 import: add a simple scheme for validating the SHA256 sums of downloaded raw files 2015-01-20 15:06:58 +01:00
Lennart Poettering
88a1aadc48 import: be less aggressive when allocating memory for downloaded payload 2015-01-20 15:06:58 +01:00
Lennart Poettering
68c913fd75 import: improve logging a bit 2015-01-20 15:06:58 +01:00
Lennart Poettering
0d6e763b48 import: port pull-raw to helper tools implemented for pull-tar
This allows us to reuse a lot more code, and simplify pull-raw
drastically.
2015-01-20 15:06:58 +01:00
Lennart Poettering
56ebfaf1ca import: add support for pulling raw tar balls as containers
Ubuntu provides their cloud images optionally as tarball, hence also
support downloading those.
2015-01-20 15:06:58 +01:00
Lennart Poettering
a2e0337875 util: make http url validity checks more generic, and move them to util.c 2015-01-20 15:06:58 +01:00
Rami Rosen
6fb2f9ab6b networkd: fix a typo in networkd-wait-online-manager.
subscibe->subscribe
2015-01-20 09:45:34 +01:00
Zbigniew Jędrzejewski-Szmek
d9000fd3b3 man: add networkctl(1) 2015-01-19 21:44:53 -05:00
Tom Gundersen
4bbfe7ad22 nspawn: add ipvlan support 2015-01-20 00:46:13 +01:00
Tom Gundersen
c4a5ddc9f2 networkd: netdev - add ipvlan support 2015-01-19 23:25:16 +01:00
Zbigniew Jędrzejewski-Szmek
250ba6647b systemctl: do not show dots with --plain
Plain implies a ... "plain" output.

Also do not say "No jobs" with --no-legend. We skip
reporting the number of jobs with --no-legend if there
are any, and 0 is also a number, and should be skipped.
2015-01-19 15:41:03 -05:00
Lennart Poettering
f6c51a8136 nspawn: support dissecting GPT images that contain only a single generic linux partition
This should allow running Ubuntu UEFI GPT Images with nspawn,
unmodified.
2015-01-19 20:24:10 +01:00
Lennart Poettering
ec5cb56ee1 import: clarify when we are unpacking the qcow2 device 2015-01-19 20:24:10 +01:00
Lennart Poettering
2fbe4296c5 inspawn: wait until udev has probed a loopback device before making us of it 2015-01-19 20:24:10 +01:00
Lennart Poettering
0716faad4a import: make sure don't leak the LZMA context 2015-01-19 20:24:10 +01:00
Lennart Poettering
c19de71113 machined: refer to the disk space allocated for an image to "usage" rather than "size"
After all, it's closer to the "du"-reported value than to the file
sizes...
2015-01-19 20:24:09 +01:00
Lennart Poettering
1c7dd82563 qcow2: when dissecting qcow2, use btrfs clone ioctls for reflinking blocks to target 2015-01-19 20:24:09 +01:00
Lennart Poettering
1e20b41187 import: when downloading raw files, show simple progress reports 2015-01-19 20:24:09 +01:00
Lennart Poettering
2f64ba0e6e import: simplify the code a bit 2015-01-19 20:24:09 +01:00
Lennart Poettering
ff6a74609b import-raw: when downloading raw images, generate sparse files if we can 2015-01-19 20:24:09 +01:00
Lennart Poettering
47bc4fd86d import-raw: set NOCOW flag on all raw images we create 2015-01-19 20:24:09 +01:00
Zbigniew Jędrzejewski-Szmek
3fb90db2d6 systemctl: fix import-environment description, trim help to 80 cols 2015-01-19 13:55:59 -05:00