[09:41] <schopin> Does anyone know of a clean way to detect in a postinst script if we're installing via apt (or a libapt-using application) vs manual install ?
[09:42] <cjwatson> That sounds like a very weird requirement.  What are you trying to do?
[09:43] <cjwatson> Packages are not normally permitted to care about that.
[09:45] <schopin> I'm working on making pam use needrestart, and as a first step I'd like for it to just not run its hand-rolled version if running in APT context with the needrestart hook installed.
[09:46] <cjwatson> If this is for an official Ubuntu package then I'm pretty sure you'll need to find another approach.
[09:47] <cjwatson> (There are probably aspects of the environment that would hint at this, but nothing guaranteed by policy)
[09:48] <schopin> I took the idea from the openssl package, which already does this regardless of the way dpkg is called : https://git.launchpad.net/ubuntu/+source/openssl/tree/debian/libssl1.1.postinst#n59
[09:49] <cjwatson> To clarify, what I mean is that packages are not permitted to detect whether they're running inside apt
[09:49] <cjwatson> As far as I know
[09:49] <cjwatson> I have no opinion about how needrestart might be hooked up :)
[11:37] <rbasak> schopin: maybe your check really ought to be reframed to "needrestart is installed and enabled"? Then you could do various things to detect that which less depend on the packaging infrastructure. Eg. /etc/default/, if there's nothing else already.
[11:57] <schopin> rbasak: it all depends on what is the definition of "enabled" for needrestart. AFAICT it only uses APT hooks to do its job, not DPKG triggers, so even if I can tell that it is enabled on the system, I cannot be sure it is going to be active on this particular package installation.
[12:31] <rbasak> schopin: I don't think you need to know that. It would do if you know if it's _supposed_ (ie. configured) to be enabled.
[12:32] <rbasak> You don't need to defend yourself against misconfiguration so much, IMHO.
[12:49] <schopin> OK then, anyone feeling like sponsoring the needrestart patch to pam ? LP #1935972
[12:49] <schopin> vorlon perhaps? ^
[14:36] <bdmurray> schopin: I can and did have a look at pam. The changelog should have impish so it can be more easily sponsored.
[14:37] <bdmurray> schopin: also given that you opened a bug about this you should reference it in the changelog i.e. (LP: #1935972)
[14:54] <schopin> bdmurray: thanks for the review! Fixed.
[19:02] <phibs> anyone know how to generate the by-hash metadata on a repo?
[19:55] <rbasak> cjwatson: o/ you used to have a fork of Debian Policy published somewhere for Ubuntu. But I can't find it any more. Is that still current / intended to form Ubuntu policy?