Compare commits

..

No commits in common. "c9fdaed079524942445a1bbbb975766768ad9b04" and "a2870138c10e26d9d1f63552d1a725c5bb7d4adb" have entirely different histories.

32 changed files with 214 additions and 351 deletions

View File

@ -42,28 +42,6 @@
<xi:include href="standard-conf.xml" xpointer="main-conf" /> <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>[Network] Section Options</title>
<para>The following options are available in the <literal>[Network]</literal> section:</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>SpeedMeter=</varname></term>
<listitem><para>Takes a boolean. If set to yes, then <command>systemd-networkd</command>
measures the traffic of each interface, and
<command>networkctl status <replaceable>INTERFACE</replaceable> shows the measured speed.
</command>Defaults to no.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SpeedMeterIntervalSec=</varname></term>
<listitem><para>Specifies the time interval to calculate the traffic speed of each interface.
If <varname>SpeedMeter=no</varname>, the value is ignored. Defaults to 10sec.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1> <refsect1>
<title>[DHCP] Section Options</title> <title>[DHCP] Section Options</title>

View File

@ -99,16 +99,6 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-u</option></term>
<term><option>--uuid</option></term>
<listitem><para>Generate output as an UUID formatted in the "canonical representation", with five
groups of digits seperated by hyphens. See the
<ulink url="https://en.wikipedia.org/wiki/Universally_unique_identifier#Format">wikipedia</ulink>
for more discussion.</para></listitem>
</varlistentry>
<xi:include href="standard-options.xml" xpointer="help" /> <xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" /> <xi:include href="standard-options.xml" xpointer="version" />
</variablelist> </variablelist>

View File

@ -332,9 +332,9 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...]\n" printf("%s [OPTIONS...]\n\n"
"\n%sListen on sockets and launch child on connection.%s\n" "Listen on sockets and launch child on connection.\n\n"
"\nOptions:\n" "Options:\n"
" -h --help Show this help and exit\n" " -h --help Show this help and exit\n"
" --version Print version string and exit\n" " --version Print version string and exit\n"
" -l --listen=ADDR Listen for raw connections at ADDR\n" " -l --listen=ADDR Listen for raw connections at ADDR\n"
@ -347,7 +347,6 @@ static int help(void) {
"\nNote: file descriptors from sd_listen_fds() will be passed through.\n" "\nNote: file descriptors from sd_listen_fds() will be passed through.\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );

View File

@ -2243,8 +2243,26 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"%sProfile systemd, show unit dependencies, check unit files.%s\n" "Profile systemd, show unit dependencies, check unit files.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" --system Operate on system systemd instance\n"
" --user Operate on user systemd instance\n"
" --global Operate on global user configuration\n"
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
" --order Show only order in the graph\n"
" --require Show only requirement in the graph\n"
" --from-pattern=GLOB Show only origins in the graph\n"
" --to-pattern=GLOB Show only destinations in the graph\n"
" --fuzz=SECONDS Also print services which finished SECONDS earlier\n"
" than the latest in the branch\n"
" --man[=BOOL] Do [not] check for existence of man pages\n"
" --generators[=BOOL] Do [not] run unit generators (requires privileges)\n"
" --iterations=N Show the specified number of iterations\n"
" --base-time=TIMESTAMP Calculate calendar times relative to specified time\n"
"\nCommands:\n" "\nCommands:\n"
" time Print time spent in the kernel\n" " time Print time spent in the kernel\n"
" blame Print list of running units ordered by time to init\n" " blame Print list of running units ordered by time to init\n"
@ -2266,29 +2284,8 @@ static int help(int argc, char *argv[], void *userdata) {
" timestamp TIMESTAMP... Validate a timestamp\n" " timestamp TIMESTAMP... Validate a timestamp\n"
" timespan SPAN... Validate a time span\n" " timespan SPAN... Validate a time span\n"
" security [UNIT...] Analyze security of unit\n" " security [UNIT...] Analyze security of unit\n"
"\nOptions:\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" --system Operate on system systemd instance\n"
" --user Operate on user systemd instance\n"
" --global Operate on global user configuration\n"
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
" --order Show only order in the graph\n"
" --require Show only requirement in the graph\n"
" --from-pattern=GLOB Show only origins in the graph\n"
" --to-pattern=GLOB Show only destinations in the graph\n"
" --fuzz=SECONDS Also print services which finished SECONDS earlier\n"
" than the latest in the branch\n"
" --man[=BOOL] Do [not] check for existence of man pages\n"
" --generators[=BOOL] Do [not] run unit generators (requires privileges)\n"
" --iterations=N Show the specified number of iterations\n"
" --base-time=TIMESTAMP Calculate calendar times relative to specified time\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, dot_link , dot_link
, link , link
); );

View File

@ -13,8 +13,6 @@
#include "main-func.h" #include "main-func.h"
#include "parse-util.h" #include "parse-util.h"
#include "path-util.h" #include "path-util.h"
#include "pretty-print.h"
#include "terminal-util.h"
#include "util.h" #include "util.h"
#include "verbs.h" #include "verbs.h"
#include "virt.h" #include "virt.h"
@ -24,29 +22,19 @@ static char **arg_path = NULL;
STATIC_DESTRUCTOR_REGISTER(arg_path, strv_freep); STATIC_DESTRUCTOR_REGISTER(arg_path, strv_freep);
static int help(int argc, char *argv[], void *userdata) { static int help(int argc, char *argv[], void *userdata) {
_cleanup_free_ char *link = NULL;
int r;
r = terminal_urlify_man("systemd-bless-boot.service", "8", &link); printf("%s [COMMAND] [OPTIONS...]\n"
if (r < 0) "\n"
return log_oom(); "Mark the boot process as good or bad.\n\n"
printf("%s [OPTIONS...] COMMAND\n"
"\n%sMark the boot process as good or bad.%s\n"
"\nCommands:\n"
" good Mark this boot as good\n"
" bad Mark this boot as bad\n"
" indeterminate Undo any marking as good or bad\n"
"\nOptions:\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Print version\n" " --version Print version\n"
" --path=PATH Path to the $BOOT partition (may be used multiple times)\n" " --path=PATH Path to the $BOOT partition (may be used multiple times)\n"
"\nSee the %s for details.\n" "\n"
, program_invocation_short_name "Commands:\n"
, ansi_highlight() " good Mark this boot as good\n"
, ansi_normal() " bad Mark this boot as bad\n"
, link " indeterminate Undo any marking as good or bad\n",
); program_invocation_short_name);
return 0; return 0;
} }

View File

@ -11,28 +11,16 @@
#include "bus-error.h" #include "bus-error.h"
#include "log.h" #include "log.h"
#include "main-func.h" #include "main-func.h"
#include "pretty-print.h"
#include "terminal-util.h"
#include "util.h" #include "util.h"
static int help(void) { static int help(void) {
_cleanup_free_ char *link = NULL;
int r;
r = terminal_urlify_man("systemd-boot-check-no-failures.service", "8", &link); printf("%s [COMMAND] [OPTIONS...]\n"
if (r < 0) "\n"
return log_oom(); "Verify system operational state.\n\n"
printf("%s [OPTIONS...]\n"
"\n%sVerify system operational state.%s\n\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Print version\n" " --version Print version\n",
"\nSee the %s for details.\n" program_invocation_short_name);
, program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link
);
return 0; return 0;
} }

View File

@ -1032,8 +1032,8 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n" printf("%s [COMMAND] [OPTIONS...]\n\n"
"\n%sInstall, update or remove the systemd-boot EFI boot manager.%s\n" "Install, update or remove the systemd-boot EFI boot manager.\n"
"\nBoot Loader Commands:\n" "\nBoot Loader Commands:\n"
" status Show status of installed systemd-boot and EFI variables\n" " status Show status of installed systemd-boot and EFI variables\n"
" install Install systemd-boot to the ESP and EFI variables\n" " install Install systemd-boot to the ESP and EFI variables\n"
@ -1046,7 +1046,6 @@ static int help(int argc, char *argv[], void *userdata) {
" list List boot loader entries\n" " list List boot loader entries\n"
" set-default ID Set default boot loader entry\n" " set-default ID Set default boot loader entry\n"
" set-oneshot ID Set default boot loader entry, for next boot only\n" " set-oneshot ID Set default boot loader entry, for next boot only\n"
"\nOptions:\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Print version\n" " --version Print version\n"
" --esp-path=PATH Path to the EFI System Partition (ESP)\n" " --esp-path=PATH Path to the EFI System Partition (ESP)\n"
@ -1057,8 +1056,6 @@ static int help(int argc, char *argv[], void *userdata) {
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link); , link);
return 0; return 0;

View File

@ -2228,9 +2228,9 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
"%sIntrospect the D-Bus IPC bus.%s\n" "Introspect the bus.%s\n\n"
"\nCommands:\n" "Commands:\n"
" list List bus names\n" " list List bus names\n"
" status [SERVICE] Show bus service, process or bus owner credentials\n" " status [SERVICE] Show bus service, process or bus owner credentials\n"
" monitor [SERVICE...] Show bus traffic\n" " monitor [SERVICE...] Show bus traffic\n"
@ -2277,8 +2277,8 @@ static int help(void) {
" system\n" " system\n"
" --destination=SERVICE Destination service of a signal\n" " --destination=SERVICE Destination service of a signal\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -409,13 +409,9 @@ static bool mount_is_extrinsic(Mount *m) {
if (!MANAGER_IS_SYSTEM(UNIT(m)->manager)) /* We only automatically manage mounts if we are in system mode */ if (!MANAGER_IS_SYSTEM(UNIT(m)->manager)) /* We only automatically manage mounts if we are in system mode */
return true; return true;
if (UNIT(m)->perpetual) /* All perpetual units never change state */
return true;
if (PATH_IN_SET(m->where, /* Don't bother with the OS data itself */ if (PATH_IN_SET(m->where, /* Don't bother with the OS data itself */
"/", /* (strictly speaking redundant: should already be covered by the perpetual flag check above) */ "/",
"/usr", "/usr"))
"/etc"))
return true; return true;
if (PATH_STARTSWITH_SET(m->where, if (PATH_STARTSWITH_SET(m->where,
@ -550,32 +546,6 @@ static int mount_verify(Mount *m) {
return 0; return 0;
} }
static int mount_add_non_exec_dependencies(Mount *m) {
int r;
assert(m);
/* Adds in all dependencies directly responsible for ordering the mount, as opposed to dependencies
* resulting from the ExecContext and such. */
r = mount_add_device_dependencies(m);
if (r < 0)
return r;
r = mount_add_mount_dependencies(m);
if (r < 0)
return r;
r = mount_add_quota_dependencies(m);
if (r < 0)
return r;
r = mount_add_default_dependencies(m);
if (r < 0)
return r;
return 0;
}
static int mount_add_extras(Mount *m) { static int mount_add_extras(Mount *m) {
Unit *u = UNIT(m); Unit *u = UNIT(m);
int r; int r;
@ -603,6 +573,18 @@ static int mount_add_extras(Mount *m) {
return r; return r;
} }
r = mount_add_device_dependencies(m);
if (r < 0)
return r;
r = mount_add_mount_dependencies(m);
if (r < 0)
return r;
r = mount_add_quota_dependencies(m);
if (r < 0)
return r;
r = unit_patch_contexts(u); r = unit_patch_contexts(u);
if (r < 0) if (r < 0)
return r; return r;
@ -615,7 +597,7 @@ static int mount_add_extras(Mount *m) {
if (r < 0) if (r < 0)
return r; return r;
r = mount_add_non_exec_dependencies(m); r = mount_add_default_dependencies(m);
if (r < 0) if (r < 0)
return r; return r;
@ -1588,7 +1570,7 @@ static int mount_setup_existing_unit(
unit_remove_dependencies(u, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT); unit_remove_dependencies(u, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
r = mount_add_non_exec_dependencies(MOUNT(u)); r = mount_add_extras(MOUNT(u));
if (r < 0) if (r < 0)
return r; return r;
} }

View File

@ -145,14 +145,14 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...]\n\n"
"%sList or retrieve coredumps from the journal.%s\n" "List or retrieve coredumps from the journal.%s\n"
"\nCommands:\n" "\nCommands:\n"
" list [MATCHES...] List available coredumps (default)\n" " list [MATCHES...] List available coredumps (default)\n"
" info [MATCHES...] Show detailed information about one or more coredumps\n" " info [MATCHES...] Show detailed information about one or more coredumps\n"
" dump [MATCHES...] Print first matching coredump to stdout\n" " dump [MATCHES...] Print first matching coredump to stdout\n"
" debug [MATCHES...] Start a debugger for the first matching coredump\n" " debug [MATCHES...] Start a debugger for the first matching coredump\n"
"\nOptions:\n" "\nFlags:\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Print version string\n" " --version Print version string\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -167,8 +167,8 @@ static int help(void) {
" -D --directory=DIR Use journal files from directory\n\n" " -D --directory=DIR Use journal files from directory\n\n"
" -q --quiet Do not show info messages and privilege warning\n" " -q --quiet Do not show info messages and privilege warning\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -310,8 +310,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] COMMAND ...\n\n"
"%sQuery or change system hostname.%s\n" "Query or change system hostname.%s\n"
"\nCommands:\n" "\nCommands:\n"
" status Show current hostname settings\n" " status Show current hostname settings\n"
" set-hostname NAME Set system hostname\n" " set-hostname NAME Set system hostname\n"
@ -329,8 +329,8 @@ static int help(void) {
" --static Only set static hostname\n" " --static Only set static hostname\n"
" --pretty Only set pretty hostname\n" " --pretty Only set pretty hostname\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -9,7 +9,6 @@
#include "main-func.h" #include "main-func.h"
#include "pretty-print.h" #include "pretty-print.h"
#include "selinux-util.h" #include "selinux-util.h"
#include "terminal-util.h"
#include "util.h" #include "util.h"
#include "verbs.h" #include "verbs.h"
@ -33,21 +32,18 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s OPTIONS COMMAND\n\n"
"%sUpdate or query the hardware database.%s\n" "Update or query the hardware database.\n\n"
"\nCommands:\n"
" update Update the hwdb database\n"
" query MODALIAS Query database and print result\n"
"\nOptions:\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" -s --strict When updating, return non-zero exit value on any parsing error\n" " -s --strict When updating, return non-zero exit value on any parsing error\n"
" --usr Generate in " UDEVLIBEXECDIR " instead of /etc/udev\n" " --usr Generate in " UDEVLIBEXECDIR " instead of /etc/udev\n"
" -r --root=PATH Alternative root path in the filesystem\n\n" " -r --root=PATH Alternative root path in the filesystem\n\n"
"Commands:\n"
" update Update the hwdb database\n"
" query MODALIAS Query database and print result\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link , link
); );

View File

@ -7,15 +7,14 @@
#include "id128-print.h" #include "id128-print.h"
#include "main-func.h" #include "main-func.h"
#include "pretty-print.h" #include "pretty-print.h"
#include "terminal-util.h"
#include "util.h" #include "util.h"
#include "verbs.h" #include "verbs.h"
static Id128PrettyPrintMode arg_mode = ID128_PRINT_ID128; static bool arg_pretty = false;
static sd_id128_t arg_app = SD_ID128_NULL; static sd_id128_t arg_app = {};
static int verb_new(int argc, char **argv, void *userdata) { static int verb_new(int argc, char **argv, void *userdata) {
return id128_print_new(arg_mode); return id128_print_new(arg_pretty);
} }
static int verb_machine_id(int argc, char **argv, void *userdata) { static int verb_machine_id(int argc, char **argv, void *userdata) {
@ -30,7 +29,7 @@ static int verb_machine_id(int argc, char **argv, void *userdata) {
return log_error_errno(r, "Failed to get %smachine-ID: %m", return log_error_errno(r, "Failed to get %smachine-ID: %m",
sd_id128_is_null(arg_app) ? "" : "app-specific "); sd_id128_is_null(arg_app) ? "" : "app-specific ");
return id128_pretty_print(id, arg_mode); return id128_pretty_print(id, arg_pretty);
} }
static int verb_boot_id(int argc, char **argv, void *userdata) { static int verb_boot_id(int argc, char **argv, void *userdata) {
@ -45,7 +44,7 @@ static int verb_boot_id(int argc, char **argv, void *userdata) {
return log_error_errno(r, "Failed to get %sboot-ID: %m", return log_error_errno(r, "Failed to get %sboot-ID: %m",
sd_id128_is_null(arg_app) ? "" : "app-specific "); sd_id128_is_null(arg_app) ? "" : "app-specific ");
return id128_pretty_print(id, arg_mode); return id128_pretty_print(id, arg_pretty);
} }
static int verb_invocation_id(int argc, char **argv, void *userdata) { static int verb_invocation_id(int argc, char **argv, void *userdata) {
@ -60,7 +59,7 @@ static int verb_invocation_id(int argc, char **argv, void *userdata) {
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to get invocation-ID: %m"); return log_error_errno(r, "Failed to get invocation-ID: %m");
return id128_pretty_print(id, arg_mode); return id128_pretty_print(id, arg_pretty);
} }
static int help(void) { static int help(void) {
@ -71,22 +70,19 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND\n\n" printf("%s [OPTIONS...] {COMMAND}\n\n"
"%sGenerate and print 128bit identifiers.%s\n" "Generate and print id128 strings.\n\n"
" -h --help Show this help\n"
" -p --pretty Generate samples of program code\n"
" -a --app-specific=ID Generate app-specific IDs\n"
"\nCommands:\n" "\nCommands:\n"
" new Generate a new id128 string\n" " new Generate a new id128 string\n"
" machine-id Print the ID of current machine\n" " machine-id Print the ID of current machine\n"
" boot-id Print the ID of current boot\n" " boot-id Print the ID of current boot\n"
" invocation-id Print the ID of current invocation\n" " invocation-id Print the ID of current invocation\n"
" help Show this help\n" " help Show this help\n"
"\nOptions:\n"
" -h --help Show this help\n"
" -p --pretty Generate samples of program code\n"
" -a --app-specific=ID Generate app-specific IDs\n"
" -u --uuid Output in UUID format\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );
@ -107,7 +103,6 @@ static int parse_argv(int argc, char *argv[]) {
{ "version", no_argument, NULL, ARG_VERSION }, { "version", no_argument, NULL, ARG_VERSION },
{ "pretty", no_argument, NULL, 'p' }, { "pretty", no_argument, NULL, 'p' },
{ "app-specific", required_argument, NULL, 'a' }, { "app-specific", required_argument, NULL, 'a' },
{ "uuid", no_argument, NULL, 'u' },
{}, {},
}; };
@ -116,7 +111,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0); assert(argc >= 0);
assert(argv); assert(argv);
while ((c = getopt_long(argc, argv, "hpa:u", options, NULL)) >= 0) while ((c = getopt_long(argc, argv, "hpa:", options, NULL)) >= 0)
switch (c) { switch (c) {
case 'h': case 'h':
@ -126,7 +121,7 @@ static int parse_argv(int argc, char *argv[]) {
return version(); return version();
case 'p': case 'p':
arg_mode = ID128_PRINT_PRETTY; arg_pretty = true;
break; break;
case 'a': case 'a':
@ -135,10 +130,6 @@ static int parse_argv(int argc, char *argv[]) {
return log_error_errno(r, "Failed to parse \"%s\" as application-ID: %m", optarg); return log_error_errno(r, "Failed to parse \"%s\" as application-ID: %m", optarg);
break; break;
case 'u':
arg_mode = ID128_PRINT_UUID;
break;
case '?': case '?':
return -EINVAL; return -EINVAL;

View File

@ -16,7 +16,6 @@
#include "pretty-print.h" #include "pretty-print.h"
#include "string-util.h" #include "string-util.h"
#include "syslog-util.h" #include "syslog-util.h"
#include "terminal-util.h"
#include "util.h" #include "util.h"
static const char *arg_identifier = NULL; static const char *arg_identifier = NULL;
@ -32,8 +31,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n" printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"\n%sExecute process with stdout/stderr connected to the journal.%s\n\n" "Execute process with stdout/stderr connected to the journal.\n\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" -t --identifier=STRING Set syslog identifier\n" " -t --identifier=STRING Set syslog identifier\n"
@ -42,7 +41,6 @@ static int help(void) {
" --level-prefix=BOOL Control whether level prefix shall be parsed\n" " --level-prefix=BOOL Control whether level prefix shall be parsed\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );

View File

@ -314,7 +314,7 @@ static int help(void) {
return log_oom(); return log_oom();
printf("%s [OPTIONS...] [MATCHES...]\n\n" printf("%s [OPTIONS...] [MATCHES...]\n\n"
"%sQuery the journal.%s\n\n" "Query the journal.\n\n"
"Options:\n" "Options:\n"
" --system Show the system journal\n" " --system Show the system journal\n"
" --user Show the user journal for the current user\n" " --user Show the user journal for the current user\n"
@ -381,7 +381,6 @@ static int help(void) {
" --setup-keys Generate a new FSS key pair\n" " --setup-keys Generate a new FSS key pair\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );
@ -2048,7 +2047,7 @@ int main(int argc, char *argv[]) {
switch (arg_action) { switch (arg_action) {
case ACTION_NEW_ID128: case ACTION_NEW_ID128:
r = id128_print_new(ID128_PRINT_PRETTY); r = id128_print_new(true);
goto finish; goto finish;
case ACTION_SETUP_KEYS: case ACTION_SETUP_KEYS:

View File

@ -241,7 +241,6 @@ int sd_dhcp_client_set_mac(
DHCP_CLIENT_DONT_DESTROY(client); DHCP_CLIENT_DONT_DESTROY(client);
bool need_restart = false; bool need_restart = false;
int r;
assert_return(client, -EINVAL); assert_return(client, -EINVAL);
assert_return(addr, -EINVAL); assert_return(addr, -EINVAL);
@ -269,11 +268,8 @@ int sd_dhcp_client_set_mac(
client->mac_addr_len = addr_len; client->mac_addr_len = addr_len;
client->arp_type = arp_type; client->arp_type = arp_type;
if (need_restart && client->state != DHCP_STATE_STOPPED) { if (need_restart && client->state != DHCP_STATE_STOPPED)
r = sd_dhcp_client_start(client); sd_dhcp_client_start(client);
if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to restart DHCPv4 client: %m");
}
return 0; return 0;
} }
@ -309,7 +305,6 @@ int sd_dhcp_client_set_client_id(
DHCP_CLIENT_DONT_DESTROY(client); DHCP_CLIENT_DONT_DESTROY(client);
bool need_restart = false; bool need_restart = false;
int r;
assert_return(client, -EINVAL); assert_return(client, -EINVAL);
assert_return(data, -EINVAL); assert_return(data, -EINVAL);
@ -342,11 +337,8 @@ int sd_dhcp_client_set_client_id(
memcpy(&client->client_id.raw.data, data, data_len); memcpy(&client->client_id.raw.data, data, data_len);
client->client_id_len = data_len + sizeof (client->client_id.type); client->client_id_len = data_len + sizeof (client->client_id.type);
if (need_restart && client->state != DHCP_STATE_STOPPED) { if (need_restart && client->state != DHCP_STATE_STOPPED)
r = sd_dhcp_client_start(client); sd_dhcp_client_start(client);
if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to restart DHCPv4 client: %m");
}
return 0; return 0;
} }
@ -376,7 +368,7 @@ static int dhcp_client_set_iaid_duid_internal(
if (duid) { if (duid) {
r = dhcp_validate_duid_len(duid_type, duid_len, true); r = dhcp_validate_duid_len(duid_type, duid_len, true);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to validate length of DUID: %m"); return r;
} }
zero(client->client_id); zero(client->client_id);
@ -391,7 +383,7 @@ static int dhcp_client_set_iaid_duid_internal(
true, true,
&client->client_id.ns.iaid); &client->client_id.ns.iaid);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to set IAID: %m"); return r;
} }
} }
@ -403,32 +395,32 @@ static int dhcp_client_set_iaid_duid_internal(
switch (duid_type) { switch (duid_type) {
case DUID_TYPE_LLT: case DUID_TYPE_LLT:
if (client->mac_addr_len == 0) if (client->mac_addr_len == 0)
return log_dhcp_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LLT, MAC address is not set."); return -EOPNOTSUPP;
r = dhcp_identifier_set_duid_llt(&client->client_id.ns.duid, llt_time, client->mac_addr, client->mac_addr_len, client->arp_type, &len); r = dhcp_identifier_set_duid_llt(&client->client_id.ns.duid, llt_time, client->mac_addr, client->mac_addr_len, client->arp_type, &len);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to set DUID-LLT: %m"); return r;
break; break;
case DUID_TYPE_EN: case DUID_TYPE_EN:
r = dhcp_identifier_set_duid_en(&client->client_id.ns.duid, &len); r = dhcp_identifier_set_duid_en(&client->client_id.ns.duid, &len);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to set DUID-EN: %m"); return r;
break; break;
case DUID_TYPE_LL: case DUID_TYPE_LL:
if (client->mac_addr_len == 0) if (client->mac_addr_len == 0)
return log_dhcp_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LL, MAC address is not set."); return -EOPNOTSUPP;
r = dhcp_identifier_set_duid_ll(&client->client_id.ns.duid, client->mac_addr, client->mac_addr_len, client->arp_type, &len); r = dhcp_identifier_set_duid_ll(&client->client_id.ns.duid, client->mac_addr, client->mac_addr_len, client->arp_type, &len);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to set DUID-LL: %m"); return r;
break; break;
case DUID_TYPE_UUID: case DUID_TYPE_UUID:
r = dhcp_identifier_set_duid_uuid(&client->client_id.ns.duid, &len); r = dhcp_identifier_set_duid_uuid(&client->client_id.ns.duid, &len);
if (r < 0) if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to set DUID-UUID: %m"); return r;
break; break;
default: default:
return log_dhcp_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "Invalid DUID type"); return -EINVAL;
} }
client->client_id_len = sizeof(client->client_id.type) + len + client->client_id_len = sizeof(client->client_id.type) + len +
@ -437,9 +429,7 @@ static int dhcp_client_set_iaid_duid_internal(
if (!IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_STOPPED)) { if (!IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_STOPPED)) {
log_dhcp_client(client, "Configured %sDUID, restarting.", iaid_append ? "IAID+" : ""); log_dhcp_client(client, "Configured %sDUID, restarting.", iaid_append ? "IAID+" : "");
client_stop(client, SD_DHCP_CLIENT_EVENT_STOP); client_stop(client, SD_DHCP_CLIENT_EVENT_STOP);
r = sd_dhcp_client_start(client); sd_dhcp_client_start(client);
if (r < 0)
return log_dhcp_client_errno(client, r, "Failed to restart DHCPv4 client: %m");
} }
return 0; return 0;

View File

@ -232,7 +232,7 @@ static int dhcp6_client_set_duid_internal(
if (r < 0) { if (r < 0) {
r = dhcp_validate_duid_len(duid_type, duid_len, false); r = dhcp_validate_duid_len(duid_type, duid_len, false);
if (r < 0) if (r < 0)
return log_dhcp6_client_errno(client, r, "Failed to validate length of DUID: %m"); return r;
log_dhcp6_client(client, "Setting DUID of type %u with unexpected content", duid_type); log_dhcp6_client(client, "Setting DUID of type %u with unexpected content", duid_type);
} }
@ -243,32 +243,32 @@ static int dhcp6_client_set_duid_internal(
switch (duid_type) { switch (duid_type) {
case DUID_TYPE_LLT: case DUID_TYPE_LLT:
if (client->mac_addr_len == 0) if (client->mac_addr_len == 0)
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LLT, MAC address is not set."); return -EOPNOTSUPP;
r = dhcp_identifier_set_duid_llt(&client->duid, llt_time, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len); r = dhcp_identifier_set_duid_llt(&client->duid, llt_time, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len);
if (r < 0) if (r < 0)
return log_dhcp6_client_errno(client, r, "Failed to set DUID-LLT: %m"); return r;
break; break;
case DUID_TYPE_EN: case DUID_TYPE_EN:
r = dhcp_identifier_set_duid_en(&client->duid, &client->duid_len); r = dhcp_identifier_set_duid_en(&client->duid, &client->duid_len);
if (r < 0) if (r < 0)
return log_dhcp6_client_errno(client, r, "Failed to set DUID-EN: %m"); return r;
break; break;
case DUID_TYPE_LL: case DUID_TYPE_LL:
if (client->mac_addr_len == 0) if (client->mac_addr_len == 0)
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LL, MAC address is not set."); return -EOPNOTSUPP;
r = dhcp_identifier_set_duid_ll(&client->duid, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len); r = dhcp_identifier_set_duid_ll(&client->duid, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len);
if (r < 0) if (r < 0)
return log_dhcp6_client_errno(client, r, "Failed to set DUID-LL: %m"); return r;
break; break;
case DUID_TYPE_UUID: case DUID_TYPE_UUID:
r = dhcp_identifier_set_duid_uuid(&client->duid, &client->duid_len); r = dhcp_identifier_set_duid_uuid(&client->duid, &client->duid_len);
if (r < 0) if (r < 0)
return log_dhcp6_client_errno(client, r, "Failed to set DUID-UUID: %m"); return r;
break; break;
default: default:
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "Invalid DUID type"); return -EINVAL;
} }
return 0; return 0;

View File

@ -383,9 +383,16 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] COMMAND ...\n\n"
"%sQuery or change system locale and keyboard settings.%s\n" "Query or change system locale and keyboard settings.%s\n\n"
"\nCommands:\n" " -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
" --no-convert Don't convert keyboard mappings\n\n"
"Commands:\n"
" status Show current locale settings\n" " status Show current locale settings\n"
" set-locale LOCALE... Set system locale\n" " set-locale LOCALE... Set system locale\n"
" list-locales Show known locales\n" " list-locales Show known locales\n"
@ -398,17 +405,9 @@ static int help(void) {
" list-x11-keymap-variants [LAYOUT]\n" " list-x11-keymap-variants [LAYOUT]\n"
" Show known X11 keyboard mapping variants\n" " Show known X11 keyboard mapping variants\n"
" list-x11-keymap-options Show known X11 keyboard mapping options\n" " list-x11-keymap-options Show known X11 keyboard mapping options\n"
"\nOptions:\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
" --no-convert Don't convert keyboard mappings\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -20,7 +20,6 @@
#include "process-util.h" #include "process-util.h"
#include "signal-util.h" #include "signal-util.h"
#include "strv.h" #include "strv.h"
#include "terminal-util.h"
#include "user-util.h" #include "user-util.h"
#include "util.h" #include "util.h"
@ -159,8 +158,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n" printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"\n%sExecute a process while inhibiting shutdown/sleep/idle.%s\n\n" "Execute a process while inhibiting shutdown/sleep/idle.\n\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -175,7 +174,6 @@ static int help(void) {
" --list List active inhibitors\n" " --list List active inhibitors\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );

View File

@ -1279,8 +1279,8 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
"%sSend control commands to or query the login manager.%s\n" "Send control commands to or query the login manager.%s\n"
"\nSession Commands:\n" "\nSession Commands:\n"
" list-sessions List sessions\n" " list-sessions List sessions\n"
" session-status [ID...] Show session status\n" " session-status [ID...] Show session status\n"
@ -1291,23 +1291,23 @@ static int help(int argc, char *argv[], void *userdata) {
" lock-sessions Screen lock all current sessions\n" " lock-sessions Screen lock all current sessions\n"
" unlock-sessions Screen unlock all current sessions\n" " unlock-sessions Screen unlock all current sessions\n"
" terminate-session ID... Terminate one or more sessions\n" " terminate-session ID... Terminate one or more sessions\n"
" kill-session ID... Send signal to processes of a session\n" " kill-session ID... Send signal to processes of a session\n\n"
"\nUser Commands:\n" "User Commands:\n"
" list-users List users\n" " list-users List users\n"
" user-status [USER...] Show user status\n" " user-status [USER...] Show user status\n"
" show-user [USER...] Show properties of users or the manager\n" " show-user [USER...] Show properties of users or the manager\n"
" enable-linger [USER...] Enable linger state of one or more users\n" " enable-linger [USER...] Enable linger state of one or more users\n"
" disable-linger [USER...] Disable linger state of one or more users\n" " disable-linger [USER...] Disable linger state of one or more users\n"
" terminate-user USER... Terminate all sessions of one or more users\n" " terminate-user USER... Terminate all sessions of one or more users\n"
" kill-user USER... Send signal to processes of a user\n" " kill-user USER... Send signal to processes of a user\n\n"
"\nSeat Commands:\n" "Seat Commands:\n"
" list-seats List seats\n" " list-seats List seats\n"
" seat-status [NAME...] Show seat status\n" " seat-status [NAME...] Show seat status\n"
" show-seat [NAME...] Show properties of seats or the manager\n" " show-seat [NAME...] Show properties of seats or the manager\n"
" attach NAME DEVICE... Attach one or more devices to a seat\n" " attach NAME DEVICE... Attach one or more devices to a seat\n"
" flush-devices Flush all device associations\n" " flush-devices Flush all device associations\n"
" terminate-seat NAME... Terminate all sessions on one or more seats\n" " terminate-seat NAME... Terminate all sessions on one or more seats\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -1328,8 +1328,8 @@ static int help(int argc, char *argv[], void *userdata) {
" json, json-pretty, json-sse, json-seq, cat,\n" " json, json-pretty, json-sse, json-seq, cat,\n"
" with-unit)\n" " with-unit)\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -2690,9 +2690,9 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
"%sSend control commands to or query the virtual machine and container%s\n" "Send control commands to or query the virtual machine and container\n"
"%sregistration manager.%s\n" "registration manager.%s\n"
"\nMachine Commands:\n" "\nMachine Commands:\n"
" list List running VMs and containers\n" " list List running VMs and containers\n"
" status NAME... Show VM/container details\n" " status NAME... Show VM/container details\n"
@ -2732,7 +2732,7 @@ static int help(int argc, char *argv[], void *userdata) {
" export-raw NAME [FILE] Export a RAW container or VM image locally\n" " export-raw NAME [FILE] Export a RAW container or VM image locally\n"
" list-transfers Show list of downloads in progress\n" " list-transfers Show list of downloads in progress\n"
" cancel-transfer Cancel a download\n" " cancel-transfer Cancel a download\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -2762,10 +2762,8 @@ static int help(int argc, char *argv[], void *userdata) {
" checksum, signature)\n" " checksum, signature)\n"
" --force Download image even if already exists\n" " --force Download image even if already exists\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, ansi_highlight()
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, ansi_highlight()
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -1887,8 +1887,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND\n\n" printf("%s%s [OPTIONS...]\n\n"
"%sQuery and control the networking subsystem.%s\n" "Query and control the networking subsystem.%s\n"
"\nCommands:\n" "\nCommands:\n"
" list [PATTERN...] List links\n" " list [PATTERN...] List links\n"
" status [PATTERN...] Show link status\n" " status [PATTERN...] Show link status\n"
@ -1898,7 +1898,7 @@ static int help(void) {
" renew DEVICES... Renew dynamic configurations\n" " renew DEVICES... Renew dynamic configurations\n"
" reconfigure DEVICES... Reconfigure interfaces\n" " reconfigure DEVICES... Reconfigure interfaces\n"
" reload Reload .network and .netdev files\n" " reload Reload .network and .netdev files\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -1906,8 +1906,8 @@ static int help(void) {
" -a --all Show status for all links\n" " -a --all Show status for all links\n"
" -s --stats Show detailed link statics\n" " -s --stats Show detailed link statics\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -200,14 +200,14 @@ int dhcp4_server_configure(Link *link) {
address = link_find_dhcp_server_address(link); address = link_find_dhcp_server_address(link);
if (!address) if (!address)
return log_link_error_errno(link, SYNTHETIC_ERRNO(EBUSY), return log_link_warning_errno(link, SYNTHETIC_ERRNO(EBUSY),
"Failed to find suitable address for DHCPv4 server instance."); "Failed to find suitable address for DHCPv4 server instance.");
/* use the server address' subnet as the pool */ /* use the server address' subnet as the pool */
r = sd_dhcp_server_configure_pool(link->dhcp_server, &address->in_addr.in, address->prefixlen, r = sd_dhcp_server_configure_pool(link->dhcp_server, &address->in_addr.in, address->prefixlen,
link->network->dhcp_server_pool_offset, link->network->dhcp_server_pool_size); link->network->dhcp_server_pool_offset, link->network->dhcp_server_pool_size);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Failed to configure address pool for DHCPv4 server instance: %m"); return r;
/* TODO: /* TODO:
r = sd_dhcp_server_set_router(link->dhcp_server, &main_address->in_addr.in); r = sd_dhcp_server_set_router(link->dhcp_server, &main_address->in_addr.in);
@ -219,14 +219,14 @@ int dhcp4_server_configure(Link *link) {
r = sd_dhcp_server_set_max_lease_time(link->dhcp_server, r = sd_dhcp_server_set_max_lease_time(link->dhcp_server,
DIV_ROUND_UP(link->network->dhcp_server_max_lease_time_usec, USEC_PER_SEC)); DIV_ROUND_UP(link->network->dhcp_server_max_lease_time_usec, USEC_PER_SEC));
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Failed to set maximum lease time for DHCPv4 server instance: %m"); return r;
} }
if (link->network->dhcp_server_default_lease_time_usec > 0) { if (link->network->dhcp_server_default_lease_time_usec > 0) {
r = sd_dhcp_server_set_default_lease_time(link->dhcp_server, r = sd_dhcp_server_set_default_lease_time(link->dhcp_server,
DIV_ROUND_UP(link->network->dhcp_server_default_lease_time_usec, USEC_PER_SEC)); DIV_ROUND_UP(link->network->dhcp_server_default_lease_time_usec, USEC_PER_SEC));
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Failed to set default lease time for DHCPv4 server instance: %m"); return r;
} }
if (link->network->dhcp_server_emit_dns) { if (link->network->dhcp_server_emit_dns) {
@ -302,7 +302,7 @@ int dhcp4_server_configure(Link *link) {
r = sd_dhcp_server_set_timezone(link->dhcp_server, tz); r = sd_dhcp_server_set_timezone(link->dhcp_server, tz);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Failed to set timezone for DHCP server: %m"); return r;
} }
ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_raw_options, i) { ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_raw_options, i) {
@ -310,7 +310,7 @@ int dhcp4_server_configure(Link *link) {
if (r == -EEXIST) if (r == -EEXIST)
continue; continue;
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Failed to set DHCPv4 option: %m"); return r;
} }
if (!sd_dhcp_server_is_running(link->dhcp_server)) { if (!sd_dhcp_server_is_running(link->dhcp_server)) {

View File

@ -781,9 +781,9 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n\n" printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
"%sAttach or detach portable services from the local system.%s\n" "Attach or detach portable services from the local system.%s\n"
"\nCommands:\n" "Commands:\n"
" list List available portable service images\n" " list List available portable service images\n"
" attach NAME|PATH [PREFIX...]\n" " attach NAME|PATH [PREFIX...]\n"
" Attach the specified portable service image\n" " Attach the specified portable service image\n"
@ -794,7 +794,7 @@ static int help(int argc, char *argv[], void *userdata) {
" read-only NAME|PATH [BOOL] Mark or unmark portable service image read-only\n" " read-only NAME|PATH [BOOL] Mark or unmark portable service image read-only\n"
" remove NAME|PATH... Remove a portable service image\n" " remove NAME|PATH... Remove a portable service image\n"
" set-limit [NAME|PATH] Set image or pool size limit (disk quota)\n" " set-limit [NAME|PATH] Set image or pool size limit (disk quota)\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -810,8 +810,8 @@ static int help(int argc, char *argv[], void *userdata) {
" --cat When inspecting include unit and os-release file\n" " --cat When inspecting include unit and os-release file\n"
" contents\n" " contents\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -2473,7 +2473,7 @@ static int compat_help(void) {
"%1$s [OPTIONS...] --statistics\n" "%1$s [OPTIONS...] --statistics\n"
"%1$s [OPTIONS...] --reset-statistics\n" "%1$s [OPTIONS...] --reset-statistics\n"
"\n" "\n"
"%2$sResolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%3$s\n\n" "Resolve domain names, IPv4 and IPv6 addresses, DNS records, and services.\n\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -2507,10 +2507,8 @@ static int compat_help(void) {
" --set-dnssec=MODE Set per-interface DNSSEC mode\n" " --set-dnssec=MODE Set per-interface DNSSEC mode\n"
" --set-nta=DOMAIN Set per-interface DNSSEC NTA\n" " --set-nta=DOMAIN Set per-interface DNSSEC NTA\n"
" --revert Revert per-interface configuration\n" " --revert Revert per-interface configuration\n"
"\nSee the %4$s for details.\n" "\nSee the %2$s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link , link
); );
@ -2525,10 +2523,10 @@ static int native_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n" printf("%s%s [OPTIONS...] {COMMAND} ...\n"
"\n" "\n"
"%sSend control commands to the network name resolution manager, or%s\n" "Send control commands to the network name resolution manager, or\n"
"%sresolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%s\n" "resolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%s\n"
"\nCommands:\n" "\nCommands:\n"
" query HOSTNAME|ADDRESS... Resolve domain names, IPv4 and IPv6 addresses\n" " query HOSTNAME|ADDRESS... Resolve domain names, IPv4 and IPv6 addresses\n"
" service [[NAME] TYPE] DOMAIN Resolve service (SRV)\n" " service [[NAME] TYPE] DOMAIN Resolve service (SRV)\n"
@ -2548,7 +2546,7 @@ static int native_help(void) {
" dnssec [LINK [MODE]] Get/set per-interface DNSSEC mode\n" " dnssec [LINK [MODE]] Get/set per-interface DNSSEC mode\n"
" nta [LINK [DOMAIN...]] Get/set per-interface DNSSEC NTA\n" " nta [LINK [DOMAIN...]] Get/set per-interface DNSSEC NTA\n"
" revert LINK Revert per-interface configuration\n" " revert LINK Revert per-interface configuration\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -2566,10 +2564,8 @@ static int native_help(void) {
" --raw[=payload|packet] Dump the answer as binary data\n" " --raw[=payload|packet] Dump the answer as binary data\n"
" --legend=BOOL Print headers and additional info (default: yes)\n" " --legend=BOOL Print headers and additional info (default: yes)\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, ansi_highlight()
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, ansi_highlight()
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -84,8 +84,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND [ARGUMENTS...]\n" printf("%s [OPTIONS...] {COMMAND} [ARGS...]\n\n"
"\n%sRun the specified command in a transient scope or service.%s\n\n" "Run the specified command in a transient scope or service.\n\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --no-ask-password Do not prompt for password\n" " --no-ask-password Do not prompt for password\n"
@ -130,7 +130,6 @@ static int help(void) {
" --timer-property=NAME=VALUE Set timer unit property\n" " --timer-property=NAME=VALUE Set timer unit property\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );

View File

@ -10,22 +10,15 @@
#include "pretty-print.h" #include "pretty-print.h"
#include "terminal-util.h" #include "terminal-util.h"
int id128_pretty_print(sd_id128_t id, Id128PrettyPrintMode mode) { int id128_pretty_print(sd_id128_t id, bool pretty) {
unsigned i;
_cleanup_free_ char *man_link = NULL, *mod_link = NULL; _cleanup_free_ char *man_link = NULL, *mod_link = NULL;
const char *on, *off; const char *on, *off;
unsigned i;
assert(mode >= 0); if (!pretty) {
assert(mode < _ID128_PRETTY_PRINT_MODE_MAX);
if (mode == ID128_PRINT_ID128) {
printf(SD_ID128_FORMAT_STR "\n", printf(SD_ID128_FORMAT_STR "\n",
SD_ID128_FORMAT_VAL(id)); SD_ID128_FORMAT_VAL(id));
return 0; return 0;
} else if (mode == ID128_PRINT_UUID) {
printf(SD_ID128_UUID_FORMAT_STR "\n",
SD_ID128_FORMAT_VAL(id));
return 0;
} }
on = ansi_highlight(); on = ansi_highlight();
@ -42,7 +35,7 @@ int id128_pretty_print(sd_id128_t id, Id128PrettyPrintMode mode) {
"As UUID:\n" "As UUID:\n"
"%s" SD_ID128_UUID_FORMAT_STR "%s\n\n" "%s" SD_ID128_UUID_FORMAT_STR "%s\n\n"
"As %s macro:\n" "As %s macro:\n"
"%s#define XYZ SD_ID128_MAKE(", "%s#define MESSAGE_XYZ SD_ID128_MAKE(",
on, SD_ID128_FORMAT_VAL(id), off, on, SD_ID128_FORMAT_VAL(id), off,
on, SD_ID128_FORMAT_VAL(id), off, on, SD_ID128_FORMAT_VAL(id), off,
man_link, man_link,
@ -53,14 +46,14 @@ int id128_pretty_print(sd_id128_t id, Id128PrettyPrintMode mode) {
printf("As Python constant:\n" printf("As Python constant:\n"
">>> import %s\n" ">>> import %s\n"
">>> %sXYZ = uuid.UUID('" SD_ID128_FORMAT_STR "')%s\n", ">>> %sMESSAGE_XYZ = uuid.UUID('" SD_ID128_FORMAT_STR "')%s\n",
mod_link, mod_link,
on, SD_ID128_FORMAT_VAL(id), off); on, SD_ID128_FORMAT_VAL(id), off);
return 0; return 0;
} }
int id128_print_new(Id128PrettyPrintMode mode) { int id128_print_new(bool pretty) {
sd_id128_t id; sd_id128_t id;
int r; int r;
@ -68,5 +61,5 @@ int id128_print_new(Id128PrettyPrintMode mode) {
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to generate ID: %m"); return log_error_errno(r, "Failed to generate ID: %m");
return id128_pretty_print(id, mode); return id128_pretty_print(id, pretty);
} }

View File

@ -6,13 +6,5 @@
#include "sd-id128.h" #include "sd-id128.h"
typedef enum Id128PrettyPrintMode { int id128_pretty_print(sd_id128_t id, bool pretty);
ID128_PRINT_ID128, int id128_print_new(bool pretty);
ID128_PRINT_UUID,
ID128_PRINT_PRETTY,
_ID128_PRETTY_PRINT_MODE_MAX,
_ID128_PRETTY_PRINT_MODE_INVALID = -1
} Id128PrettyPrintMode;
int id128_pretty_print(sd_id128_t id, Id128PrettyPrintMode mode);
int id128_print_new(Id128PrettyPrintMode mode);

View File

@ -7694,9 +7694,9 @@ static int systemctl_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%1$s [OPTIONS...] COMMAND ...\n\n" printf("%5$s%1$s [OPTIONS...] {COMMAND} ...\n\n"
"%5$sQuery or send control commands to the system manager.%6$s\n" "Query or send control commands to the systemd manager.%6$s\n\n"
"\n%3$sUnit Commands:%4$s\n" "%3$sUnit Commands:%4$s\n"
" list-units [PATTERN...] List units currently in memory\n" " list-units [PATTERN...] List units currently in memory\n"
" list-sockets [PATTERN...] List socket units currently in memory,\n" " list-sockets [PATTERN...] List socket units currently in memory,\n"
" ordered by address\n" " ordered by address\n"
@ -7727,8 +7727,8 @@ static int systemctl_help(void) {
" units\n" " units\n"
" list-dependencies [UNIT] Recursively show units which are required\n" " list-dependencies [UNIT] Recursively show units which are required\n"
" or wanted by this unit or by which this\n" " or wanted by this unit or by which this\n"
" unit is required or wanted\n" " unit is required or wanted\n\n"
"\n%3$sUnit File Commands:%4$s\n" "%3$sUnit File Commands:%4$s\n"
" list-unit-files [PATTERN...] List installed unit files\n" " list-unit-files [PATTERN...] List installed unit files\n"
" enable [UNIT...|PATH...] Enable one or more unit files\n" " enable [UNIT...|PATH...] Enable one or more unit files\n"
" disable UNIT... Disable one or more unit files\n" " disable UNIT... Disable one or more unit files\n"
@ -7750,21 +7750,21 @@ static int systemctl_help(void) {
" on specified one or more units\n" " on specified one or more units\n"
" edit UNIT... Edit one or more unit files\n" " edit UNIT... Edit one or more unit files\n"
" get-default Get the name of the default target\n" " get-default Get the name of the default target\n"
" set-default TARGET Set the default target\n" " set-default TARGET Set the default target\n\n"
"\n%3$sMachine Commands:%4$s\n" "%3$sMachine Commands:%4$s\n"
" list-machines [PATTERN...] List local containers and host\n\n" " list-machines [PATTERN...] List local containers and host\n\n"
"\n%3$sJob Commands:%4$s\n" "%3$sJob Commands:%4$s\n"
" list-jobs [PATTERN...] List jobs\n" " list-jobs [PATTERN...] List jobs\n"
" cancel [JOB...] Cancel all, one, or more jobs\n" " cancel [JOB...] Cancel all, one, or more jobs\n\n"
"\n%3$sEnvironment Commands:%4$s\n" "%3$sEnvironment Commands:%4$s\n"
" show-environment Dump environment\n" " show-environment Dump environment\n"
" set-environment VARIABLE=VALUE... Set one or more environment variables\n" " set-environment VARIABLE=VALUE... Set one or more environment variables\n"
" unset-environment VARIABLE... Unset one or more environment variables\n" " unset-environment VARIABLE... Unset one or more environment variables\n"
" import-environment [VARIABLE...] Import all or some environment variables\n\n" " import-environment [VARIABLE...] Import all or some environment variables\n\n"
"\n%3$sManager Lifecycle Commands:%4$s\n" "%3$sManager Lifecycle Commands:%4$s\n"
" daemon-reload Reload systemd manager configuration\n" " daemon-reload Reload systemd manager configuration\n"
" daemon-reexec Reexecute systemd manager\n" " daemon-reexec Reexecute systemd manager\n\n"
"\n%3$sSystem Commands:%4$s\n" "%3$sSystem Commands:%4$s\n"
" is-system-running Check whether system is fully running\n" " is-system-running Check whether system is fully running\n"
" default Enter system default mode\n" " default Enter system default mode\n"
" rescue Enter system rescue mode\n" " rescue Enter system rescue mode\n"
@ -7780,7 +7780,7 @@ static int systemctl_help(void) {
" hybrid-sleep Hibernate and suspend the system\n" " hybrid-sleep Hibernate and suspend the system\n"
" suspend-then-hibernate Suspend the system, wake after a period of\n" " suspend-then-hibernate Suspend the system, wake after a period of\n"
" time and put it into hibernate\n" " time and put it into hibernate\n"
"\n%3$sOptions:%4$s\n" "\nOptions\n"
" -h --help Show this help\n" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" --system Connect to system manager\n" " --system Connect to system manager\n"
@ -7859,9 +7859,8 @@ static int halt_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...]%s\n" printf("%s [OPTIONS...]%s\n\n"
"\n%s%s the system.%s\n" "%s the system.\n\n"
"\nOptions:\n"
" --help Show this help\n" " --help Show this help\n"
" --halt Halt the machine\n" " --halt Halt the machine\n"
" -p --poweroff Switch off the machine\n" " -p --poweroff Switch off the machine\n"
@ -7872,12 +7871,10 @@ static int halt_help(void) {
" --no-wall Don't send wall message before halt/power-off/reboot\n" " --no-wall Don't send wall message before halt/power-off/reboot\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, arg_action == ACTION_REBOOT ? " [ARG]" : "" , arg_action == ACTION_REBOOT ? " [ARG]" : "",
, ansi_highlight() arg_action == ACTION_REBOOT ? "Reboot" :
, arg_action == ACTION_REBOOT ? "Reboot" :
arg_action == ACTION_POWEROFF ? "Power off" : arg_action == ACTION_POWEROFF ? "Power off" :
"Halt" "Halt"
, ansi_normal()
, link , link
); );
@ -7892,9 +7889,8 @@ static int shutdown_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] [TIME] [WALL...]\n" printf("%s [OPTIONS...] [TIME] [WALL...]\n\n"
"\n%sShut down the system.%s\n" "Shut down the system.\n\n"
"\nOptions:\n"
" --help Show this help\n" " --help Show this help\n"
" -H --halt Halt the machine\n" " -H --halt Halt the machine\n"
" -P --poweroff Power-off the machine\n" " -P --poweroff Power-off the machine\n"
@ -7905,7 +7901,6 @@ static int shutdown_help(void) {
" -c Cancel a pending shutdown\n" " -c Cancel a pending shutdown\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );
@ -7920,21 +7915,19 @@ static int telinit_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND\n\n" printf("%s [OPTIONS...] {COMMAND}\n\n"
"%sSend control commands to the init daemon.%s\n" "Send control commands to the init daemon.\n\n"
"\nCommands:\n" " --help Show this help\n"
" --no-wall Don't send wall message before halt/power-off/reboot\n\n"
"Commands:\n"
" 0 Power-off the machine\n" " 0 Power-off the machine\n"
" 6 Reboot the machine\n" " 6 Reboot the machine\n"
" 2, 3, 4, 5 Start runlevelX.target unit\n" " 2, 3, 4, 5 Start runlevelX.target unit\n"
" 1, s, S Enter rescue mode\n" " 1, s, S Enter rescue mode\n"
" q, Q Reload init daemon configuration\n" " q, Q Reload init daemon configuration\n"
" u, U Reexecute init daemon\n" " u, U Reexecute init daemon\n"
"\nOptions:\n"
" --help Show this help\n"
" --no-wall Don't send wall message before halt/power-off/reboot\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );
@ -7949,13 +7942,11 @@ static int runlevel_help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...]\n" printf("%s [OPTIONS...]\n\n"
"\n%sPrints the previous and current runlevel of the init system.%s\n" "Prints the previous and current runlevel of the init system.\n\n"
"\nOptions:\n"
" --help Show this help\n" " --help Show this help\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name , program_invocation_short_name
, ansi_highlight(), ansi_normal()
, link , link
); );
@ -8534,7 +8525,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
/* Output an error mimicking getopt, and print a hint afterwards */ /* Output an error mimicking getopt, and print a hint afterwards */
log_error("%s: invalid option -- '.'", program_invocation_name); log_error("%s: invalid option -- '.'", program_invocation_name);
log_notice("Hint: to specify units starting with a dash, use \"--\":\n" log_notice("Hint: to specify units starting with a dash, use \"--\":\n"
" %s [OPTIONS...] COMMAND -- -.%s ...", " %s [OPTIONS...] {COMMAND} -- -.%s ...",
program_invocation_name, optarg ?: "mount"); program_invocation_name, optarg ?: "mount");
_fallthrough_; _fallthrough_;

View File

@ -810,8 +810,8 @@ static int help(void) {
if (r < 0) if (r < 0)
return log_oom(); return log_oom();
printf("%s [OPTIONS...] COMMAND ...\n" printf("%s%s [OPTIONS...] COMMAND ...\n\n"
"\n%sQuery or change system time and date settings.%s\n" "Query or change system time and date settings.%s\n"
"\nCommands:\n" "\nCommands:\n"
" status Show current time settings\n" " status Show current time settings\n"
" show Show properties of systemd-timedated\n" " show Show properties of systemd-timedated\n"
@ -820,10 +820,11 @@ static int help(void) {
" list-timezones Show known time zones\n" " list-timezones Show known time zones\n"
" set-local-rtc BOOL Control whether RTC is in local time\n" " set-local-rtc BOOL Control whether RTC is in local time\n"
" set-ntp BOOL Enable or disable network time synchronization\n" " set-ntp BOOL Enable or disable network time synchronization\n"
"\nsystemd-timesyncd Commands:\n" "\n"
"systemd-timesyncd Commands:\n"
" timesync-status Show status of systemd-timesyncd\n" " timesync-status Show status of systemd-timesyncd\n"
" show-timesync Show properties of systemd-timesyncd\n" " show-timesync Show properties of systemd-timesyncd\n"
"\nOptions:\n" "\nOptions\n"
" -h --help Show this help message\n" " -h --help Show this help message\n"
" --version Show package version\n" " --version Show package version\n"
" --no-pager Do not pipe output into a pager\n" " --no-pager Do not pipe output into a pager\n"
@ -836,8 +837,8 @@ static int help(void) {
" -a --all Show all properties, including empty ones\n" " -a --all Show all properties, including empty ones\n"
" --value When showing properties, only print the value\n" " --value When showing properties, only print the value\n"
"\nSee the %s for details.\n" "\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight() , ansi_highlight()
, program_invocation_short_name
, ansi_normal() , ansi_normal()
, link , link
); );

View File

@ -751,7 +751,10 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp
if (op == OP_REMOVE) if (op == OP_REMOVE)
return log_token_invalid_op(rules, key); return log_token_invalid_op(rules, key);
if (!is_match) { if (!is_match) {
log_token_debug(rules, "%s key takes '==' or '!=' operator, assuming '=='.", key); if (op == OP_ASSIGN)
log_token_debug(rules, "Operator '=' is specified to %s key, assuming '=='.", key);
else
log_token_warning(rules, "%s key takes '==' or '!=' operator, assuming '==', but please fix it.", key);
op = OP_MATCH; op = OP_MATCH;
} }
@ -763,7 +766,10 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp
if (op == OP_REMOVE) if (op == OP_REMOVE)
return log_token_invalid_op(rules, key); return log_token_invalid_op(rules, key);
if (!is_match) { if (!is_match) {
log_token_debug(rules, "%s key takes '==' or '!=' operator, assuming '=='.", key); if (op == OP_ASSIGN)
log_token_debug(rules, "Operator '=' is specified to %s key, assuming '=='.", key);
else
log_token_warning(rules, "%s key takes '==' or '!=' operator, assuming '==', but please fix it.", key);
op = OP_MATCH; op = OP_MATCH;
} }

View File

@ -45,13 +45,10 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER); r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0) { if (r < 0) {
bool ignore = IN_SET(r, -ENOENT, -EACCES, -ENODEV, -EROFS); bool ignore = IN_SET(r, -ENOENT, -EACCES, -ENODEV);
log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r, log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r,
"Failed to write '%s' to '%s'%s: %m", "Failed to write '%s' to '%s': %m", action, filename);
action, filename, ignore ? ", ignoring" : "");
if (r == -EROFS)
return 0; /* Read only filesystem. Return earlier. */
if (ret == 0 && !ignore) if (ret == 0 && !ignore)
ret = r; ret = r;
continue; continue;