[libvirt] [PATCH 1/4] Fix man page file paths to real paths

Currently the man page has paths that start with @sysconfdir@, @localstatedir@ and @remote_pid_file@. The sed command attempts to replace these during the build but unfortunately pod2man gets to the files first and escapes the @ character resulting in the sed not working. This removes the @ character and makes the paths correct. --- daemon/Makefile.am | 6 +++--- daemon/libvirtd.pod.in | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 928aeaf..c15c785 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -85,9 +85,9 @@ CLEANFILES += test_libvirtd.aug libvirtd.8: $(srcdir)/libvirtd.8.in sed \ - -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \ - -e 's![@]localstatedir[@]!$(localstatedir)!g' \ - -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \ + -e 's!SYSCONFDIR!$(sysconfdir)!g' \ + -e 's!LOCALSTATEDIR!$(localstatedir)!g' \ + -e 's!REMOTE_PID_FILE!$(REMOTE_PID_FILE)!g' \ < $< > $@-t mv $@-t $@ diff --git a/daemon/libvirtd.pod.in b/daemon/libvirtd.pod.in index 57a3b27..7dc8d83 100644 --- a/daemon/libvirtd.pod.in +++ b/daemon/libvirtd.pod.in @@ -77,14 +77,14 @@ On receipt of B<SIGHUP> libvirtd will reload its configuration. =over -=item F<@sysconfdir@/libvirtd.conf> +=item F<SYSCONFDIR/libvirtd.conf> The default configuration file used by libvirtd, unless overridden on the command line using the B<-f>|B<--config> option. -=item F<@localstatedir@/run/libvirt/libvirt-sock> +=item F<LOCALSTATEDIR/run/libvirt/libvirt-sock> -=item F<@localstatedir@/run/libvirt/libvirt-sock-ro> +=item F<LOCALSTATEDIR/run/libvirt/libvirt-sock-ro> The sockets libvirtd will use when B<run as root>. @@ -92,19 +92,19 @@ The sockets libvirtd will use when B<run as root>. The socket libvirtd will use when run as a B<non-root> user. -=item F<@sysconfdir@/pki/CA/cacert.pem> +=item F<SYSCONFDIR/pki/CA/cacert.pem> The TLS B<Certificate Authority> certificate libvirtd will use. -=item F<@sysconfdir@/pki/libvirt/servercert.pem> +=item F<SYSCONFDIR/pki/libvirt/servercert.pem> The TLS B<Server> certificate libvirtd will use. -=item F<@sysconfdir@/pki/libvirt/private/serverkey.pem> +=item F<SYSCONFDIR/pki/libvirt/private/serverkey.pem> The TLS B<Server> private key libvirtd will use. -=item F<@remote_pid_file@> +=item F<REMOTE_PID_FILE> The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. @@ -121,8 +121,8 @@ To retrieve the version of libvirtd: To start libvirtd, instructing it to daemonize and create a PID file: # libvirtd -d - # ls -la @remote_pid_file@ - -rw-r--r-- 1 root root 6 Jul 9 02:40 @remote_pid_file@ + # ls -la REMOTE_PID_FILE + -rw-r--r-- 1 root root 6 Jul 9 02:40 REMOTE_PID_FILE # =head1 BUGS -- 1.7.8.6

REMOTE_PID_FILE is no longer used in the source or the build process but the man page still used it resulting in no file name being displayed. The same value that the libvirtd daemon code uses is now used in the man page. --- daemon/Makefile.am | 4 +--- daemon/libvirtd.pod.in | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index c15c785..b00fc13 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -87,7 +87,6 @@ libvirtd.8: $(srcdir)/libvirtd.8.in sed \ -e 's!SYSCONFDIR!$(sysconfdir)!g' \ -e 's!LOCALSTATEDIR!$(localstatedir)!g' \ - -e 's!REMOTE_PID_FILE!$(REMOTE_PID_FILE)!g' \ < $< > $@-t mv $@-t $@ @@ -99,8 +98,7 @@ libvirtd_CFLAGS = \ $(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \ $(WARN_CFLAGS) \ $(COVERAGE_CFLAGS) \ - -DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \ - -DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" + -DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" libvirtd_LDFLAGS = \ $(WARN_CFLAGS) \ diff --git a/daemon/libvirtd.pod.in b/daemon/libvirtd.pod.in index 7dc8d83..2b68cab 100644 --- a/daemon/libvirtd.pod.in +++ b/daemon/libvirtd.pod.in @@ -104,7 +104,7 @@ The TLS B<Server> certificate libvirtd will use. The TLS B<Server> private key libvirtd will use. -=item F<REMOTE_PID_FILE> +=item F<LOCALSTATEDIR/run/libvirtd.pid> The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. @@ -121,8 +121,8 @@ To retrieve the version of libvirtd: To start libvirtd, instructing it to daemonize and create a PID file: # libvirtd -d - # ls -la REMOTE_PID_FILE - -rw-r--r-- 1 root root 6 Jul 9 02:40 REMOTE_PID_FILE + # ls -la LOCALSTATEDIR/run/libvirtd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 LOCALSTATEDIR/run/libvirtd.pid # =head1 BUGS -- 1.7.8.6

Updated the paths in the man page to reflect what the code in libvirtd does. In addition broke out the FILES section into two subsections for files used when run as root and files used when run as non-root. Provided information about the defaults that libvirtd uses when running as non-root and when XDG_CONFIG_HOME and XDG_RUNTIME_DIR are not set in the environment. --- daemon/libvirtd.pod.in | 43 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 38 insertions(+), 5 deletions(-) diff --git a/daemon/libvirtd.pod.in b/daemon/libvirtd.pod.in index 2b68cab..930b752 100644 --- a/daemon/libvirtd.pod.in +++ b/daemon/libvirtd.pod.in @@ -75,6 +75,8 @@ On receipt of B<SIGHUP> libvirtd will reload its configuration. =head1 FILES +=head2 When run as B<root>. + =over =item F<SYSCONFDIR/libvirtd.conf> @@ -86,11 +88,7 @@ command line using the B<-f>|B<--config> option. =item F<LOCALSTATEDIR/run/libvirt/libvirt-sock-ro> -The sockets libvirtd will use when B<run as root>. - -=item F<$XDG_RUNTIME_DIR/libvirt/libvirt-sock> - -The socket libvirtd will use when run as a B<non-root> user. +The sockets libvirtd will use. =item F<SYSCONFDIR/pki/CA/cacert.pem> @@ -110,6 +108,41 @@ The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. =back +=head2 When run as B<non-root>. + +=over + +=item F<$XDG_CONFIG_HOME/libvirtd.conf> + +The default configuration file used by libvirtd, unless overridden on the +command line using the B<-f>|B<--config> option. + +=item F<$XDG_RUNTIME_DIR/libvirt/libvirt-sock> + +The socket libvirtd will use. + +=item F<$HOME/.pki/libvirt/cacert.pem> + +The TLS B<Certificate Authority> certificate libvirtd will use. + +=item F<$HOME/.pki/libvirt/servercert.pem> + +The TLS B<Server> certificate libvirtd will use. + +=item F<$HOME/.pki/libvirt/serverkey.pem> + +The TLS B<Server> private key libvirtd will use. + +=item F<$XDG_RUNTIME_DIR/libvirt/libvirtd.pid> + +The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. + +=item If $XDG_CONFIG_HOME is not set in your environment, libvirtd will use F<$HOME/.config> + +=item If $XDG_RUNTIME_DIR is not set in your environment, libvirtd will use F<$HOME/.cache> + +=back + =head1 EXAMPLES To retrieve the version of libvirtd: -- 1.7.8.6

Updated the paths that libvirtd --help says are used when run as non-root to match what the code actually does. --- daemon/libvirtd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index fa9e7e8..edc4eee 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -911,7 +911,7 @@ libvirt management daemon:\n"), argv0); $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n\ \n\ Sockets:\n\ - $XDG_RUNTIME_HOME/libvirt/libvirt-sock (in UNIX abstract namespace)\n\ + $XDG_RUNTIME_DIR/libvirt/libvirt-sock (in UNIX abstract namespace)\n\ \n\ TLS:\n\ CA certificate: $HOME/.pki/libvirt/cacert.pem\n\ @@ -919,7 +919,7 @@ libvirt management daemon:\n"), argv0); Server private key: $HOME/.pki/libvirt/serverkey.pem\n\ \n\ PID file:\n\ - $XDG_RUNTIME_HOME/libvirt/libvirtd.pid\n\ + $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n\ \n")); } } -- 1.7.8.6

On Sun, Aug 12, 2012 at 11:44:47PM -0500, Doug Goldstein wrote:
Currently the man page has paths that start with @sysconfdir@, @localstatedir@ and @remote_pid_file@. The sed command attempts to replace these during the build but unfortunately pod2man gets to the files first and escapes the @ character resulting in the sed not working. This removes the @ character and makes the paths correct. --- daemon/Makefile.am | 6 +++--- daemon/libvirtd.pod.in | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-)
The 4 patches looks sensible to me, and if pod override the @@ then the full uppercase is simpler and should just work fine too ! ACK and pushed thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Doug Goldstein