Skip to contentSkip to conversation

Seperate option for install systemd unit file

PATCH In review Lan Yixun (dlan) 3 participants 13 messages Aug 19, 2013 – Sep 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

[PATCH 1/2] seperate option of --with-systemd from install systemd [PATCH 2/2] introduce new '--with-systemdsystemunitdir'

#1 lore raw

PATCH 1/2 seperate option of --with-systemd from install systemd unit file

From: "Lan Yixun (dlan)" <[email protected]>

---
another patch will be instroduced "introduce new --with-systemdsystemunitdir" I kept option --with-systemd here in case we may use it in the future, but can be deleted if you think it not necessary, cause it's not useless now.

the default use case is "--with-systemd", so systemd enabled by default.

---
 aclocal.m4          | 35 +++++++++++++++--------------------
 include/config.h.in |  3 +++
 2 files changed, 18 insertions(+), 20 deletions(-)
aclocal.m4 +15 -20
index c5de159..5cdc7e4 100644
@@ -225,29 +225,24 @@ fi], [AC_MSG_RESULT(no)])
 dnl --------------------------------------------------------------------------
 dnl AF_WITH_SYSTEMD
 dnl
-dnl Check the location of the systemd unit files directory
+dnl Check if systemd support is wanted
 dnl --------------------------------------------------------------------------
 AC_DEFUN([AF_WITH_SYSTEMD],
-[AC_ARG_WITH(systemd,
-[  --with-systemd         install systemd unit file if systemd unit directory
-			  is found on system],
+[AC_MSG_CHECKING([if systemd support is wanted])
+AC_ARG_WITH(systemd,
+[  --with-systemd          enable systemd support, defaut is yes],
 [if test "$withval" = yes; then
-  if test -z "$systemddir"; then
-    AC_MSG_CHECKING([location of the systemd unit files directory])
-    for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do
-      if test -z "$systemddir"; then
-        if test -d "$systemd_d"; then
-          systemddir="$systemd_d"
-        fi
-      fi
-    done
-  fi
-  if test -n "$systemddir"; then
-    AC_MSG_RESULT($systemddir)
-  else
-    AC_MSG_RESULT(not found)
-  fi
-fi])
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(WITH_SYSTMED,1,
+    [Define if systemd support is enabled])
+else
+  AC_MSG_RESULT(no)
+fi],
+[
+ AC_MSG_RESULT(yes)
+  AC_DEFINE(WITH_SYSTMED,1,
+    [Define if systemd support is enabled])
+])
 ])
 
 dnl --------------------------------------------------------------------------
include/config.h.in +3 -0
index a2a05a8..a03902f 100644
@@ -152,3 +152,6 @@
 
 /* Define if using SASL authentication with the LDAP module */
 #undef WITH_SASL
+
+/* Define if systemd support is enabled */
+#undef WITH_SYSTMED
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/2 introduce new '--with-systemdsystemunitdir'

In reply to Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <[email protected]>

this option only control the path where the systemd unit file wll be installed and it's seperated from --with-systemd option, so it can be always installed alone.

use cases:
1) if this option is not specificed, default option is '--with-systemdsystemunitdir=yes'
will auto probe the directory of unit file
2) --with-systemdsystemunitdir=no, or --without-systemdsystemunitdir no unit file will be installed
3) --with-systemdsystemunitdir=/my/unit/file/directory/ will install unit file into /my/unit/file/directory/ (gentoo linux goes the 3nd way)

this patch doesn't alter previous behavior, so should be compatible with previous version.

---
 Makefile.conf.in |  4 ++--
 aclocal.m4       | 43 +++++++++++++++++++++++++++++++++++++++++++
 configure.in     |  9 +++++++--
 samples/Makefile |  6 +++---
 4 files changed, 55 insertions(+), 7 deletions(-)
Makefile.conf.in +2 -2
index 3766d45..75f6dec 100644
@@ -107,5 +107,5 @@ mandir = @mandir@
 # Location for init.d files
 initdir = @initdir@
 
-# Location of systemd unit files
-systemddir = @systemddir@
+# Location of systemd unit dir
+systemdsystemunitdir = @systemdsystemunitdir@
aclocal.m4 +43 -0

49 lines not on this page · raw message

configure.in +7 -2
index 559045a..3cc43ab 100644
@@ -47,11 +47,16 @@ AF_PID_D()
 AC_SUBST(piddir)
 
 #
+# Check for systemd support is requested
+#
+AF_WITH_SYSTEMD()
+
+#
 # Check for systemd unit files direectory exists if unit file installation
 # is requested
 #
-AF_WITH_SYSTEMD()
-AC_SUBST(systemddir)
+SYSTEMD_SYSTEM_UNITS
+AC_SUBST(systemdsystemunitdir)
 
 #
 # Location of system config script directory?
samples/Makefile +3 -3
index 91c1d6b..4cf8bf3 100644
@@ -32,9 +32,9 @@ dirs:
 .PHONY: autofs.init
 autofs.init:
 	@echo
-ifneq ($(systemddir),)
-	install -d -m 755 $(INSTALLROOT)$(systemddir)
-	install autofs.service -m 644 $(INSTALLROOT)$(systemddir)/autofs.service
+ifneq ($(systemdsystemunitdir),)
+	install -d -m 755 $(INSTALLROOT)$(systemdsystemunitdir)
+	install autofs.service -m 644 $(INSTALLROOT)$(systemdsystemunitdir)/autofs.service
 else
    ifneq ($(initdir),)
 	install -d -m 755 $(INSTALLROOT)$(initdir)
Signature · 1 line
1.8.3.2
#3 lore raw

Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'

Quoted 5 lines · Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <[email protected]>

this option only control the path where the systemd unit file wll be installed and it's seperated from --with-systemd option, so it can be always installed alone.

Quoted 9 lines

use cases:
1) if this option is not specificed, default option is '--with-systemdsystemunitdir=yes'
will auto probe the directory of unit file
2) --with-systemdsystemunitdir=no, or --without-systemdsystemunitdir no unit file will be installed
3) --with-systemdsystemunitdir=/my/unit/file/directory/ will install unit file into /my/unit/file/directory/ (gentoo linux goes the 3nd way)

Out of curiocity, -- you haven't mentioned _why_ this option is needed to start with. Does gentoo use an alternative directory for systemd units? If yes, again, out of curiocity, why?

Thanks,

/mjt

#4 lore raw

Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'

Quoted 20 lines · Michael Tokarev
Quoted 8 lines · Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <[email protected]>

this option only control the path where the systemd unit file wll be installed
and it's seperated from --with-systemd option, so it can be always installed alone.

Quoted 9 lines

use cases:
1) if this option is not specificed, default option is '--with-systemdsystemunitdir=yes'
will auto probe the directory of unit file
2) --with-systemdsystemunitdir=no, or --without-systemdsystemunitdir no unit file will be installed
3) --with-systemdsystemunitdir=/my/unit/file/directory/ will install unit file into /my/unit/file/directory/ (gentoo linux goes the 3nd way)

Quoted 2 lines

Out of curiocity, -- you haven't mentioned _why_ this option is needed to start with. Does gentoo use an alternative directory for systemd units?

current, no, but maybe in future.. (from @gentoo-systemd team)

Quoted 1 line

If yes, again, out of curiocity, why?

I'm not systemd guru, and just forward the answers, thanks

Quoted 4 lines

Thanks,

/mjt

#5 lore raw

Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'

Quoted 21 lines · Dennis Lan (dlan)
Quoted 20 lines · Michael Tokarev
Quoted 17 lines · Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <[email protected]>

this option only control the path where the systemd unit file wll be installed
and it's seperated from --with-systemd option, so it can be always installed alone.

use cases:
1) if this option is not specificed, default option is '--with-systemdsystemunitdir=yes'
will auto probe the directory of unit file
2) --with-systemdsystemunitdir=no, or --without-systemdsystemunitdir no unit file will be installed
3) --with-systemdsystemunitdir=/my/unit/file/directory/ will install unit file into /my/unit/file/directory/ (gentoo linux goes the 3nd way)

Quoted 4 lines
Quoted 2 lines

Out of curiocity, -- you haven't mentioned _why_ this option is needed to start with. Does gentoo use an alternative directory for systemd units?

current, no, but maybe in future.. (from @gentoo-systemd team)

I can think of those myself..
1) might be useful in gentoo-prefix environment
say, user can install autofs to /my/prefix/gentoo, then systemdunit file will install to /my/prefix/gentoo/usr/lib/systemd/system

2) or for multilib support, usr may install to /usr/lib64/systemd/system/ or /usr/lib32/systemd/system?

Quoted 7 lines
Quoted 1 line

If yes, again, out of curiocity, why?

I'm not systemd guru, and just forward the answers, thanks

Quoted 4 lines

Thanks,

/mjt

maintainer
#6 lore raw
In reply to Lan Yixun (dlan)
Quoted 10 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

Quoted 7 lines

[PATCH 1/2] seperate option of --with-systemd from install systemd [PATCH 2/2] introduce new '--with-systemdsystemunitdir' --
To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 16 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

Quoted 7 lines

[PATCH 1/2] seperate option of --with-systemd from install systemd [PATCH 2/2] introduce new '--with-systemdsystemunitdir' --
To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi Ian:
No problem, I tried to keep the changes minimal.
thanks for taking care of this
(I was afraid this would introduce noise instead improvement ;-)

Dennis Lan (dlan)

maintainer
#8 lore raw
In reply to Ian Kent
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 6 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

After a very quick initial look ....

It appears that the change does two things.

Defines WITH_SYSTEMD for subsequent use, although applications usually don't need to know if they are being managed by systemd. Do you know of any cases where that is important?

And changes the original --with-systemd configure option to --with-systemdsystemunitdir adding the ability to specify a unit directory explicitly.

Why is it worthwhile changing the configure option as part of this change?

Ian

#9 lore raw
Quoted 16 lines · Ian Kent
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 6 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

Quoted 8 lines

After a very quick initial look ....

It appears that the change does two things.

Defines WITH_SYSTEMD for subsequent use, although applications usually don't need to know if they are being managed by systemd. Do you know of any cases where that is important?

No, no cases I know of,
So, I leave you to decide whether to keep it or not

Quoted 10 lines

And changes the original --with-systemd configure option to --with-systemdsystemunitdir adding the ability to specify a unit directory explicitly.

Why is it worthwhile changing the configure option as part of this change?

Ian

As talked with gentoo @systemd team, it's conventional to use "--with-systemdsystemunitdir"[1]
and I think it's would be slight better/explicitly to pass the unit directory via --with-systemdsystemunitdir=/my/unit/dir/?current logic is "--with-systemd systemddir=/my/unit/dir/"

I would have no problem if you insist not to change anyway..

[1] https://bugs.gentoo.org/show_bug.cgi?id=479492#c11

maintainer
#10 lore raw
Quoted 19 lines · Dennis Lan (dlan)
Quoted 18 lines · Ian Kent
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 6 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

After a very quick initial look ....

Quoted 8 lines
Quoted 6 lines

It appears that the change does two things.

Defines WITH_SYSTEMD for subsequent use, although applications usually don't need to know if they are being managed by systemd. Do you know of any cases where that is important?

No, no cases I know of,
So, I leave you to decide whether to keep it or not

Yeah, but it may be needed to control whether the unit file is actuall installed. Seems a bit round of a round about way to do this.

Quoted 8 lines
Quoted 8 lines

And changes the original --with-systemd configure option to --with-systemdsystemunitdir adding the ability to specify a unit directory explicitly.

Why is it worthwhile changing the configure option as part of this change?

Quoted 8 lines
Quoted 3 lines

Ian

As talked with gentoo @systemd team, it's conventional to use "--with-systemdsystemunitdir"[1]
and I think it's would be slight better/explicitly to pass the unit directory via --with-systemdsystemunitdir=/my/unit/dir/?current logic is "--with-systemd systemddir=/my/unit/dir/"

It amounts to changing the configure option name and adding the ability to specify a directory.

The discussion implies there's precedent for using this name, do your the systemd guys know of other packages that use this naming, what are they?

I get the request to be able to specify a directory, that's cool.

The other thing I think I saw in the discussion was unconditional installation of the unit file. The unit file has substitution done on it unconditionally but the macro paths are only set if the configure option is given. So there's no way to say, look for the systemd directories or use the given path but don't actually install the unit file. The actual unconditional install is probably best done in the ebuild, simple enough.

Ian

#11 lore raw
Quoted 26 lines · Ian Kent
Quoted 25 lines · Dennis Lan (dlan)
Quoted 24 lines · Ian Kent
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 6 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

After a very quick initial look ....

It appears that the change does two things.

Defines WITH_SYSTEMD for subsequent use, although applications usually don't need to know if they are being managed by systemd. Do you know of any cases where that is important?

Quoted 6 lines
Quoted 2 lines

No, no cases I know of,
So, I leave you to decide whether to keep it or not

Yeah, but it may be needed to control whether the unit file is actuall installed. Seems a bit round of a round about way to do this.

This seems against @systemd gentoo's suggestion (to install the unit file unconditionally)
because it will be controlled under --with-systemd option

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

And changes the original --with-systemd configure option to --with-systemdsystemunitdir adding the ability to specify a unit directory explicitly.

Why is it worthwhile changing the configure option as part of this change?

Ian

Quoted 8 lines
Quoted 5 lines

As talked with gentoo @systemd team, it's conventional to use "--with-systemdsystemunitdir"[1]
and I think it's would be slight better/explicitly to pass the unit directory via --with-systemdsystemunitdir=/my/unit/dir/?current logic is "--with-systemd systemddir=/my/unit/dir/"

It amounts to changing the configure option name and adding the ability to specify a directory.

Yes, It is

Quoted 4 lines

The discussion implies there's precedent for using this name, do your the systemd guys know of other packages that use this naming, what are they?

I will let gentoo @systemd team answer this..

Quoted 5 lines

I get the request to be able to specify a directory, that's cool.

The other thing I think I saw in the discussion was unconditional installation of the unit file.

yes

Quoted 4 lines

The unit file has substitution done on it
unconditionally but the macro paths are only set if the configure option is given. So there's no way to say, look for the systemd directories or use the given path but don't actually install the unit file. The actual

Yes, this is the original logic, but if you following my proposal patch, we can install NO unit file by passing --with-systemdsystemunitdir=no or --without-systemdsystemunitdir
for the original code, we need to pass --without-systemd, but it's a little bit confusing (the disable install unit file)

Quoted 2 lines

unconditional install is probably best done in the ebuild, simple enough.

yes, this would be another approach, but if goes this way, then wouldn't I proposal this patch..

Quoted 6 lines

Ian

Hi Ian:
I don't have much knowledge about systemd, so let me CC gentoo @systemd team,
in case they have some inputs or my understanding is wrong/stupid..
The discussions can be found here [1], the actual patches I proposal
can be found here [2],[3]

Dennis Lan (dlan)

[1] http://thread.gmane.org/gmane.linux.kernel.autofs/6703
[2] http://article.gmane.org/gmane.linux.kernel.autofs/6702
[3] http://article.gmane.org/gmane.linux.kernel.autofs/6704

#12 lore raw
Quoted 98 lines · Dennis Lan (dlan)
Quoted 26 lines · Ian Kent
Quoted 25 lines · Dennis Lan (dlan)
Quoted 24 lines · Ian Kent
Quoted 8 lines · Ian Kent
Quoted 7 lines · Lan Yixun (dlan)

those patches are very trivial changes which only instroduce a new --with-systemdsystemunitdir option to better control where we should install system unit file to

1) seperate --with-systemd opiton, but been kept now for future use (but it's useless now)
2) add new option --with-systemdsystemunitdir to manage the path where unit file will be installed
3) --with-systemd and --with-systemdsystemunitdir are two seperate option, so unit can be installed even systemd support is not enabled.

Quoted 6 lines
Quoted 3 lines

downstream discussion: https://bugs.gentoo.org/show_bug.cgi?id=479492

let me know whether this looks good to you..

Looks OK but I'll need to spend some time on it in case it conflicts with downstream usage I already have.

After a very quick initial look ....

It appears that the change does two things.

Defines WITH_SYSTEMD for subsequent use, although applications usually don't need to know if they are being managed by systemd. Do you know of any cases where that is important?

Quoted 6 lines
Quoted 2 lines

No, no cases I know of,
So, I leave you to decide whether to keep it or not

Yeah, but it may be needed to control whether the unit file is actuall installed. Seems a bit round of a round about way to do this.

This seems against @systemd gentoo's suggestion (to install the unit file unconditionally)
because it will be controlled under --with-systemd option

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

And changes the original --with-systemd configure option to --with-systemdsystemunitdir adding the ability to specify a unit directory explicitly.

Why is it worthwhile changing the configure option as part of this change?

Ian

Quoted 8 lines
Quoted 5 lines

As talked with gentoo @systemd team, it's conventional to use "--with-systemdsystemunitdir"[1]
and I think it's would be slight better/explicitly to pass the unit directory via --with-systemdsystemunitdir=/my/unit/dir/?current logic is "--with-systemd systemddir=/my/unit/dir/"

It amounts to changing the configure option name and adding the ability to specify a directory.

Yes, It is

Quoted 4 lines

The discussion implies there's precedent for using this name, do your the systemd guys know of other packages that use this naming, what are they?

I will let gentoo @systemd team answer this..

Quoted 5 lines

I get the request to be able to specify a directory, that's cool.

The other thing I think I saw in the discussion was unconditional installation of the unit file.

yes

Quoted 4 lines

The unit file has substitution done on it
unconditionally but the macro paths are only set if the configure option is given. So there's no way to say, look for the systemd directories or use the given path but don't actually install the unit file. The actual

Yes, this is the original logic, but if you following my proposal patch, we can install NO unit file by passing --with-systemdsystemunitdir=no or --without-systemdsystemunitdir
for the original code, we need to pass --without-systemd, but it's a little bit confusing (the disable install unit file)

Quoted 2 lines

unconditional install is probably best done in the ebuild, simple enough.

yes, this would be another approach, but if goes this way, then wouldn't I proposal this patch..

Quoted 6 lines

Ian

Hi Ian:
I don't have much knowledge about systemd, so let me CC gentoo @systemd team,
in case they have some inputs or my understanding is wrong/stupid..
The discussions can be found here [1], the actual patches I proposal
can be found here [2],[3]

Quoted 6 lines

Dennis Lan (dlan)

[1] http://thread.gmane.org/gmane.linux.kernel.autofs/6703
[2] http://article.gmane.org/gmane.linux.kernel.autofs/6702
[3] http://article.gmane.org/gmane.linux.kernel.autofs/6704

HI Ian:
the answer about why we advocate --with-systemdsystemunitdir can be found here
https://bugs.gentoo.org/show_bug.cgi?id=479492#c16
thanks

Dennis Lan (dlan)