/srv/irclogs.ubuntu.com/2021/07/13/#ubuntu-devel.txt

=== tomreyn_ is now known as tomreyn
schopinDoes 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:41
cjwatsonThat sounds like a very weird requirement.  What are you trying to do?09:42
cjwatsonPackages are not normally permitted to care about that.09:43
schopinI'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:45
cjwatsonIf this is for an official Ubuntu package then I'm pretty sure you'll need to find another approach.09:46
cjwatson(There are probably aspects of the environment that would hint at this, but nothing guaranteed by policy)09:47
schopinI 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#n5909:48
cjwatsonTo clarify, what I mean is that packages are not permitted to detect whether they're running inside apt09:49
cjwatsonAs far as I know09:49
cjwatsonI have no opinion about how needrestart might be hooked up :)09:49
rbasakschopin: 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:37
schopinrbasak: 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.11:57
rbasakschopin: 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:31
rbasakYou don't need to defend yourself against misconfiguration so much, IMHO.12:32
schopinOK then, anyone feeling like sponsoring the needrestart patch to pam ? LP #193597212:49
ubottuLaunchpad bug 1935972 in pam (Ubuntu) "postinst: Rely on needrestart when present on the system" [Undecided, New] https://launchpad.net/bugs/193597212:49
schopinvorlon perhaps? ^12:49
=== lucas__ is now known as lucascastro
=== didrocks999 is now known as didrocks
=== jpnurmi_ is now known as jpnurmi
bdmurrayschopin: I can and did have a look at pam. The changelog should have impish so it can be more easily sponsored.14:36
bdmurrayschopin: also given that you opened a bug about this you should reference it in the changelog i.e. (LP: #1935972)14:37
ubottuLaunchpad bug 1935972 in pam (Ubuntu) "postinst: Rely on needrestart when present on the system" [Undecided, New] https://launchpad.net/bugs/193597214:37
schopinbdmurray: thanks for the review! Fixed.14:54
=== genii-core is now known as genii
phibsanyone know how to generate the by-hash metadata on a repo?19:02
rbasakcjwatson: 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?19:55

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!