Skip to contentSkip to conversation

tools: generate systemd service files only when systemd is available

PATCH Applied Wei Liu 3 participants 10 messages Jan 20, 2015 – Jan 27, 2015

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 tools: generate systemd service files only when systemd is available

Though that's not in any way harmful but it is on the other hand not very useful.

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 tools/configure.ac | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
tools/configure.ac +16 -10
index 113285d..850ba23 100644
@@ -12,16 +12,6 @@ hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
 hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
-hotplug/Linux/systemd/proc-xen.mount
-hotplug/Linux/systemd/var-lib-xenstored.mount
-hotplug/Linux/systemd/xen-init-dom0.service
-hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
-hotplug/Linux/systemd/xen-watchdog.service
-hotplug/Linux/systemd/xenconsoled.service
-hotplug/Linux/systemd/xendomains.service
-hotplug/Linux/systemd/xenstored.service
-hotplug/Linux/systemd/xenstored.socket
-hotplug/Linux/systemd/xenstored_ro.socket
 hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
@@ -386,5 +376,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    hotplug/Linux/systemd/proc-xen.mount
+    hotplug/Linux/systemd/var-lib-xenstored.mount
+    hotplug/Linux/systemd/xen-init-dom0.service
+    hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
+    hotplug/Linux/systemd/xen-watchdog.service
+    hotplug/Linux/systemd/xenconsoled.service
+    hotplug/Linux/systemd/xendomains.service
+    hotplug/Linux/systemd/xenstored.service
+    hotplug/Linux/systemd/xenstored.socket
+    hotplug/Linux/systemd/xenstored_ro.socket
+    ])
+])
+
 AC_OUTPUT()
 
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Wei Liu

Though that's not in any way harmful but it is on the other hand not very useful.

It's not 100% clear in the docs that you can call this macro twice, but it definitely doesn't say you can't so I'd assume it was OK:

Quoted 53 lines

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 tools/configure.ac | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
tools/configure.ac +16 -10
index 113285d..850ba23 100644
@@ -12,16 +12,6 @@ hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
 hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
-hotplug/Linux/systemd/proc-xen.mount
-hotplug/Linux/systemd/var-lib-xenstored.mount
-hotplug/Linux/systemd/xen-init-dom0.service
-hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
-hotplug/Linux/systemd/xen-watchdog.service
-hotplug/Linux/systemd/xenconsoled.service
-hotplug/Linux/systemd/xendomains.service
-hotplug/Linux/systemd/xenstored.service
-hotplug/Linux/systemd/xenstored.socket
-hotplug/Linux/systemd/xenstored_ro.socket
 hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
@@ -386,5 +376,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    hotplug/Linux/systemd/proc-xen.mount
+    hotplug/Linux/systemd/var-lib-xenstored.mount
+    hotplug/Linux/systemd/xen-init-dom0.service
+    hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
+    hotplug/Linux/systemd/xen-watchdog.service
+    hotplug/Linux/systemd/xenconsoled.service
+    hotplug/Linux/systemd/xendomains.service
+    hotplug/Linux/systemd/xenstored.service
+    hotplug/Linux/systemd/xenstored.socket
+    hotplug/Linux/systemd/xenstored_ro.socket
+    ])
+])
+
 AC_OUTPUT()
 
author
#2 lore raw
Quoted 8 lines · Ian Campbell
Quoted 2 lines · Wei Liu

Though that's not in any way harmful but it is on the other hand not very useful.

It's not 100% clear in the docs that you can call this macro twice, but it definitely doesn't say you can't so I'd assume it was OK:

I tested this patch and it worked. There is similar usage in glibc configure.ac.

Wei.

Quoted 54 lines
Quoted 53 lines

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 tools/configure.ac | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
tools/configure.ac +16 -10
index 113285d..850ba23 100644
@@ -12,16 +12,6 @@ hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
 hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
-hotplug/Linux/systemd/proc-xen.mount
-hotplug/Linux/systemd/var-lib-xenstored.mount
-hotplug/Linux/systemd/xen-init-dom0.service
-hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
-hotplug/Linux/systemd/xen-watchdog.service
-hotplug/Linux/systemd/xenconsoled.service
-hotplug/Linux/systemd/xendomains.service
-hotplug/Linux/systemd/xenstored.service
-hotplug/Linux/systemd/xenstored.socket
-hotplug/Linux/systemd/xenstored_ro.socket
 hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
@@ -386,5 +376,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    hotplug/Linux/systemd/proc-xen.mount
+    hotplug/Linux/systemd/var-lib-xenstored.mount
+    hotplug/Linux/systemd/xen-init-dom0.service
+    hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
+    hotplug/Linux/systemd/xen-watchdog.service
+    hotplug/Linux/systemd/xenconsoled.service
+    hotplug/Linux/systemd/xendomains.service
+    hotplug/Linux/systemd/xenstored.service
+    hotplug/Linux/systemd/xenstored.socket
+    hotplug/Linux/systemd/xenstored_ro.socket
+    ])
+])
+
 AC_OUTPUT()
 
author
#3 lore raw
Quoted 5 lines · Wei Liu
Quoted 4 lines · Ian Campbell
Quoted 2 lines · Wei Liu

Though that's not in any way harmful but it is on the other hand not very useful.

Quoted 8 lines
Quoted 4 lines

It's not 100% clear in the docs that you can call this macro twice, but it definitely doesn't say you can't so I'd assume it was OK:

I tested this patch and it worked. There is similar usage in glibc configure.ac.

And FYI

https://www.gnu.org/software/automake/manual/html_node/Requirements.html

contains snippets that call AC_CONFIG_FILES more than once.

So it is officially legal to do that! :-)

Wei.

Quoted 56 lines

Wei.

Quoted 54 lines
Quoted 53 lines

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 tools/configure.ac | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
tools/configure.ac +16 -10
index 113285d..850ba23 100644
@@ -12,16 +12,6 @@ hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
 hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
-hotplug/Linux/systemd/proc-xen.mount
-hotplug/Linux/systemd/var-lib-xenstored.mount
-hotplug/Linux/systemd/xen-init-dom0.service
-hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
-hotplug/Linux/systemd/xen-watchdog.service
-hotplug/Linux/systemd/xenconsoled.service
-hotplug/Linux/systemd/xendomains.service
-hotplug/Linux/systemd/xenstored.service
-hotplug/Linux/systemd/xenstored.socket
-hotplug/Linux/systemd/xenstored_ro.socket
 hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
@@ -386,5 +376,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    hotplug/Linux/systemd/proc-xen.mount
+    hotplug/Linux/systemd/var-lib-xenstored.mount
+    hotplug/Linux/systemd/xen-init-dom0.service
+    hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
+    hotplug/Linux/systemd/xen-watchdog.service
+    hotplug/Linux/systemd/xenconsoled.service
+    hotplug/Linux/systemd/xendomains.service
+    hotplug/Linux/systemd/xenstored.service
+    hotplug/Linux/systemd/xenstored.socket
+    hotplug/Linux/systemd/xenstored_ro.socket
+    ])
+])
+
 AC_OUTPUT()
 
#4 lore raw
In reply to Wei Liu

Wei Liu writes ("[PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 2 lines

Though that's not in any way harmful but it is on the other hand not very useful.

What is the effect of this in the context of a distro package, where the build may occur in a different situation to the installed package ?

Ian.

author
#5 lore raw
Quoted 8 lines · Ian Jackson

Wei Liu writes ("[PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 2 lines

Though that's not in any way harmful but it is on the other hand not very useful.

What is the effect of this in the context of a distro package, where the build may occur in a different situation to the installed package ?

Not sure if I understand you question but let me try to answer.

Conceptually speaking for Xen's systemd components to function properly the service files may need to rely on other components to be built. If systemd is not available at build time that means those components which service files rely on cannot be built, so the service files alone aren't very useful even if you generate and package them.

Practically speaking those service files don't depend on any systemd specific components to be built at the moment so it's harmless to package them.

Wei.

Quoted 1 line

Ian.

#6 lore raw
Quoted 10 lines · Wei Liu
Quoted 8 lines · Ian Jackson

Wei Liu writes ("[PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 2 lines

Though that's not in any way harmful but it is on the other hand not very useful.

What is the effect of this in the context of a distro package, where the build may occur in a different situation to the installed package ?

Quoted 4 lines

Not sure if I understand you question but let me try to answer.

Conceptually speaking for Xen's systemd components to function properly the service files may need to rely on other components to be built.

Where components is things like socket activation support in xenstored etc, I think? Or is there more to it?

Quoted 12 lines

If
systemd is not available at build time that means those components which service files rely on cannot be built, so the service files alone aren't very useful even if you generate and package them.

Practically speaking those service files don't depend on any systemd specific components to be built at the moment so it's harmless to package them.

Wei.

Quoted 1 line

Ian.

author
#7 lore raw
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Wei Liu
Quoted 8 lines · Ian Jackson

Wei Liu writes ("[PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 2 lines

Though that's not in any way harmful but it is on the other hand not very useful.

What is the effect of this in the context of a distro package, where the build may occur in a different situation to the installed package ?

Quoted 8 lines
Quoted 4 lines

Not sure if I understand you question but let me try to answer.

Conceptually speaking for Xen's systemd components to function properly the service files may need to rely on other components to be built.

Where components is things like socket activation support in xenstored etc, I think? Or is there more to it?

Yes. [c/o]xenstored needs to link against systemd to use socket activation. That's the only thing at the moment.

I was just speaking about things in general -- in case we have some more daemons that need to link against systemd.

Wei.

Quoted 13 lines
Quoted 12 lines

If
systemd is not available at build time that means those components which service files rely on cannot be built, so the service files alone aren't very useful even if you generate and package them.

Practically speaking those service files don't depend on any systemd specific components to be built at the moment so it's harmless to package them.

Wei.

Quoted 1 line

Ian.

Acked-by
#8 lore raw

Wei Liu writes ("Re: [PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 9 lines · Ian Campbell
Quoted 2 lines

Where components is things like socket activation support in xenstored etc, I think? Or is there more to it?

Yes. [c/o]xenstored needs to link against systemd to use socket activation. That's the only thing at the moment.

I was just speaking about things in general -- in case we have some more daemons that need to link against systemd.

OK, right.

Thanks,
Ian.

Applied
#9 lore raw
Quoted 8 lines · Ian Jackson

Wei Liu writes ("Re: [PATCH] tools: generate systemd service files only when systemd is available"):

Quoted 7 lines · Ian Campbell
Quoted 2 lines

Where components is things like socket activation support in xenstored etc, I think? Or is there more to it?

Yes. [c/o]xenstored needs to link against systemd to use socket activation. That's the only thing at the moment.

Quoted 6 lines
Quoted 2 lines

I was just speaking about things in general -- in case we have some more daemons that need to link against systemd.

OK, right.

Applied, thanks.