b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
4a0b58c4a30ecaa61202f845ed86f75b36370cd0 |
|
17-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use right cast macros for UIDs, GIDs and PIDs |
cf0fbc49e67b55f8d346fc94de28c90113505297 |
|
16-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes
Sort the includes accoding to the new coding style. |
b938cb902c3b5bca807a94b277672c64d6767886 |
|
06-Nov-2015 |
Jan Engelhardt <jengelh@inai.de> |
doc: correct punctuation and improve typography in documentation |
6ad623a3f77e087e308f334525fd4046811f2a9a |
|
03-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
parse-util: introduce parse_ifindex() and make use of it everywhere
We have enough places where we parse an ifindex, hence introduce a
proper parsing function for it, that verifies all parameters. |
6a37c684695befff2d2ce7e0fcce90e25e2e252c |
|
03-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
machine: when we fail to extract a network interface from the machine state, don't try again
If we failed to extract a word, then that's how it is, we shouldn't try
to extract it again and again, it's unlikely to work, and we just
deadlock.
This is a fix-up for 52278ad31d92dffa9029c8a171b9e9348f5dcc8f. |
52278ad31d92dffa9029c8a171b9e9348f5dcc8f |
|
02-Nov-2015 |
Susant Sahani <ssahani@gmail.com> |
machine: fix extract_first_word |
75a8fd6ac8a5c7c2e8b8d9eb066ccd477b2e1eb5 |
|
31-Oct-2015 |
Susant Sahani <ssahani@gmail.com> |
machine: : port to extract_first_word |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
40e1f4ea7458a0a80eaf1ef356e52bfe0835412e |
|
08-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: when opening a shell via machined, pass tty fds in
With this change we'll open the shell's tty right from machined and then
pass it to the transient unit we create. This way we make sure the pty
is opened exactly as long as the transient service is around, and no
longer, and vice versa. This way pty forwarders do not have to deal with
EIO problems due to vhangup, as the pty is open all the time from the
point we set things up to the point where the service goes away. |
66cb2fde7b0ab6603775ad13c30c004f5fd88f0c |
|
08-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: move two more terminal-related calls into terminal-util.[ch] |
a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources. |
5f430ff76e8e5f7ca5b7ef67dd3b205487a0f41b |
|
05-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
machine: make sure to call unlockpt() even for local host pty connections
This fixes breakage for local host pty handling, introduced in
395745ba533ac91fe118f43ec83f13a752c0b473.
Fixes #1139 |
fbe550738d03b178bb004a1390e74115e904118a |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: introduce pseudo-machine ".host" refererring to the host system
Some of the operations machined/machinectl implement are also very
useful when applied to the host system (such as machinectl login,
machinectl shell or machinectl status), hence introduce a pseudo-machine
by the name of ".host" in machined that refers to the host system, and
may be used top execute operations on the host system with.
This copies the pseudo-image ".host" machined already implements for
image related commands.
(This commit also adds a PK privilege for opening a PTY in a container,
which was previously not accessible for non-root.) |
49f3fffd94591bdf2bd6c2233a9300daeab79566 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: rework state tracking logic for machines
This splits up the stopping logic for machines into two steps: first on
machine_stop() we begin with the shutdown of a machine by queuing the
stop method call for it. Then, in machine_finalize() we actually remove
the rest of its runtime context. This mimics closely how sessions are
handled in logind.
This also reworks the GC logic to strictly check the current state of
the machine unit, rather than shortcutting a few cases, like for example
assuming that UnitRemoved really means a machine is gone (which it isn't
since Reloading might trigger it, see #376).
Fixes #376. |
491ac9f2c4aeda8c40edde35112404b737e38b60 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
logind,machined: various smaller cleanups
Use mfree() where we can.
Drop unnecessary {}.
Drop unnecessary variable declarations.
Cast syscall invocations where explicitly don't care for the return
value to (void).
Reword a comment. |
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 |
|
29-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers. |
9b420b3cfb8b93daf50e4cdbc92b05f2209ef893 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make sure to track machine unit states properly
If a unit is stopped for a moment, we need to invalidate our knowledge
of it, otherwise we might be confused by automatic restarts
This makes reboots for nspawn containers run as service work correctly.
https://bugs.freedesktop.org/show_bug.cgi?id=87428 |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
e62d9b81926e22f7a1d8a117fd85bb735d3cead2 |
|
15-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add (void) where we don't care about return value |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
0370612e0522191f929e3feb7d4937fff3d421e2 |
|
17-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make "machinectl copy-to" and "machinectl copy-from" server side operations
This way, any bus client can make use of these calls. |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
17a20d64912e95ea90380381f85e9ef7fd56ff67 |
|
06-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: simplification |
c00a4c8f55e51be98274e86beba14117e25dab9c |
|
29-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
Revert "machined: don't force terminate registered machines"
This reverts commit 206e7a5f7b55ac61188efd895e65ab26e478cbb2.
We actually want to allow shutting down containers that use
RegisterMachine() rather than CreateMachine() to register their own
unit. It should be safe to do so, since the primary usecase for
RegisterMachine() are container managers that run only a single
container within their own unit, such as systemd-nspawn. |
003dffde2c1b93afbc9aff24b277276f65424406 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: Move image discovery logic into src/shared, so that we can make use of it from nspawn |
8d3d7072e609ef0e0fb37e1d19a29307d58146c3 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: a few more log_*_errno + return simplifications
The one in tmpfiles.c:create_item() even looks like it fixes a bug. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
e2cc6eca73cd1df8be552d7c23f9ff3d69c06f1e |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: fix order of log_unit_struct() to match other logging calls
Also, while we are at it, introduce some syntactic sugar for creating
ERRNO= and MESSAGE= structured logging fields. |
9d685ca8193c0da3ad5746be3871f5350179a3b3 |
|
14-Aug-2014 |
Eelco Dolstra <eelco.dolstra@logicblox.com> |
machine_kill(): Don't kill the unit when killing the leader
If "machinectl poweroff" or "machinectl reboot" is used on a
systemd-nspawn container started with --keep-unit and --register, it
should *only* send the appropriate signal to the leader PID (i.e. the
container's systemd process). It shouldn't fall through to
manager_kill_unit() to also send the signal to the unit. The latter
ends up killing systemd-nspawn, which takes down the container
prematurely. |
a2a5291b3f5ab6ed4c92f51d0fd10a03047380d8 |
|
31-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Reject invalid quoted strings
String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.
Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.
_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.
Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.
mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint
mbiebl_> which is pretty weird |
9b5ed6feda08290edce3bf916fa7362733dd30ea |
|
10-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: allow registering host-side network interfaces for communication with containers |
f14aa1f1b2e4e99ee20393871b5f64f1378ed6c3 |
|
06-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
machine: don't return uninitialized variable
Repotred by Ronny Chevalier |
206e7a5f7b55ac61188efd895e65ab26e478cbb2 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: don't force terminate registered machines
When a machine is registered in machined with CreateMachine it is OK to
kill the machine when it is terminated, but when an existing unit is
simply registered via RegisterMachine we shouldn't do that, as the unit
is controlled by somebody else. |
034753ac13a9d4b308eee1e8d7c3285f6646c0d8 |
|
12-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
machine: minor modernizations |
ca5405bb4fb1fabd1fe43e4ee23edf58914bdfae |
|
22-May-2014 |
Lennart Poettering <lennart@poettering.net> |
machine: escape fields we store in /run, so that they can be properly unescaped by parse_env_file() |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
de58a50e24a0d55e3bbcc77f8f6170a7322acf52 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: fix Kill() bus call on machine objects when "what" is specified as "leader" |
39883f622f392d8579f4428fc5a789a102efbb10 |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter. |
89f7c8465cd1ab37347dd0c15920bce31e8225df |
|
11-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: optionally, allow registration of pre-existing units (scopes
or services) as machine with machined |
90b2de37b80603168f4e9c9c81cff7eea4efa21a |
|
06-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Update some message formats
Use PID_FMT/USEC_FMT/... in more places.
Also update logind error messages to print the full path to a file that
failed. This should make debugging easier for people who do not know
off the top of their head where logind stores it state. |
d3e84ddb885e9d5f0ae9930eb905910e3a81f157 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: keep track of the initial leader PID of a machine
This way we can without races always determine the machine for a leader
PID. This allows machine managers to query the machine for a forked off
container/VM without a race where the child might already have died
before we could read the cgroup information from /proc/$PID/cgroup. |
a658cafa98ab55ea948c29bc87eb3945d515fb41 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: simplifications |
c335068380fe8c9d843cdb2cf8a00f822cfabed3 |
|
30-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: port over to libsystemd-bus |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
554604b3073467af75dc94fac9e2343148603289 |
|
11-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: forward scope properties array from client to systemd
This makes nspawn's --scope= switch work again. |
f2d4f98d5873e0649b79b04b967fc9625ab3a350 |
|
10-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: when creating the scope job fails, return this immediately to the client that wants to register the session
Otherwise we'll hanging for the job to finish without any job existing.
Similar, for machined. |
2c4c73b3ffa123cc5c69f5749c58706aafb3f257 |
|
02-Jul-2013 |
Dave Reisner <dreisner@archlinux.org> |
machine: fix -Wmaybe-uninitialized warning
The return value of machine_start_scope might be undefined if m->scope
is non-NULL. |
f526ab7ef046d0e6d8923d4960903bcc807883fb |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machine: fix scope allocation |
d0af76e68a5bab2e4fd9674b1c64a9f38d7afe97 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: after deserializatio readd systemd units to unit-to-object hashmap correctly |
1ee306e1248866617c96ed9f4263f375588ad838 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl. |