:: Re: [devuan-dev] log2ram package
Top Page
Delete this message
Reply to this message
Author: Andrew Bower
Date:  
To: devuan developers internal list
Subject: Re: [devuan-dev] log2ram package
Hi Steve,

On Mon, Sep 01, 2025 at 08:46:21AM -0700, Steve M wrote:
> Mark,
>
> Thank you for your help. Is there already a known good mechanism to
> detect which init system is in use and vary the .install file and
> postinst/prerm/postrm scripts accordingly?


Fortunately you don't need to vary the .install file, you can use
dh_installinit and dh_installsystemd to insert their own snippets into
postinst etc. and they will make the right decision at install time.

Even more fortunate is that you are the Debian maintainer so there will be no problem on that front!

Here's an example of adding an initscript to a package with systemd integration:

<https://salsa.debian.org/dns-team/getdns/-/commit/2bba775416ffa72cf48aca45c90ea22121b6ee31>

I think you can probably get rid of the stuff you put in for systemd in postinst, as well - dh_installsystemd lets you decide whether to stop on upgrade etc.

When you install cron jobs make sure you detect if systemd is present, like this:

<https://salsa.debian.org/pkg-security-team/acct/-/blob/debian/master/debian/acct.cron.monthly?ref_type=heads>

I can help you out more if you like!

BTW I think you need to merge into salsa the changes your sponsor made before upload.

Andrew