[Asterisk-code-review] contrib: Add a systemd service (asterisk[master])

George Joseph asteriskteam at digium.com
Tue May 17 18:28:40 CDT 2016


George Joseph has posted comments on this change.

Change subject: contrib: Add a systemd service
......................................................................


Patch Set 2:

> > > > > Thanks for your comments.
 > > > > >
 > > > > > Installing it is generally harmless on systems that don't
 > have it
 > > > > > (except you now have an extra file). /etc/systemd may be a
 > > > > > preferred path to install if this is not part of a package,
 > > > > > though. What do you think?
 > > > >
 > > > > /etc/systemd/system would be my preference but still, don't
 > > > > create that directory if it doesn't exist.  It's a simple
 > > > > enough test.
 > > >
 > > > Unless you install into a DESTDIR. In this case it doesn't
 > exist.
 > >
 > > If it's a DESTDIR then systemd isn't going to find it unless it's
 > > one of the well known search directories.  If this is for
 > packaging,
 > > then the creation of the directory should be in the spec file not
 > here.
 > 
 > But it means that the packager has to second-guess installation.
 > Otherwise it fails silently.
 > 
 > Normally you just run 'make install' through a standard wrapper
 > (depending on the packaging system). Yes, I know I can fix that.
 > But as a packager I may prefer patching the build system instead.
 > 
 > (Well, as a packager I'll need to move it from /etc/to [/usr]/lib,
 > so that target directory should be easy to override)
 > 
 > >
 > > >
 > > > >
 > > > > Actually, now that I think about it, you should install only
 > > the
 > > > > service file or the rc init file, not both.  I just tried
 > this
 > > on
 > > > > my centos system and it created the /usr/lib/systemd/system
 > > > > directory, copied the service file, and also installed
 > > > > /etc/init.d/asterisk and enabled it.
 > > >
 > > > On the Debian package I want to include both the init.d script
 > > and
 > > > the systemd service.
 > >
 > > This is pretty specific behavior few will want.  What does
 > systemd
 > > do
 > > if there are both?
 > 
 > Ignores the init.d script and uses the unit. They must have the
 > same name, of course.

Still, you simply can't create system directories for capabilities that don't exist.
Also you cannot install both mechanisms.  Neither is 'right' for a 'make install'.
If you need these for packaging, you have to do it externally.  I'm not budging on this, sorry.

-- 
To view, visit https://gerrit.asterisk.org/2844
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifde5d054ea0ba23d833e28ba80a6105d80070bc6
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Brady <sbrady at haikuengineering.com>
Gerrit-Reviewer: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list