Thank you, Neils,

> Ubuntu has patched debhelper

Sounds weird. I thought you guys had some communication with each other.

I changed the compact to 13 and indeed the scripts were generated and
included into the resulting package.
When changed to 14 scripts remains the same, no prerm script and nothing
about starting/stopping.

But when changed to 15 then the build failed:

dh_missing: warning: root/.ssh/sshtunnel.config.sh exists in debian/tmp but
is not installed to anywhere
dh_missing: error: missing files, aborting
        The following debhelper tools have reported what they installed
(with files per package)
         * dh_installdocs: sshtunnel (0)

The debuild created /debian/tmp/ folder and copied all files there.
Previously it copied files to /debian/sshtunnel


I pushed the compact 14 version to a separate branch:
https://github.com/yurt-page/sshtunnel/tree/1.3.x

I'll use the old compact level for now because I want to support old
releases.
I wish to send the ssh tunnel script to the OpenSSH client itself and am
not sure what to do: require the compact 14 or again add scripts manually.

Thank you for the quick response.


On Mon, Mar 25, 2024 at 7:25 PM Niels Thykier <ni...@thykier.net> wrote:

> Sergey Ponomarev:
> > Hi Niels,
> >
> > I upgraded to Ubuntu 24.04 and now have debhelper 13.14.1ubuntu1.
>
>
> Hi,
>
> In case you are using Ubuntu, you should be filing the bug against
> Ubuntu for future reference. Notably, Ubuntu has patched debhelper and
> even monkey-patch(ed?) debhelper in their official builds on top that.
> Therefore, they have to screen incoming bug reports first to ensure the
> bug is not introduced by their patches.
>
> > Once executed the debuild nothing was generated.
> > When executed the dh_installsystemduser manually also nothing was
> generated.
> >  From it's sources I found that it looks for some dependency and I added
> to
> > the /debian/control:
> >
> >      Depends: ${misc:Depends}
> >
> > Now this helped and two install/uninstall scripts were generated
> > /debian/sshtunnel.postinst.debhelper
> > /debian/sshtunnel.postrm.debhelper
> >
> > I manually included the scripts to /debian/postinst and /debian/postrm
> and
> > built the deb.
>
>
> If you had to "manually" include those snippets into the deb in a clean
> build, then I think there is something seriously wrong with the
> packaging. Normally, `dh_installdeb` would do that for you if the
> commands are run in the correct sequence.
>
> Now, you mention you ran it manually. So it is possible you did that
> manually after building the deb, in which case you would see this
> behavior. This would also fit that your `debian/rules` likes quite
> standard without any room for mistakes of this kind when I checked it.
>
>
> > It was installed successfully but didn't start the service.
> > I started manually. During uninstall it has not been stopped. There is no
> > prerm script that will do that.
> >
>
> No, this feature is first added in compat 14 apparently (which is not
> stable yet). Sadly, this is not documented in the upgrade checklist for
> reasons I do not understand. The commit that introduced the feature
> recorded it in the wrong place and the remark seems to be completely gone.
>
> I will follow up on this part.
>
> > So the issues are:
> > 1. The debhelper did not execute the dh_installsystemduser. I guess I
> must
> > add it manually to /debian/rules
>
> Either that or you could use the proper debhelper-compat level.  That is
> compat 12 or later would do. The package you linked to used compat 11 as
> I recall.
>
> Remember to check the debhelper compat upgrade checklist before you
> update the compat level.
>
> It is in `man 7 debhelper-compat-upgrade-checklist` or `man 7 debhelper`
> (depending on the debhelper version).
>
> > 2. The generated scripts do not start the service after installation.
> > 3. Missing prerm script to stop the service.
>
> As mentioned above, this is compat 14 stuff.
>
> > 4. Surprising need for for ${misc:Depends}
> >
>
> There is no such need in the Debian version of debhelper for
> dh_installsystemduser to generate the snippets. However,
> dh_installsystemduser must either install the services files *or* be run
> after they are installed at the correct location.
>    My best guess is that you ran dh_installsystemduser to "early" the
> first time, then the files were in place, followed by you tweaking
> debian/control and then running dh_installsystemduser without clean
> first. That is basically the one way I can make sense of what happened.
>
> That said, you ought have that dependency anyway for other reasons (at
> least up to compat 14, where it will be applied automatically).
>
> > So far I will anyway continue to use the manual scripts because I wish to
> > support old distros.
> > Anyway I wanted to have good and proper "official" scripts to install the
> > user service.
> >
> > You can play with my simple package here:
> > http://github.com/yurt-page/sshtunnel
> >
> > It can be a good sample and test ground.
> >
> > Best regards and thank you for your work,
> > Sergey
> >
> > [...]
>
>  From my PoV, I will acknowledge that the compat checklist is missing
> the remark that `dh_installsystemduser` changes behavior in compat 14 by
> adding start+stop snippets for user services.
>
> For the other parts, I am not seeing anything that I can be sure is a
> bug in debhelper vs. issues caused by ad-hoc debugging / something else.
> At least not in Debian's version of debhelper.
>
> Best regards,
> Niels
>
> PS: I suspect your `debian/dirs` file is (mostly?) redundant, since your
> `Makefile` does the `mkdir -p` necessary.
>
>

Reply via email to