udevd \- event managing daemon
.SH "SYNOPSIS"
.HP 6
-\fBudevd\fR [\fB\-\-daemon\fR] [\fB\-\-help\fR]
+\fBudevd\fR [\fB\-\-daemon\fR] [\fB\-\-verbose\fR] [\fB\-\-help\fR]
.HP 20
\fBudevcontrol \fR\fB\fIcommand\fR\fR
.SH "DESCRIPTION"
\fB\-\-daemon\fR
Detach and run in the background.
.TP 3n
+\fB\-\-verbose\fR
+Print log messages to stdout.
+.TP 3n
\fB\-\-help\fR
Print usage.
.TP 3n
#include "udevd.h"
#include "udev_selinux.h"
+static int verbose;
+
static struct udev_rules rules;
static int udevd_sock = -1;
static int uevent_netlink_sock = -1;
va_start(args, format);
vsyslog(priority, format, args);
va_end(args);
+
+ if (verbose) {
+ va_start(args, format);
+ vprintf(format, args);
+ va_end(args);
+ printf("\n");
+ }
}
#endif
int option;
static const struct option options[] = {
{ "daemon", 0, NULL, 'd' },
+ { "verbose", 0, NULL, 'v' },
{ "help", 0, NULL, 'h' },
{}
};
case 'd':
daemonize = 1;
break;
+ case 'v':
+ verbose = 1;
+ if (udev_log_priority < LOG_INFO)
+ udev_log_priority = LOG_INFO;
+ break;
case 'h':
- printf("Usage: udevd [--help] [--daemon]\n");
+ printf("Usage: udevd [--help] [--daemon] [--verbose]\n");
goto exit;
default:
goto exit;
fd = open("/dev/null", O_RDWR);
if (fd >= 0) {
dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
+ if (!verbose)
+ dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
if (fd > STDERR_FILENO)
close(fd);
<cmdsynopsis>
<command>udevd</command>
<arg><option>--daemon</option></arg>
+ <arg><option>--verbose</option></arg>
<arg><option>--help</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<para>Detach and run in the background.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--verbose</option></term>
+ <listitem>
+ <para>Print log messages to stdout.</para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><option>--help</option></term>
<listitem>