almaconvert8 and lsof return code weirdness [message #53870] |
Tue, 26 November 2024 16:17  |
wsap
Messages: 81 Registered: March 2018 Location: Halifax, NS
|
Member |
|
|
When running almaconvert8 on one specific container, we get this:
subprocess.CalledProcessError: Command '['/sbin/vzctl', 'exec', '$CTID', '/sbin/lsof', '-Pi']' returned non-zero exit status 8
Yet immediately after, when I run: /sbin/vzctl exec $CTID /sbin/lsof -Pi it works fine, and echo $? results in 0 not 8.
Also running vzctl exec - doesn't that result in the return code from vzctl itself rather than lsof? And in this instance wouldn't it be more handy to have it be the return code from lsof, which would mean the command should be vzctl exec2 <rest_of_command>?
I also then tried /sbin/vzctl exec2 $CTID /sbin/lsof -Pi and even then echo $? results in 0 not 8.
vzctl man pages say:
8 = Command executed by vzctl exec returned non-zero exit code
Yet the command returned a 0 when I ran it with exec2 and within the container on its own! How is this possible?
[Updated on: Tue, 26 November 2024 16:21] Report message to a moderator
|
|
|
Re: almaconvert8 and lsof return code weirdness [message #53872 is a reply to message #53870] |
Sun, 01 December 2024 13:36   |
wsap
Messages: 81 Registered: March 2018 Location: Halifax, NS
|
Member |
|
|
I still have no explanation for the return code being 0 when I run it, yet a 1 when almaconvert8 runs it.
There are two workarounds:
1. Stop all daemons using ports (systemctl stop sshd, for example) -- lsof -Pi returns nothing. This has not worked consistently for me.
2. Modify almaconvert8 so it no longer reports on ports by always returning an empty array:
sed -i '/def get_open_ports/a \ \ \ \ return []' /usr/bin/almaconvert8
[Updated on: Fri, 06 December 2024 17:19] Report message to a moderator
|
|
|
Re: almaconvert8 and lsof return code weirdness [message #53873 is a reply to message #53870] |
Fri, 06 December 2024 17:22  |
wsap
Messages: 81 Registered: March 2018 Location: Halifax, NS
|
Member |
|
|
Additional issues with almaconvert8:
TEMPLATES DIR
In some cases the CT's template path can be an invalid symlink, which breaks almaconvert8 processing causing it to exit. To fix it, detect invalid symlinks and remove them prior to running almaconvert8:
TEMPLATES_PATH=/vz/private/$CTID/templates
if [ -L ${TEMPLATES_PATH} ] ; then
if [ -e ${TEMPLATES_PATH} ] ; then
echo "CT Templates symlink exists, ok to proceed normally"
else
echo "CT Templates symlink broken, removing it so almaconvert8 can create it properly..."
rm -f ${TEMPLATES_PATH}
fi
fi
baseX REPO PATHS ERROR
On every run, we get the following errors, however it appears to not cause any problems with the actual conversion:
https://repo.virtuozzo.com/ctpreset/rpm/https%3A//repo.virtuozzo.com/ctpreset/rpm/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
This shows up a few times before it works - presumably not all the mirrors have this glitch.
I would have submit all of this as bugs, but bugs.openvz.org hasn't been allowing logins for a couple weeks.
|
|
|