All of lore.kernel.org
 help / color / mirror / Atom feed
* Seperate option for install systemd unit file
@ 2013-08-19  6:23 Lan Yixun (dlan)
  2013-08-19  6:23 ` [PATCH 1/2] seperate option of --with-systemd from " Lan Yixun (dlan)
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Lan Yixun (dlan) @ 2013-08-19  6:23 UTC (permalink / raw)
  To: autofs

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'

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/2] seperate option of --with-systemd from install systemd unit file
  2013-08-19  6:23 Seperate option for install systemd unit file Lan Yixun (dlan)
@ 2013-08-19  6:23 ` Lan Yixun (dlan)
  2013-08-19  6:23 ` [PATCH 2/2] introduce new '--with-systemdsystemunitdir' Lan Yixun (dlan)
  2013-08-20  3:23 ` Seperate option for install systemd unit file Ian Kent
  2 siblings, 0 replies; 13+ messages in thread
From: Lan Yixun (dlan) @ 2013-08-19  6:23 UTC (permalink / raw)
  To: autofs; +Cc: Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>

---
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.

Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
 aclocal.m4          | 35 +++++++++++++++--------------------
 include/config.h.in |  3 +++
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index c5de159..5cdc7e4 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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 --------------------------------------------------------------------------
diff --git a/include/config.h.in b/include/config.h.in
index a2a05a8..a03902f 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -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
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] introduce new '--with-systemdsystemunitdir'
  2013-08-19  6:23 Seperate option for install systemd unit file Lan Yixun (dlan)
  2013-08-19  6:23 ` [PATCH 1/2] seperate option of --with-systemd from " Lan Yixun (dlan)
@ 2013-08-19  6:23 ` Lan Yixun (dlan)
  2013-09-02  5:08   ` Michael Tokarev
  2013-08-20  3:23 ` Seperate option for install systemd unit file Ian Kent
  2 siblings, 1 reply; 13+ messages in thread
From: Lan Yixun (dlan) @ 2013-08-19  6:23 UTC (permalink / raw)
  To: autofs; +Cc: Lan Yixun (dlan)

From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>

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.

Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
 Makefile.conf.in |  4 ++--
 aclocal.m4       | 43 +++++++++++++++++++++++++++++++++++++++++++
 configure.in     |  9 +++++++--
 samples/Makefile |  6 +++---
 4 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/Makefile.conf.in b/Makefile.conf.in
index 3766d45..75f6dec 100644
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -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@
diff --git a/aclocal.m4 b/aclocal.m4
index 5cdc7e4..cee7125 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -246,6 +246,49 @@ fi],
 ])
 
 dnl --------------------------------------------------------------------------
+dnl AF_WITH_SYSTEMD_UNITS_DIR
+dnl
+dnl Check the location of the systemd unit files directory
+dnl --------------------------------------------------------------------------
+AC_DEFUN([SYSTEMD_SYSTEM_UNITS],
+[AC_ARG_WITH(systemdsystemunitdir,
+[  --with-systemdsystemunitdir         install systemd unit file if systemd unit directory
+			  is found on system],
+[
+AC_MSG_CHECKING([location of the systemd unit files directory])
+if test "$withval" = yes -o x"$withval" = x""; then
+    for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do
+      if test -z "$systemdsystemunitdir"; then
+        if test -d "$systemd_d"; then
+          systemdsystemunitdir="$systemd_d"
+          AC_MSG_RESULT($systemdsystemunitdir)
+        fi
+      fi
+    done
+else
+  if test "$withval" = no; then
+    AC_MSG_RESULT(not found)
+  else
+    systemdsystemunitdir=$withval
+    AC_MSG_RESULT($systemdsystemunitdir)
+  fi
+fi
+],
+[
+AC_MSG_CHECKING([location of the systemd unit files directory, default yes])
+    for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do
+      if test -z "$systemdsystemunitdir"; then
+        if test -d "$systemd_d"; then
+          systemdsystemunitdir="$systemd_d"
+          AC_MSG_RESULT($systemdsystemunitdir)
+        fi
+      fi
+    done
+]
+)
+])
+
+dnl --------------------------------------------------------------------------
 dnl AF_CHECK_LIBXML
 dnl
 dnl Check for lib xml
diff --git a/configure.in b/configure.in
index 559045a..3cc43ab 100644
--- a/configure.in
+++ b/configure.in
@@ -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?
diff --git a/samples/Makefile b/samples/Makefile
index 91c1d6b..4cf8bf3 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -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)
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-19  6:23 Seperate option for install systemd unit file Lan Yixun (dlan)
  2013-08-19  6:23 ` [PATCH 1/2] seperate option of --with-systemd from " Lan Yixun (dlan)
  2013-08-19  6:23 ` [PATCH 2/2] introduce new '--with-systemdsystemunitdir' Lan Yixun (dlan)
@ 2013-08-20  3:23 ` Ian Kent
  2013-08-20  3:33   ` Dennis Lan (dlan)
  2013-08-20  3:44   ` Ian Kent
  2 siblings, 2 replies; 13+ messages in thread
From: Ian Kent @ 2013-08-20  3:23 UTC (permalink / raw)
  To: Lan Yixun (dlan); +Cc: autofs

On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
> 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.

> 
> [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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  3:23 ` Seperate option for install systemd unit file Ian Kent
@ 2013-08-20  3:33   ` Dennis Lan (dlan)
  2013-08-20  3:44   ` Ian Kent
  1 sibling, 0 replies; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-08-20  3:33 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs mailing list

On Tue, Aug 20, 2013 at 11:23 AM, Ian Kent <raven@themaw.net> wrote:
> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
>> 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.
>
>>
>> [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 majordomo@vger.kernel.org
>> 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)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  3:23 ` Seperate option for install systemd unit file Ian Kent
  2013-08-20  3:33   ` Dennis Lan (dlan)
@ 2013-08-20  3:44   ` Ian Kent
  2013-08-20  4:34     ` Dennis Lan (dlan)
  1 sibling, 1 reply; 13+ messages in thread
From: Ian Kent @ 2013-08-20  3:44 UTC (permalink / raw)
  To: Lan Yixun (dlan); +Cc: autofs

On Tue, 2013-08-20 at 11:23 +0800, Ian Kent wrote:
> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
> > 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.

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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  3:44   ` Ian Kent
@ 2013-08-20  4:34     ` Dennis Lan (dlan)
  2013-08-20  7:18       ` Ian Kent
  0 siblings, 1 reply; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-08-20  4:34 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs mailing list

On Tue, Aug 20, 2013 at 11:44 AM, Ian Kent <raven@themaw.net> wrote:
> On Tue, 2013-08-20 at 11:23 +0800, Ian Kent wrote:
>> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
>> > 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.
>
> 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

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  4:34     ` Dennis Lan (dlan)
@ 2013-08-20  7:18       ` Ian Kent
  2013-08-20  8:06         ` Dennis Lan (dlan)
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Kent @ 2013-08-20  7:18 UTC (permalink / raw)
  To: Dennis Lan (dlan); +Cc: autofs mailing list

On Tue, 2013-08-20 at 12:34 +0800, Dennis Lan (dlan) wrote:
> On Tue, Aug 20, 2013 at 11:44 AM, Ian Kent <raven@themaw.net> wrote:
> > On Tue, 2013-08-20 at 11:23 +0800, Ian Kent wrote:
> >> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
> >> > 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.
> >
> > 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

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.

> 
> > 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/"

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  7:18       ` Ian Kent
@ 2013-08-20  8:06         ` Dennis Lan (dlan)
  2013-08-20  9:57           ` Dennis Lan (dlan)
  0 siblings, 1 reply; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-08-20  8:06 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs mailing list, systemd

On Tue, Aug 20, 2013 at 3:18 PM, Ian Kent <raven@themaw.net> wrote:
> On Tue, 2013-08-20 at 12:34 +0800, Dennis Lan (dlan) wrote:
>> On Tue, Aug 20, 2013 at 11:44 AM, Ian Kent <raven@themaw.net> wrote:
>> > On Tue, 2013-08-20 at 11:23 +0800, Ian Kent wrote:
>> >> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
>> >> > 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.
>> >
>> > 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
>
> 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

>>
>> > 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/"
>
> It amounts to changing the configure option name and adding the ability
> to specify a directory.
Yes, It is

>
> 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..

>
> 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

>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)

> 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..

>
> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Seperate option for install systemd unit file
  2013-08-20  8:06         ` Dennis Lan (dlan)
@ 2013-08-20  9:57           ` Dennis Lan (dlan)
  0 siblings, 0 replies; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-08-20  9:57 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs mailing list, systemd

On Tue, Aug 20, 2013 at 4:06 PM, Dennis Lan (dlan)
<dennis.yxun@gmail.com> wrote:
> On Tue, Aug 20, 2013 at 3:18 PM, Ian Kent <raven@themaw.net> wrote:
>> On Tue, 2013-08-20 at 12:34 +0800, Dennis Lan (dlan) wrote:
>>> On Tue, Aug 20, 2013 at 11:44 AM, Ian Kent <raven@themaw.net> wrote:
>>> > On Tue, 2013-08-20 at 11:23 +0800, Ian Kent wrote:
>>> >> On Mon, 2013-08-19 at 14:23 +0800, Lan Yixun (dlan) wrote:
>>> >> > 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.
>>> >
>>> > 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
>>
>> 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
>
>>>
>>> > 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/"
>>
>> It amounts to changing the configure option name and adding the ability
>> to specify a directory.
> Yes, It is
>
>>
>> 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..
>
>>
>> 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
>
>>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)
>
>> 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..
>
>>
>> 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
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)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'
  2013-08-19  6:23 ` [PATCH 2/2] introduce new '--with-systemdsystemunitdir' Lan Yixun (dlan)
@ 2013-09-02  5:08   ` Michael Tokarev
  2013-09-02  7:44     ` Dennis Lan (dlan)
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Tokarev @ 2013-09-02  5:08 UTC (permalink / raw)
  To: Lan Yixun (dlan); +Cc: autofs

19.08.2013 10:23, Lan Yixun (dlan) wrote:
> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
>
> 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)

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'
  2013-09-02  5:08   ` Michael Tokarev
@ 2013-09-02  7:44     ` Dennis Lan (dlan)
  2013-09-02  7:56       ` Dennis Lan (dlan)
  0 siblings, 1 reply; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-09-02  7:44 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: autofs mailing list

On Mon, Sep 2, 2013 at 1:08 PM, Michael Tokarev <mjt@tls.msk.ru> wrote:
> 19.08.2013 10:23, Lan Yixun (dlan) wrote:
>>
>> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
>>
>> 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)
>
>
> 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)

> If yes, again, out of curiocity, why?
I'm not systemd guru, and just forward the answers, thanks

>
> Thanks,
>
> /mjt

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] introduce new '--with-systemdsystemunitdir'
  2013-09-02  7:44     ` Dennis Lan (dlan)
@ 2013-09-02  7:56       ` Dennis Lan (dlan)
  0 siblings, 0 replies; 13+ messages in thread
From: Dennis Lan (dlan) @ 2013-09-02  7:56 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: autofs mailing list

On Mon, Sep 2, 2013 at 3:44 PM, Dennis Lan (dlan) <dennis.yxun@gmail.com> wrote:
> On Mon, Sep 2, 2013 at 1:08 PM, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> 19.08.2013 10:23, Lan Yixun (dlan) wrote:
>>>
>>> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
>>>
>>> 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)
>>
>>
>> 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?


>> If yes, again, out of curiocity, why?
> I'm not systemd guru, and just forward the answers, thanks
>
>>
>> Thanks,
>>
>> /mjt

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-09-02  7:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19  6:23 Seperate option for install systemd unit file Lan Yixun (dlan)
2013-08-19  6:23 ` [PATCH 1/2] seperate option of --with-systemd from " Lan Yixun (dlan)
2013-08-19  6:23 ` [PATCH 2/2] introduce new '--with-systemdsystemunitdir' Lan Yixun (dlan)
2013-09-02  5:08   ` Michael Tokarev
2013-09-02  7:44     ` Dennis Lan (dlan)
2013-09-02  7:56       ` Dennis Lan (dlan)
2013-08-20  3:23 ` Seperate option for install systemd unit file Ian Kent
2013-08-20  3:33   ` Dennis Lan (dlan)
2013-08-20  3:44   ` Ian Kent
2013-08-20  4:34     ` Dennis Lan (dlan)
2013-08-20  7:18       ` Ian Kent
2013-08-20  8:06         ` Dennis Lan (dlan)
2013-08-20  9:57           ` Dennis Lan (dlan)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.