summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/systemd-run.xml55
-rw-r--r--src/core/kmod-setup.c2
-rw-r--r--src/nspawn/nspawn.c1
-rw-r--r--src/resolve-host/resolve-host.c6
-rw-r--r--src/resolve/resolved-bus.c2
-rw-r--r--src/resolve/resolved-dns-packet.c22
-rw-r--r--src/resolve/resolved-dns-packet.h1
-rw-r--r--src/resolve/resolved-manager.c1
8 files changed, 55 insertions, 35 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml
index 71b365c8eb..80db148702 100644
--- a/man/systemd-run.xml
+++ b/man/systemd-run.xml
@@ -69,38 +69,41 @@
<title>Description</title>
<para><command>systemd-run</command> may be used to create and
- start a transient <filename>.service</filename> or a transient
- <filename>.timer</filename> or a <filename>.scope</filename> unit
- and run the specified <replaceable>COMMAND</replaceable> in
- it.</para>
+ start a transient <filename>.service</filename> or
+ <filename>.scope</filename> unit and run the specified
+ <replaceable>COMMAND</replaceable> in it. It may also be used to
+ create and start transient <filename>.timer</filename>
+ units.</para>
<para>If a command is run as transient service unit, it will be
started and managed by the service manager like any other service,
- and thus show up in the output of <command>systemctl
+ and thus shows up in the output of <command>systemctl
list-units</command> like any other unit. It will run in a clean
- and detached execution environment. <command>systemd-run</command>
- will start the service asynchronously in the background and
- immediately return.</para>
-
- <para>If a command is run with timer options, transient timer unit
- also be created with transient service unit. But the transient
- timer unit is only started immediately. The transient service unit
- will be started when the transient timer is elapsed. If
- <option>--unit=</option> is specified with timer options, the
- <replaceable>COMMAND</replaceable> can be omitted. In this case,
- <command>systemd-run</command> assumes service unit is already
- loaded and creates transient timer unit only. To successfully
- create timer unit, already loaded service unit should be specified
- with <option>--unit=</option>. This transient timer unit can
- activate the existing service unit like any other timer.</para>
+ and detached execution environment, with the service manager as
+ its parent process. In this mode <command>systemd-run</command>
+ will start the service asynchronously in the background and return
+ after the command has begun execution.</para>
<para>If a command is run as transient scope unit, it will be
- started directly by <command>systemd-run</command> and thus
- inherit the execution environment of the caller. It is however
- managed by the service manager similar to normal services, and
- will also show up in the output of <command>systemctl
- list-units</command>. Execution in this case is synchronous, and
- execution will return only when the command finishes.</para>
+ started by <command>systemd-run</command> itself as parent process
+ and will thus inherit the execution environment of the
+ caller. However, the processes of the command are managed by the
+ service manager similar to normal services, and will show up in
+ the output of <command>systemctl list-units</command>. Execution
+ in this case is synchronous, and will return only when the command
+ finishes. This mode is enabled via the <option>--scope</option>
+ switch (see below). </para>
+
+ <para>If a command is run with timer options such as
+ <option>--on-calendar=</option> (see below), a transient timer
+ unit is created alongside the service unit for the specified
+ command. Only the transient timer unit is started immediately, the
+ transient service unit will be started when the transient timer
+ elapses. If the <option>--unit=</option> is specified, the
+ <replaceable>COMMAND</replaceable> may be omitted. In this case,
+ <command>systemd-run</command> only creates a
+ <filename>.timer</filename> unit that invokes the specified unit
+ when elapsing.</para>
</refsect1>
<refsect1>
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index fc6d2f4acb..2068ffd69b 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -112,7 +112,7 @@ int kmod_setup(void) {
r = kmod_module_probe_insert_module(mod, KMOD_PROBE_APPLY_BLACKLIST, NULL, NULL, NULL, NULL);
if (r == 0)
- log_info("Inserted module '%s'", kmod_module_get_name(mod));
+ log_debug("Inserted module '%s'", kmod_module_get_name(mod));
else if (r == KMOD_PROBE_APPLY_BLACKLIST)
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
else {
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 347260013a..e8a023d023 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -658,7 +658,6 @@ static int parse_argv(int argc, char *argv[]) {
const char *current = optarg;
_cleanup_free_ char *source = NULL, *destination = NULL;
CustomMount *m;
- _cleanup_strv_free_ char **strv = NULL;
r = extract_many_words(&current, ":", EXTRACT_DONT_COALESCE_SEPARATORS, &source, &destination, NULL);
switch (r) {
diff --git a/src/resolve-host/resolve-host.c b/src/resolve-host/resolve-host.c
index 3f45a9f0e8..4a7d1e3173 100644
--- a/src/resolve-host/resolve-host.c
+++ b/src/resolve-host/resolve-host.c
@@ -392,6 +392,8 @@ static int resolve_record(sd_bus *bus, const char *name) {
if (r < 0)
return log_oom();
+ p->refuse_compression = true;
+
r = dns_packet_append_blob(p, d, l, NULL);
if (r < 0)
return log_oom();
@@ -441,7 +443,7 @@ static void help_dns_types(void) {
const char *t;
if (arg_legend)
- puts("Known dns types:");
+ puts("Known DNS RR types:");
for (i = 0; i < _DNS_TYPE_MAX; i++) {
t = dns_type_to_string(i);
if (t)
@@ -454,7 +456,7 @@ static void help_dns_classes(void) {
const char *t;
if (arg_legend)
- puts("Known dns classes:");
+ puts("Known DNS RR classes:");
for (i = 0; i < _DNS_CLASS_MAX; i++) {
t = dns_class_to_string(i);
if (t)
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index de5e8e9c29..1f23834ce3 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -542,6 +542,8 @@ static void bus_method_resolve_record_complete(DnsQuery *q) {
if (r < 0)
goto finish;
+ p->refuse_compression = true;
+
r = dns_packet_append_rr(p, answer->items[i].rr, &start);
if (r < 0)
goto finish;
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index ad337c2714..bebd1ee4a6 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -388,14 +388,21 @@ int dns_packet_append_label(DnsPacket *p, const char *d, size_t l, size_t *start
return 0;
}
-int dns_packet_append_name(DnsPacket *p, const char *name,
- bool allow_compression, size_t *start) {
+int dns_packet_append_name(
+ DnsPacket *p,
+ const char *name,
+ bool allow_compression,
+ size_t *start) {
+
size_t saved_size;
int r;
assert(p);
assert(name);
+ if (p->refuse_compression)
+ allow_compression = false;
+
saved_size = p->size;
while (*name) {
@@ -1053,8 +1060,12 @@ fail:
return r;
}
-int dns_packet_read_name(DnsPacket *p, char **_ret,
- bool allow_compression, size_t *start) {
+int dns_packet_read_name(
+ DnsPacket *p,
+ char **_ret,
+ bool allow_compression,
+ size_t *start) {
+
size_t saved_rindex, after_rindex = 0, jump_barrier;
_cleanup_free_ char *ret = NULL;
size_t n = 0, allocated = 0;
@@ -1064,6 +1075,9 @@ int dns_packet_read_name(DnsPacket *p, char **_ret,
assert(p);
assert(_ret);
+ if (p->refuse_compression)
+ allow_compression = false;
+
saved_rindex = p->rindex;
jump_barrier = p->rindex;
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index 58559c85df..e81f8a8202 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -86,6 +86,7 @@ struct DnsPacket {
uint32_t ttl;
bool extracted;
+ bool refuse_compression;
};
static inline uint8_t* DNS_PACKET_DATA(DnsPacket *p) {
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index 9f451dd3e8..fb2a06b517 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -1405,7 +1405,6 @@ void manager_flush_dns_servers(Manager *m, DnsServerType t) {
}
int manager_is_own_hostname(Manager *m, const char *name) {
- _cleanup_free_ char *l = NULL;
int r;
assert(m);