Re: Systemd macros (f18+)

2012-09-13 Thread Tom Lane
Lennart Poettering  writes:
> But then we'd introduce two macros now, for two old distros, that make
> no sense on the next distros anymore but we could never get rid of them
> anymore, because we'd break the old packages...

So what?  It's not like the carrying cost of redundant macros is
anything significant.  Meanwhile, by refusing to do this you are
inconveniencing a lot of package maintainers for whom the costs
of having different specfiles in different branches *are* significant.

regards, tom lane
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-13 Thread Lennart Poettering
On Thu, 13.09.12 07:47, Bruno Wolff III (br...@wolff.to) wrote:

> >Of course we could introduce new macros for both A and B, so that we'd
> >have three macros, covering all three operations. But who'd be helped
> >with that? We should introduce new stuff only for new distros, and maybe
> >backport it. But this would be adding completely new stuff to old
> >distros that makes no sense anymore on new distros, and hence we
> >shouldn't do it.
> 
> I believe the suggestions was to have macros for A and B that did A
> and B on f16/f17 and did the same as C on F18+. That way a package
> could use a single macro on all current releases. Then when f18 was
> the oldest current release, packages could switch to using macro C
> for all releases.

But then we'd introduce two macros now, for two old distros, that make
no sense on the next distros anymore but we could never get rid of them
anymore, because we'd break the old packages...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-13 Thread Bruno Wolff III

On Thu, Sep 13, 2012 at 09:10:45 +0200,
  Lennart Poettering  wrote:

In other words:

A) There's one postinst script that invokes "systemctl enable"
B) There's another one that does not invoke systemctl, and leaves the service 
off
C) There's a third one that invokes "systemctl preset"

In F16/F17 A and B are used. Some packages use A, most packages use B.

In F18 only C is used. All packages use C.

In F18 we have a macro that implements C. We have no macro that
implements A or B.

Now, you are asking me to provide a macro with the same name and
functionality in F16/F17 as the one we introduced for F18, right? But
how could we do this? If on F18 the macro implements C, what would it
implement on F16/F17? Would it implement A? If so, it would be useless
for all packages whose service needs to stay off after
installation. Would it implement B? If so, it would be useless for all
packages whose service needs to be enabled after installation.

Of course we could introduce new macros for both A and B, so that we'd
have three macros, covering all three operations. But who'd be helped
with that? We should introduce new stuff only for new distros, and maybe
backport it. But this would be adding completely new stuff to old
distros that makes no sense anymore on new distros, and hence we
shouldn't do it.


I believe the suggestions was to have macros for A and B that did A and B 
on f16/f17 and did the same as C on F18+. That way a package could use 
a single macro on all current releases. Then when f18 was the oldest 
current release, packages could switch to using macro C for all releases.

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-13 Thread Simone Caronni
On 13 September 2012 09:10, Lennart Poettering  wrote:
> On Thu, 13.09.12 08:48, Simone Caronni (negativ...@gmail.com) wrote:
> Hope this clarifies this a bit.

Thanks for the explanation!

Regards,
--Simone


-- 
You cannot discover new oceans unless you have the courage to lose
sight of the shore (R. W. Emerson).
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-13 Thread Lennart Poettering
On Thu, 13.09.12 08:48, Simone Caronni (negativ...@gmail.com) wrote:

> Hello,
> 
> On 13 September 2012 08:06, Lennart Poettering  wrote:
> > Since F16/F17 do not have presets we cannot just port those macros
> > there. What is one macro in F18 would map to two macros in F16/F17.
> 
> Can you please point me to the two macros? I only see a small difference.

On F16/F17 in postinst you have to do "systemctl enable" to enable a
service. To leave a service disabled you do not invoke systemctl at
all. Whether a service is enabled or not after installation is encoded
in the package itself and hence it is up to the package maintainer
whether he includes the "systemctl enable" or not. To turn this into a
postinst macro you'd have to introduce two macros: one with and one without the
"systemctl enable".

On F18 in postinst you have to do "systemctl preset"
unconditionally. Whether a service is enabled or not after installation
is no longer encoded in the package itself but in the preset policy of
the distro/spin/admin. Since there's only one possible operation here
we only have one macro for postinst: the one which invokes "systemctl
preset".

In other words:

A) There's one postinst script that invokes "systemctl enable"
B) There's another one that does not invoke systemctl, and leaves the service 
off
C) There's a third one that invokes "systemctl preset"

In F16/F17 A and B are used. Some packages use A, most packages use B.

In F18 only C is used. All packages use C. 

In F18 we have a macro that implements C. We have no macro that
implements A or B.

Now, you are asking me to provide a macro with the same name and
functionality in F16/F17 as the one we introduced for F18, right? But
how could we do this? If on F18 the macro implements C, what would it
implement on F16/F17? Would it implement A? If so, it would be useless
for all packages whose service needs to stay off after
installation. Would it implement B? If so, it would be useless for all
packages whose service needs to be enabled after installation.

Of course we could introduce new macros for both A and B, so that we'd
have three macros, covering all three operations. But who'd be helped
with that? We should introduce new stuff only for new distros, and maybe
backport it. But this would be adding completely new stuff to old
distros that makes no sense anymore on new distros, and hence we
shouldn't do it.

Hope this clarifies this a bit.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-12 Thread Simone Caronni
Hello,

On 13 September 2012 08:06, Lennart Poettering  wrote:
> Since F16/F17 do not have presets we cannot just port those macros
> there. What is one macro in F18 would map to two macros in F16/F17.

Can you please point me to the two macros? I only see a small difference.

I applied the macros to some packages, and the only difference I see
in the expansion of the macros after they have been built in koji are
2 words in the postinstall scriptlet:

Fedora 17:

postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi

Fedora 18+:

postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
# Initial installation
/usr/bin/systemctl preset shellinaboxd.service >/dev/null 2>&1 || :
fi

So out of the 3 macros in the f18+ systemd snippets there's only one
which needs a different expansion.
It seems a rather trivial change to me; is there anything I'm missing?

Thanks,
--Simone


-- 
You cannot discover new oceans unless you have the courage to lose
sight of the shore (R. W. Emerson).
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-09-12 Thread Lennart Poettering
On Fri, 31.08.12 09:21, Simone Caronni (negativ...@gmail.com) wrote:

> 2- What's the status of the back-port of those macros to F16/F17 (with a
> different expansion of course)? Is it under evaluation? Should I wait for
> the resolution of this before starting to add the macros?

Since F16/F17 do not have presets we cannot just port those macros
there. What is one macro in F18 would map to two macros in F16/F17. And
I am pretty sure that introducing a new macro as a stop-gap like this is
a bad idea and we'd never be able to get rid of it again.

Use the macros in F18+, use the old non-macro snippets on older distributions.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-08-31 Thread Simone Caronni
On 31 August 2012 15:25, Tom Callaway  wrote:

> > 1- Since the packages I mantain build on RHEL5+ and Fedora 16+ (and have
> > for a long time), can I assume these macros in the spec file is optional?
> > If that's the case, what should I do with the bugs opened?
>
> I'd have to defer to FESCo on that.
>
> > 2- What's the status of the back-port of those macros to F16/F17 (with a
> > different expansion of course)? Is it under evaluation? Should I wait
> > for the resolution of this before starting to add the macros?
>
> I have no idea. Lennart has yet to respond.
>

Many thanks,

I will wait some more than, before dealing with those bugs.

Regards,
--Simone


-- 
You cannot discover new oceans unless you have the courage to lose sight of
the shore (R. W. Emerson).
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Systemd macros (f18+)

2012-08-31 Thread Tom Callaway
On 08/31/2012 03:21 AM, Simone Caronni wrote:
> According to the systemd snippets [1], the new macros should be only for
> NEW packages, i.e. those that never had a SysV init script.

The macros apply for both NEW packages and converted packages, in F18+.
There are additional triggers needed if converting from a SysV init
script package, but the scriptlet macros are identical.

> I have a few questions:
> 
> 1- Since the packages I mantain build on RHEL5+ and Fedora 16+ (and have
> for a long time), can I assume these macros in the spec file is optional?
> If that's the case, what should I do with the bugs opened?

I'd have to defer to FESCo on that.

> 2- What's the status of the back-port of those macros to F16/F17 (with a
> different expansion of course)? Is it under evaluation? Should I wait
> for the resolution of this before starting to add the macros?

I have no idea. Lennart has yet to respond.

> 3- If I should start putting the macros in now in the spec files and
> still keep the option to build the same package on all EPEL/Fedora
> supported distributions, can I assume RHEL 7 = Fedora 18 for the various
> %if/%elif?

I can't speak to that either, sorry.

~tom

==
Fedora Project
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Systemd macros (f18+)

2012-08-31 Thread Simone Caronni
Hello,

sorry to bring up the discussion again but I still have some grey areas in
my head.
According to the systemd snippets [1], the new macros should be only for
NEW packages, i.e. those that never had a SysV init script.

I have a few questions:

1- Since the packages I mantain build on RHEL5+ and Fedora 16+ (and have
for a long time), can I assume these macros in the spec file is optional?
If that's the case, what should I do with the bugs opened?

2- What's the status of the back-port of those macros to F16/F17 (with a
different expansion of course)? Is it under evaluation? Should I wait for
the resolution of this before starting to add the macros?

3- If I should start putting the macros in now in the spec files and still
keep the option to build the same package on all EPEL/Fedora supported
distributions, can I assume RHEL 7 = Fedora 18 for the various %if/%elif?

Thanks,
--Simone

[1] https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

-- 
You cannot discover new oceans unless you have the courage to lose sight of
the shore (R. W. Emerson).
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel