FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 09-01-2011, 07:08 PM
Bill Nottingham
 
Default Initscript migration to systemd: triggerun called on downgrade

Petr Pisar (ppisar@redhat.com) said:
> I'm migrating quota_nld service (provided by quota_nld subpackage of
> quota spec) to systemd.
>
> Offical howto <https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_ a_systemd_unit_file_from_a_SysV_initscript> recommends:
>
> %triggerun -- httpd < 1.0-2
> # Save the current service runlevel info
> [...]
>
> where `httpd < 1.0-2' are httpd packages older then 1.0-2 under
> uninstallation and `1.0-2' is first httpd version with systemd support.
>
> I modifed quota accoding this how-to, build a package (everything
> locally) and I play with upgrades/downgrades between current F17 version
> and this new one.
>
> Everything works except the triggerun script is called even if doing
> downgrade. Is it intentional and I do not understand triggers, or is it
> a bug in RPM?

The above triggerun would be called on any uninstallation of httpd less
than 1.0-2, whether you're upgrading or downgrading.

Bill
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 09-02-2011, 07:53 AM
Petr Pisar
 
Default Initscript migration to systemd: triggerun called on downgrade

On 2011-09-01, Bill Nottingham <notting@redhat.com> wrote:
> Petr Pisar (ppisar@redhat.com) said:
>> I'm migrating quota_nld service (provided by quota_nld subpackage of
>> quota spec) to systemd.
>>
>> Offical howto <https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_ a_systemd_unit_file_from_a_SysV_initscript> recommends:
>>
>> %triggerun -- httpd < 1.0-2
>> # Save the current service runlevel info
>> [...]
>>
>> where `httpd < 1.0-2' are httpd packages older then 1.0-2 under
>> uninstallation and `1.0-2' is first httpd version with systemd support.
>>
>> I modifed quota accoding this how-to, build a package (everything
>> locally) and I play with upgrades/downgrades between current F17 version
>> and this new one.
>>
>> Everything works except the triggerun script is called even if doing
>> downgrade. Is it intentional and I do not understand triggers, or is it
>> a bug in RPM?
>
> The above triggerun would be called on any uninstallation of httpd less
> than 1.0-2, whether you're upgrading or downgrading.
>
And that's the point. If only httpd-1.0-2 is installed and you do
downgrade to httpd-1.0-1, then the triggerun will be executed which
is what I do not expect because no httpd less then 1.0-2 can be
uninstalled at the time.

BTW I've pushed quota-1:4.00-2 to F17. This is the version doing the
migration with triggerun. I print a message by the triggerun script, so
you see it's run even when downgrading to 1:4.00-1.

-- Petr

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 09-02-2011, 08:33 AM
Iain Arnell
 
Default Initscript migration to systemd: triggerun called on downgrade

On Fri, Sep 2, 2011 at 9:53 AM, Petr Pisar <ppisar@redhat.com> wrote:
> On 2011-09-01, Bill Nottingham <notting@redhat.com> wrote:
>> Petr Pisar (ppisar@redhat.com) said:
>>> I'm migrating quota_nld service (provided by quota_nld subpackage of
>>> quota spec) to systemd.
>>>
>>> Offical howto <https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_ a_systemd_unit_file_from_a_SysV_initscript> recommends:
>>>
>>> %triggerun -- httpd < 1.0-2
>>> # Save the current service runlevel info
>>> [...]
>>>
>>> where `httpd < 1.0-2' are httpd packages older then 1.0-2 under
>>> uninstallation and `1.0-2' is first httpd version with systemd support.
>>>
>>> I modifed quota accoding this how-to, build a package (everything
>>> locally) and I play with upgrades/downgrades between current F17 version
>>> and this new one.
>>>
>>> Everything works except the triggerun script is called even if doing
>>> downgrade. Is it intentional and I do not understand triggers, or is it
>>> a bug in RPM?
>>
>> The above triggerun would be called on any uninstallation of httpd less
>> than 1.0-2, whether you're upgrading or downgrading.
>>
> And that's the point. If only httpd-1.0-2 is installed and you do
> downgrade to httpd-1.0-1, then the triggerun will be executed which
> is what I do not expect because no httpd less then 1.0-2 can be
> uninstalled at the time.

The trigger is run in two situations. When the source package (i.e.
the package containing the triggerun, in this case, httpd-1.0-2) is
already installed and the target (httpd < 1.0-2) removed, or when the
target is already installed and the source removed. When downgrading,
the source package "httpd-1.0-2" is being uninstalled while the target
"httpd < 1.0-2" is already present on the system. You could use
triggerpostun instead - that will run only after the target is
removed, but not when the source package is removed. See "triggers"
under /usr/share/doc/rpm-4.x.y.

--
Iain.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 09-02-2011, 09:09 AM
Petr Pisar
 
Default Initscript migration to systemd: triggerun called on downgrade

On 2011-09-02, Iain Arnell <iarnell@gmail.com> wrote:
> On Fri, Sep 2, 2011 at 9:53 AM, Petr Pisar <ppisar@redhat.com> wrote:
>> On 2011-09-01, Bill Nottingham <notting@redhat.com> wrote:
>>> Petr Pisar (ppisar@redhat.com) said:
>>>> I'm migrating quota_nld service (provided by quota_nld subpackage of
>>>> quota spec) to systemd.
>>>>
>>>> Offical howto <https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_ a_systemd_unit_file_from_a_SysV_initscript> recommends:
>>>>
>>>> %triggerun -- httpd < 1.0-2
>>>> # Save the current service runlevel info
>>>> [...]
>>>>
>>>> where `httpd < 1.0-2' are httpd packages older then 1.0-2 under
>>>> uninstallation and `1.0-2' is first httpd version with systemd support.
>>>>
>>>> I modifed quota accoding this how-to, build a package (everything
>>>> locally) and I play with upgrades/downgrades between current F17 version
>>>> and this new one.
>>>>
>>>> Everything works except the triggerun script is called even if doing
>>>> downgrade. Is it intentional and I do not understand triggers, or is it
>>>> a bug in RPM?
>>>
>>> The above triggerun would be called on any uninstallation of httpd less
>>> than 1.0-2, whether you're upgrading or downgrading.
>>>
>> And that's the point. If only httpd-1.0-2 is installed and you do
>> downgrade to httpd-1.0-1, then the triggerun will be executed which
>> is what I do not expect because no httpd less then 1.0-2 can be
>> uninstalled at the time.
>
> The trigger is run in two situations. When the source package (i.e.
> the package containing the triggerun, in this case, httpd-1.0-2) is
> already installed and the target (httpd < 1.0-2) removed, or when the
> target is already installed and the source removed. When downgrading,
> the source package "httpd-1.0-2" is being uninstalled while the target
> "httpd < 1.0-2" is already present on the system. You could use
> triggerpostun instead - that will run only after the target is
> removed, but not when the source package is removed. See "triggers"
> under /usr/share/doc/rpm-4.x.y.
>
I thought triggerun is executed only if a package matching target is
being uninstalled. I missed the notice in `An Unusual Case' section of
triggers documentation. (In my opinion, the documentation is poorly
written. There is no specification when triggerun and triggerin are
exectuted. There is only bunch of examples which do not assure
completeness.)

Then why does migration how-to use triggerun instead of triggerpostun?
I cannot see reason why the code should be executed on downgrade.

(Also I thinkg the triggers should use `-n' option to bind to specific
subpackage to prevent execution when uninstalling independend
subpackage.)

-- Petr

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 09-02-2011, 04:11 PM
Bill Nottingham
 
Default Initscript migration to systemd: triggerun called on downgrade

Petr Pisar (ppisar@redhat.com) said:
> Then why does migration how-to use triggerun instead of triggerpostun?
> I cannot see reason why the code should be executed on downgrade.

%triggerpostun runs after the old version is uninstalled - you can't
save any state then.

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

Thread Tools




All times are GMT. The time now is 07:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org