<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body text="#000000" bgcolor="#FFFFFF">Thomas<br>
<br>
I agree that my change works, but introduces the potential for problems,
 and therefore may not be the "correct" answer. In fact I have no 
confirmation that everything is okay. Everything appears to be okay 
after upgrade, except that <span style="font-style: italic;">tracking 
cent</span><span style="font-style: italic;">er</span> loops forever 
with a "connection error". However I did not press matters to determine 
if there truly is an issue.<span style="font-style: italic;"></span><br>
<br>
The environment...<br>
PVE: 5.3-12<br>
PMG: 5.1-3<br>
<br>
The is a test environment, so we are using your community repo, not 
subscription. However it is happening in subscription as well.<br>
<br>
PMG is running inside a container based on Debian Stretch. It is about 
as unmodified as you can get.<br>
<br>
We did make modifications to the PMG install. They are limited to 
/var/lib/pmg/templates/main.cf.in and /var/lib/pmg/templates/init.pre.in<br>
(geoip) and some custom spamassassin rules. Beyond that, nothing has 
been touched.<br>
<br>
The upgrade failure happens at the very end during the configuration 
phase. As the post mentioned, I traced the issue to <span 
style="font-style: italic;">PMG:: DBTools:: postgres_admin_cmd</span>. 
But you have already reviewed the post and the code, so you already know
 that.<br>
<br>
<img src="cid:part1.1E157B9D.DA2ED2D5@patanne.com" name="image.png" 
alt=""><br>
<br>
Let me know how I can help further.<br>
<br>
<br>
<br>
<span>Thomas Lamprecht wrote on 4/12/19 11:23 AM:</span><br>
<blockquote type="cite" 
cite="mid:cc5eba32-9292-39ab-cf05-0ec80e1b800b@proxmox.com">
  <pre wrap="">Hi,

On 4/12/19 4:17 PM, Patrick Fogarty wrote:
</pre>
  <blockquote type="cite"><pre wrap="">If you follow this thread...
<a class="moz-txt-link-freetext" href="https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/">https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/</a>

...you will find that I had an issue, as did others, performing upgrades/updates. I adjusted my code manually and things went back to normal. Last month you released PMG 5.2. The upgrade downloads a package that includes the original code, so the upgrade overwrites my changes, then fails the upgrade process "pmg-api --configure", after which I believe the process is in an incomplete state.

How can I assist, beyond my post in the above thread, showing the code change I made?
</pre></blockquote>
  <pre wrap="">
Either, you could sent a patch here, for this see:
<a class="moz-txt-link-freetext" href="https://pve.proxmox.com/wiki/Developer_Documentation">https://pve.proxmox.com/wiki/Developer_Documentation</a>
(while written for PVE, almost all is valid for PMG too)

Else you normally also can make a Bug report, which does not gets as easily forgotten as
some Forum/Mailing list thread: <a class="moz-txt-link-freetext" href="https://bugzilla.proxmox.com/enter_bug.cgi">https://bugzilla.proxmox.com/enter_bug.cgi</a>

But posting here may be enough this time, Stoiko, could you please take a look
at the proposed change:
<a class="moz-txt-link-freetext" href="https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/#post-233016">https://forum.proxmox.com/threads/setuid-postgres-114-failed-inappropriate-ioctl-for-device.41414/#post-233016</a>

Looking at perl's source code at the Perl_magic_set case for EUID (case '>')
we just see that there's no special error handling, thus the recommendation
to check $! (errno or sys_errlist[errno] depending on context) after the call.

We do that, and it seems correct, so either we need to reset it to 0 befor the
seteuid call to ensure we do not check an old value or this is correct an the
seteuid really fails in the posted case..

Patrick, can you post a bit more details about your setup, you said you run it in
PVE, inside a Virtual Machine (VM) or Container (CT)?

Because your change could just omit error checking completely, and thus not be
the "correct" solution here..

cheers,
Thomas


</pre>
</blockquote>
<br>
</body></html>