Skip to contentSkip to conversation

tools: revert to using /var and /etc/

PATCH In review Ian Campbell 4 participants 15 messages Jan 25, 2013 – Feb 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: revert to using /var and /etc/

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?
---
 config/NetBSD.mk |    4 ----
 config/StdGNU.mk |    7 -------
 2 files changed, 0 insertions(+), 11 deletions(-)
config/NetBSD.mk +0 -4
index 12c8a34..141de7c 100644
@@ -6,10 +6,6 @@ PRIVATE_BINDIR = $(BINDIR)
 
 DLOPEN_LIBS =
 
-ifeq ($(PREFIX),/usr)
 XEN_LOCK_DIR = /var/lib
-else
-XEN_LOCK_DIR = $(PREFIX)/var/lib
-endif
 
 WGET = ftp
config/StdGNU.mk +0 -7
index 3febe8d..25fc594 100644
@@ -41,17 +41,10 @@ XENFIRMWAREDIR = $(PREFIX)/lib/xen/boot
 PRIVATE_PREFIX = $(LIBDIR)/xen
 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 
-ifeq ($(PREFIX),/usr)
 CONFIG_DIR = /etc
 XEN_LOCK_DIR = /var/lock
 XEN_RUN_DIR = /var/run/xen
 XEN_PAGING_DIR = /var/lib/xen/xenpaging
-else
-CONFIG_DIR = $(PREFIX)/etc
-XEN_LOCK_DIR = $(PREFIX)/var/lock
-XEN_RUN_DIR = $(PREFIX)/var/run/xen
-XEN_PAGING_DIR = $(PREFIX)/var/lib/xen/xenpaging
-endif
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
Signature · 1 line
1.7.2.5
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Ian Campbell

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Quoted 7 lines

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?
author Applied
#2 lore raw
Quoted 20 lines · Roger Pau Monne
Quoted 19 lines · Ian Campbell

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Quoted 8 lines
Quoted 7 lines

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?

Applied, thanks.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 25 lines · you
Quoted 24 lines · Roger Pau Monne
Quoted 23 lines · Ian Campbell

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?

Applied, thanks.

Hmm all the initscripts and the SYSCONFIG_DIR scripts still have hardcoded paths to /usr/bin or /usr/sbin in them. Changed them by hand for the moment, but still no succes booting.
Perhaps there are some more places where paths are hardcoded and not derived from the result of ./configure ?

--

Sander

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 30 lines · Sander Eikelenboom
Quoted 28 lines · you
Quoted 27 lines · Roger Pau Monne
Quoted 26 lines · Ian Campbell

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks.

Hmm all the initscripts and the SYSCONFIG_DIR scripts still have hardcoded paths to /usr/bin or /usr/sbin in them.

Oh, so they do :-(

Quoted 3 lines

Changed them by hand for the moment, but still no succes booting. Perhaps there are some more places where paths are hardcoded and not derived from the result of ./configure ?

It does seem likely :-/

I think at this point we should revert this change for now and I'll try again with a bit more due diligence before pushing the change. Sorry about this.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 31 lines · you
Quoted 30 lines · Sander Eikelenboom
Quoted 28 lines · you
Quoted 27 lines · Roger Pau Monne
Quoted 26 lines · Ian Campbell

26470:acaf29203cf9 "tools+stubdom: install under /usr/local by default" moved more stuff under /usr/local than was desirable.

In particular SYSCONFIG_DIR (configuration for initscripts) moved to /usr/local/etc/{sysconfig,defaults} while the initscripts themselves (correctly) remained in /etc/init.d. Moving /etc/xen/scripts breaks the udev bakcned rules file. Lastly stuff under /var was moved to /usr/local/var.

Move these back to /etc/ and /var. Moving /etc wholesale rather thsn just the problematic bits is preferable for consistency.

Although there seems to be some disagreement about /usr/local/var vs /var using /var is compatible with the FHS and what we think most people will expect.

Most of this impacts Linux only but NetBSD appears to have been using /usr/local/var/lib which I have also reset to /var/lib.

Note that we already paid no attention to autoconf --sysconfdir or --localstatedir ('etc' and 'var' respectively) so there is no change from that PoV.

Cc Roger Pau Monne <[email protected]>
Cc Ian Jackson <[email protected]?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks.

Hmm all the initscripts and the SYSCONFIG_DIR scripts still have hardcoded paths to /usr/bin or /usr/sbin in them.

Oh, so they do :-(

It's also a mix with absolute paths, and no paths.

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore. (not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Quoted 9 lines
Quoted 3 lines

Changed them by hand for the moment, but still no succes booting. Perhaps there are some more places where paths are hardcoded and not derived from the result of ./configure ?

It does seem likely :-/

I think at this point we should revert this change for now and I'll try again with a bit more due diligence before pushing the change. Sorry about this.

NP, it was worth a shot :-)

Quoted 1 line

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 10 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

Ian.

#7 lore raw
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

If fact it looks like that the appended patch fixes it, can you please confirm it?

---

tools/hotplug/Linux/init.d/xencommons +1 -1
index cc8177e..dc40425 100644
@@ -116,7 +116,7 @@ do_start () {
 	test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
 	echo Starting QEMU as disk backend for dom0
 	test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
-	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null
+	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null -serial /dev/null -parallel /dev/null
 }
 do_stop () {
         echo Stopping xenconsoled
#8 lore raw
Quoted 26 lines · you
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 2 lines

If fact it looks like that the appended patch fixes it, can you please confirm it?

Confirmed thx !

--
Sander

Quoted 15 lines

---

tools/hotplug/Linux/init.d/xencommons +1 -1
index cc8177e..dc40425 100644
@@ -116,7 +116,7 @@ do_start () {
        test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
        echo Starting QEMU as disk backend for dom0
        test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
-       $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null
+       $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null -serial /dev/null -parallel /dev/null
 }
 do_stop () {
         echo Stopping xenconsoled
#13 lore raw

PATCH 1/1 xencommons: redirect serial and parallel to /dev/null

In reply to Ian Campbell

Upstream QEMU doesn't support -nographic with -daemonize unless monitor, serial and parallel outputs are all redirected:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Considering that we do want to redirect them to /dev/null anyway, do so.

---

tools/hotplug/Linux/init.d/xencommons +1 -1
index cc8177e..dc40425 100644
@@ -116,7 +116,7 @@ do_start () {
 	test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
 	echo Starting QEMU as disk backend for dom0
 	test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
-	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null
+	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null -serial /dev/null -parallel /dev/null
 }
 do_stop () {
         echo Stopping xenconsoled
#9 lore raw
In reply to Sander Eikelenboom
Quoted 29 lines · Sander Eikelenboom
Quoted 25 lines · you
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 4 lines
Quoted 2 lines

If fact it looks like that the appended patch fixes it, can you please confirm it?

Confirmed thx !

Running Qemu using the -daemonize and -nographic options used to left the console tty in a bad state (which could be reverted by using 'stty sane'). Do you know if this is also fixed?

#10 lore raw
Quoted 30 lines · Roger Pau Monne
Quoted 29 lines · Sander Eikelenboom
Quoted 25 lines · you
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If fact it looks like that the appended patch fixes it, can you please confirm it?

Confirmed thx !

Running Qemu using the -daemonize and -nographic options used to left the console tty in a bad state (which could be reverted by using 'stty sane'). Do you know if this is also fixed?

Yes, that is fixed in upstream QEMU.

#11 lore raw
In reply to Stefano Stabellini
Quoted 26 lines · Stefano Stabellini
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 2 lines

If fact it looks like that the appended patch fixes it, can you please confirm it?

Is this going to break people using older versions of upstream qemu or should this change be compatible?

Ian.

#12 lore raw
Quoted 27 lines · Ian Campbell
Quoted 26 lines · Stefano Stabellini
Quoted 11 lines · Ian Campbell
Quoted 8 lines · Sander Eikelenboom

Another thing is that:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M
xenpv -daemonize -monitor /dev/null -pidfile $QEMU_PIDFILE

Doesn't seem to start with upstream qemu, combination of -nographic and -daemonize doesn't seem to be allowed anymore.
(not a problem for me, because i don't seem to be using it as diskbackend, but for a 4.3 release ...)

Stefano, is this expected?

No, it is not. Sander, thanks for the report.
This is the reason:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 5 lines
Quoted 2 lines

If fact it looks like that the appended patch fixes it, can you please confirm it?

Is this going to break people using older versions of upstream qemu or should this change be compatible?

They are compatible

author Acked-by on v1 1/1 Applied
#14 lore raw

Re: [PATCH] xencommons: redirect serial and parallel to /dev/null

In reply to Stefano Stabellini
Quoted 13 lines · Stefano Stabellini

Upstream QEMU doesn't support -nographic with -daemonize unless monitor, serial and parallel outputs are all redirected:

/* According to documentation and historically, -nographic redirects
* serial port, parallel port and monitor to stdio, which does not work
* with -daemonize. We can redirect these to null instead, but since
* -nographic is legacy, let's just error out.
* We disallow -nographic only if all other ports are not redirected
* explicitly, to not break existing legacy setups which uses
* -nographic _and_ redirects all ports explicitly - this is valid
* usage, -nographic is just a no-op in this case.
*/

Quoted 4 lines

Considering that we do want to redirect them to /dev/null anyway, do so.

I think I asked you IRL if this would work with older QEMU too and IIRC you said yes, so :

Applied, I had to adjust because of 26352:9a1610c1e564 "xencommons: Stop QEMU in do_stop()" and I rewrapped it since the line was getting a bit ridiculous, let me know if I did it wrong...