Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues On Systems With Multiple Python Versions Installed #101

Open
epyonavenger opened this issue Dec 20, 2016 · 7 comments
Open

Issues On Systems With Multiple Python Versions Installed #101

epyonavenger opened this issue Dec 20, 2016 · 7 comments

Comments

@epyonavenger
Copy link

tl;dr: If you have multiple version of Python installed and 2.7 isn't the default, you can have issues.

More specifically, we were happily chugging along on the older version of pdagent, upgraded, and saw that it was failing.

Upon looking at the docs, they said Python 2.7 was required, which we have.

After some amount of head scratching, I found that all the files are pointing at "python" instead of "python2.7" and thus assuming that the system defaults to 2.7.

It'd be nice if either /etc/pdagent.conf or some other place allowed you to override which Python was being called. Potentially this could also be done as part of the apt/yum install actions, to see what should be there and sed it in or some such.

@divtxt
Copy link
Contributor

divtxt commented Dec 27, 2016

pdagent supports 2.6 as well for CentOS 6 support. This is why python is used rather than python2.7.

The simple workaround is to manually change the #!/usr/bin/python line in the various scripts in /usr/share/pdagent/bin after install. (I assume this is what you're doing)

@epyonavenger
Copy link
Author

We're not using CentOS, we're using Debian, but I presume it's the same in any distro that has something other than 2.7 symlinked to "python" in /usr/bin.

That's why my thought was having either a centralized place in config it could be overridden (much like most Java programs allow), or having a post-install action in the packages that make sure it's pointed at 2.7 (and that 2.7 is a dependency of the package).

Also, to confirm your assumption, we are currently changing the top line after doing the install. That just means it's going to get clobbered every update though, which is less than ideal.

@divtxt
Copy link
Contributor

divtxt commented Dec 27, 2016

Yeah - python is expected to be a symlink to the "default" python, and this is 2.6 or 2.7 on pdagent supported distros.

Both your suggested options work, but I think an explicit python2.7 dependency would be simpler by reducing code & permutations to test. It would start installing 2.7 for centos 6 users, but as long as the default python is untouched I think that should be ok.

Also, to confirm your assumption, we are currently changing the top line after doing the install. That just means it's going to get clobbered every update though, which is less than ideal.

Yup. Fortunately, pdagent releases are rare. :)

@divtxt
Copy link
Contributor

divtxt commented Dec 27, 2016

Also, to confirm your assumption, we are currently changing the top line after doing the install. That just means it's going to get clobbered every update though, which is less than ideal.

Yup. Fortunately, pdagent releases are rare. :)

Well, not completely fortunate since rare = not worth automating, and will be forgotten. Hopefully we have this fixed in the next release and there should be no more need for the workaround.

Curious: do you have your pdagent set to auto-update or do you manually update?

@epyonavenger
Copy link
Author

We do an aptitude safe-upgrade at least weekly, if not sooner, such as when there are important security patches released.

To be clear, I don't actually mind employing the workaround, and we have Zabbix making sure that the scripts have the changed line at the top now. I just figured we might not be the only ones who got dinged and was trying to be a good citizen and raise awareness in case it wasn't planned and/or unknown.

The real solution, of course, is for us to upgrade to the latest Debian and have a newer Python linked to by default, but easier said than done there. XD

@divtxt
Copy link
Contributor

divtxt commented Dec 27, 2016

we have Zabbix making sure that the scripts have the changed line at the top now

👍 as long as you're not depending on pdagent for that zabbix alert :D

@epyonavenger
Copy link
Author

Hah. No, that one goes to email, but thanks for the check regardless. XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants