:: Re: [DNG] Packaging an init script …
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Rainer Weikusat
日付:  
To: dng
題目: Re: [DNG] Packaging an init script for another package
Tom via Dng <dng@???> writes:
> I’ve recently upgraded my icinga2 packages from upstream and noticed
> that the transition from icingadb-redis-server package to
> icingadb-redis dropped the init script and logrotate.d script.
>
> I would like to take the relevant files from the previous package
> version and create my own local package to hold them. Is there a
> documented process for a package to install sysv init scripts for
> another package?
>
> Should I try to copy the packaging config of orphan-sysvinit-scripts
> and adapt it for these icinga init scripts? Or is there a simpler way
> to get dpkg to install an init script under the name of another
> package?
>
> I’m guessing I can use the standard deb packagename.install file for
> logrotate.d/ and /etc/default/ files but I’m just not sure how I
> should be handling the /etc/init.d/ files.


debhelper can handle this. For init.d scripts and /etc/default files,
that's done by dh_installinit. Ordinarly, it expects files named
packagename.init and package.name default in the debian/ subdirectory of
a debianized source tree which will be installed as
/etc/init.d/packagename and /etc/default/packagename. It's possible to
use an override target in debian/rules to specifiy a different name, eg,

override_dh_installinit:
    dh_installinit --name=ca-server --no-scripts


That's from a package called mkpem-tools and it'll install the
debian/ca-server.init file as init.d script for it (and would install
ca-server.default if there was one).

dh_installlogorotate also supports this option.