[PATCH] Support installing systemd unit file.

Michał Górny mgorny at gentoo.org
Sun Aug 28 23:39:27 PDT 2011


On Sun, 28 Aug 2011 17:12:41 -0400
Gaetan Nadon <memsize at videotron.ca> wrote:

> > +if HAVE_SYSTEMD
> > +systemdsystemunit_DATA = xdm.service
> > +
> > +xdm.service: xdm.service.in
> > +	$(AM_V_GEN)$(SED) -e 's|BINDIR|$(bindir)|g' < $< > $@
> > +
> > +MOSTLYCLEANFILES = xdm.service
> > +endif HAVE_SYSTEMD
> > +EXTRA_DIST = xdm.service.in
> 
> If make creates xdm.service and the module is reconfigured using
> --without such that the file should no longer be created, it is not
> removed and thus gets installed anyway. It won't even be removed if
> you do 'make clean' . It could be a .PHONY target.
> 
> When  the path to the service dir is not writable by the user, the
> distcheck target will fail. The option should be added to
> DISTCHECK_CONFIGURE_FLAGS.

Thanks, fixed.

> > +
> >  MAINTAINERCLEANFILES = ChangeLog INSTALL
> >  
> >  .PHONY: ChangeLog INSTALL
> > diff --git a/configure.ac b/configure.ac
> > index 0c79999..1443d9e 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -145,6 +145,18 @@ if test "x$USE_SELINUX" != "xno" ; then
> >      )
> >  fi
> >  
> > +# Check whether to install systemd unit files, as suggest in
> > daemon(7). +AC_ARG_WITH([systemdsystemunitdir],
> > +	AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
> > +		[Directory for systemd service files]),
> 
> The help string should state (within reason) what is the default path
> for the service directory.

Fixed.

> > +	[],
> > +	[with_systemdsystemunitdir=$($PKG_CONFIG
> > --variable=systemdsystemunitdir systemd)] +)
> > +if test "x$with_systemdsystemunitdir" != "xno" ; then
> > +	AC_SUBST([systemdsystemunitdir],
> > [$with_systemdsystemunitdir]) +fi
> 
> When user input is "--with-systemdsystemunitdir" (the path is
> missing), variable systemdsystemunitdir is set to 'yes' and
> HAVE_SYSTEMD is set to true which does not make much sense. Make
> install will attempt to write it in the 'yes' directory. Perhaps it
> should pick the default value.

I'll fix the as soon as systemd devs decide on a common way to handle
this. I guess the code snippet in daemon(7) should be fixed as well.
I'll resubmit the patch then.

> When user does not type any --with or any --without and does not have
> the systemd installed, what is the default value for
> systemdsystemunitdir? 

It's grabbed from pkg-config.

> When a user inputs
> "--with-systemdsystemunitdir=/usr/lib/systemd/system" and does not
> have systemd installed, will the service file be installed? In my
> opinion, it should not. This is for Linux only, only a few distros
> have it, other O/S such as *BSD and Solaris don't. With this patch it
> would.
> 
> In essence, when the user input clearly indicates he wants to set
> systemdsystemunitdir, an error should occur if systemd is not
> installed.

I think Julien explained it all.

-- 
Best regards,
Michał Górny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 316 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110829/a59d240d/attachment.pgp>


More information about the xorg-devel mailing list