[Fedora-packaging] Systemd scriptlet comments

Ville Skyttä ville.skytta at iki.fi
Fri Jun 24 10:37:02 UTC 2011


On 06/22/2011 07:24 PM, Toshio Kuratomi wrote:
> On Fri, Jun 03, 2011 at 11:02:34PM +0300, Ville Skyttä wrote:
>> Some comments on systemd scriptlets at
>> http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
>>
>> 1) I don't think the versioned trigger logic will work too well at all
>> in the (not that rare) cases where the previous distro had sysv scripts
>> and one does a version bump in the previous distro - the trigger in the
>> next one will no longer run on distro upgrades because of the
>> versioning.  Wouldn't it work better to just drop the version from the
>> trigger altogether, and instead check if the old init script exists?
>> For example:
>>
>> %triggerun -- httpd
>> [ -e %{_initddir}/httpd ] || exit 0
>> # rest of the migration stuff goes here
>>
> We discussed this when we came up with the guidelines.  IIRC, we finally
> decided this wasn't workable because we don't prevent people from packaging
> systemVinit scripts (either in subpackages or in a wholly separate package.
> 
> I agree with your points about fragility, though.  If you can think of a way
> that handles both I'd be happy to hear it.

Just a couple of unfiltered thoughts, reader beware; haven't spent much
thought or time on these yet:

a) If people do package/have sysv scripts alongside systemd ones, is it
desirable to make the systemd migration happen on upgrades in the first
place?

b) Maybe checking for existence of the systemd unit file in addition to
the sysv script in the above recipe could have some positive properties.

For the packages I migrate to systemd, I don't plan to keep any sysv
init scripts around, and the version bump problem would lurk out there
ready to bite if I used the currently documented scriptlets.  So I'm
going to use the sysv script existence check way instead.

>> 3) More or less cosmetic: why hardwire absolute paths everywhere?  The
>> vast majority of other scriptlet snippets don't do that.
> 
> I've replaced /usr/bin with %{_bindir} now.

That removes the "hardwire" part for a few cases, but doesn't address
the "absolute" part.

> Are there other paths that we could change?

I'd personally remove all absolute paths to commands in standard PATH
from the scripts altogether where possible, macroized or not.  The
Gconf, GSettings, gdk-pixbuf, GTK+ modules, GIO modules, Scrollkeeper,
desktop-database, mimeinfo, and Icon Cache scriptlets and macros are
already written without unnecessary absolute paths.  The only ones that
do contain apparently unnecessary absolute paths are Systemd and
Texinfo.  Why?


More information about the packaging mailing list