</varlistentry>
<varlistentry>
- <term><option>--no-man</option></term>
+ <term><option>--man=no</option></term>
<listitem><para>Do not invoke man to verify the existence of
man pages listed in <varname>Documentation=</varname>.
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--generators</option></term>
+
+ <listitem><para>Invoke unit generators, see
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
+ Some generators require root privileges. When run under a
+ normal users, enabling generators will generally result in
+ some warnings.</para></listitem>
+ </varlistentry>
+
<xi:include href="user-system-options.xml" xpointer="host" />
<xi:include href="user-system-options.xml" xpointer="machine" />
return r;
}
-int verify_units(char **filenames, UnitFileScope scope, bool check_man) {
+int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
_cleanup_(sd_bus_error_free) sd_bus_error err = SD_BUS_ERROR_NULL;
_cleanup_free_ char *var = NULL;
Manager *m = NULL;
Unit *units[strv_length(filenames)];
int i, count = 0;
+ const uint8_t flags = MANAGER_TEST_RUN_ENV_GENERATORS |
+ run_generators * MANAGER_TEST_RUN_GENERATORS;
if (strv_isempty(filenames))
return 0;
assert_se(set_unit_path(var) >= 0);
- r = manager_new(scope, MANAGER_TEST_RUN_ENV_GENERATORS, &m);
+ r = manager_new(scope, flags, &m);
if (r < 0)
return log_error_errno(r, "Failed to initialize manager: %m");
static char *arg_host = NULL;
static bool arg_user = false;
static bool arg_man = true;
+static bool arg_generators = false;
struct boot_times {
usec_t firmware_time;
" --fuzz=SECONDS Also print also services which finished SECONDS\n"
" earlier than the latest in the branch\n"
" --man[=BOOL] Do [not] check for existence of man pages\n\n"
+ " --generators[=BOOL] Do [not] run unit generators (requires privileges)\n\n"
"Commands:\n"
" time Print time spent in the kernel\n"
" blame Print list of running units ordered by time to init\n"
ARG_FUZZ,
ARG_NO_PAGER,
ARG_MAN,
+ ARG_GENERATORS,
};
static const struct option options[] = {
{ "fuzz", required_argument, NULL, ARG_FUZZ },
{ "no-pager", no_argument, NULL, ARG_NO_PAGER },
{ "man", optional_argument, NULL, ARG_MAN },
+ { "generators", optional_argument, NULL, ARG_GENERATORS },
{ "host", required_argument, NULL, 'H' },
{ "machine", required_argument, NULL, 'M' },
{}
break;
+ case ARG_GENERATORS:
+ if (optarg) {
+ r = parse_boolean(optarg);
+ if (r < 0) {
+ log_error("Failed to parse --generators= argument.");
+ return -EINVAL;
+ }
+
+ arg_generators = !!r;
+ } else
+ arg_generators = true;
+
+ break;
+
case '?':
return -EINVAL;
if (streq_ptr(argv[optind], "verify"))
r = verify_units(argv+optind+1,
arg_user ? UNIT_FILE_USER : UNIT_FILE_SYSTEM,
- arg_man);
+ arg_man,
+ arg_generators);
else {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;