On Mon, Mar 18, 2013 at 5:22 AM, Reindl Harald <h.rei...@thelounge.net> wrote:
>
>
> Am 18.03.2013 08:27, schrieb Nico Kadel-Garcia:
>> On Sun, Mar 17, 2013 at 8:10 PM, Reindl Harald <h.rei...@thelounge.net> 
>> wrote:
>>>
>>>
>>> Am 18.03.2013 01:06, schrieb Nico Kadel-Garcia:
>>>> On Sun, Mar 17, 2013 at 12:36 PM, Peter Lemenkov <lemen...@gmail.com> 
>>>> wrote:
>>>>> 2013/3/15 Lukáš Nykrýn <lnyk...@redhat.com>:
>>>>>> After usr move packages should not install files to /sbin. Unfortunately
>>>>>> there is a lot of packages requiring /sbin/service, which was recently 
>>>>>> moved
>>>>>> to /usr/sbin/, and these packages were uninstallable. As a workaround I 
>>>>>> have
>>>>>> put Provides: /sbin/service in the initscript spec, but I think that we
>>>>>> should do a proper fix.
>>>>>>
>>>>>> So if your package is in following list, please change your Reguires to
>>>>>> /usr/sbin/service.
>>>>> ...
>>>>>> rtpproxy
>>>>>
>>>>> Fixed.
>>>>
>>>> This is a bad, bad, bad idea for any packages that are going to remain
>>>> backwards compatible with RHEL, for compilation under EPEL or other
>>>> backporting.  Either switch to systemd, or stick with the old location
>>>> and allow initscripts to correctly include the old reference. Do not
>>>> pick a hallfways "fix" that isn't backwards compatible at all.
>>>
>>> * Fedora has done UsrMove with F17
>>> * Now we have F18
>>> * in a short we have F19
>>> * RHEL7 will be base on F18/F19
>>>
>>> ANY reference in Fedora to /sbin and /bin is BOGUS
>>> it leads to all sorts of troubles
>>> it leads to additional symlink reslovement
>>
>> If SysV init style scripts are staying in use, even as a compatibility
>> fallback, don't edit the references to them just to prove something.
>> It breaks backporting and forward porting and cross-compatibility for
>> every existing versoin of RHEL, which are still needed for
>> compatibility because *systemd can't be ported back to RHEL 6 or
>> earlier.* I've tried, it's a dependency and critical component upgrade
>> nightmare
>
> so what - then it needs a lot of if-clauses in the SPEC
>
> it makes pretty no sense to wait 10 years until the
> last RHEL version is on systemd and has also UsrMove
> to finish this things for fedora

Yes, it means wait 10 years, just as it does for most software using
"/bin/rm" and "/bin/mkdir".  Or at least don't aggressively go update
*every single* init script using package in a way that breaks
compatibility with every older distribution for no performance gain.
Switch to systemd instead, which actually gets you an improvement.
There are examples of just how to do that  in my Samba 4.0.3 backport
to RHEL 6 work at:

In particular, if you have to backport a systemd written Fedora
package to older Fedora or RHEL, use something like this from
https://github.com/nkadel/samba-4.0.3-srpm/blob/master/samba.spec.
I've somewhat simplified the example below to leave out the more
complex domain controller and winbind examples, but it's solid working
code, and I'd resent having to stuff in another set of conditionals
because the "/sbin/chkconfig" and "/sbin/server" paths, which will
remain valid, are simply not mentioned in another more basic RPM.

# Use systemd, not SysV init scripts, as appropriate
%if 0%{?fedora} > 15 || 0%{?rhel} > 6
%global with_systemd 1
%else
%global with_systemd 0
%endif

# RHEL specific init scripts, in case systemd not available
Source100: nmb.init
Source101: smb.init

%if %with_systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): /sbin/chkconfig, /sbin/service
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/chkconfig, /sbin/service
%endif

%if %with_systemd
install -d -m 0755 %{buildroot}%{_unitdir}
%if %with_dc
for i in nmb smb ; do
%else
for i in nmb smb; do
%endif # with_dc
    cat packaging/systemd/$i.service | sed -e
's@Type=forking@Type=forking\nEnvironment=KRB5CCNAME=/run/samba/krb5cc_samba@g'
>tmp$i.service
    install -m 0644 tmp$i.service %{buildroot}%{_unitdir}/$i.service
done
%else
install -d -m 0755 %{buildroot}%{_initrddir}
install -m 0755 %{SOURCE100} %{buildroot}%{_initrddir}/nmb
install -m 0755 %{SOURCE101} %{buildroot}%{_initrddir}/smb
%endif # with_systemd

%post
%if %with_systemd
%systemd_post smb.service
%systemd_post nmb.service
%else
/sbin/chkconfig --add smb
/sbin/chkconfig --add nmb
if [ "$1" -ge "1" ]; then
    /sbin/service smb condrestart >/dev/null 2>&1 || :
    /sbin/service nmb condrestart >/dev/null 2>&1 || :
fi
%endif # with_systemd
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reply via email to