-
Notifications
You must be signed in to change notification settings - Fork 372
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
Added support for devuan linux distribution #2553
Conversation
(Will only work with Devuan >= 4 (Chimaera) - reason is that in Devuan < 4, the platform.linux_distribution module is used to get distro details - and this module is unable to distinguish between Debian and Devuan. In Chimaera, python3 is 3.9, and in this, platform.linux_distribution has been removed, so that distro details are obtained using distro.linux_distribution - which is able to distinguish between Debian and Devuan) Details: - added azurelinuxagent/common/osutil/devuan.py - modified azurelinuxagent/common/osutil/factory.py to use devuan.py - added init and config files for devuan - modified setup.py for devuan support - modified tests/common/osutil/test_factory.py to test devuan support
d500689
to
d7b3d60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updated PR, and sorry the long, long delay getting to this.
LGTM, but have a few questions/comments that I posted in my review.
Thanks again.
config/devuan/waagent.conf
Outdated
# Add firewall rules to protect access to Azure host node services | ||
# Note: | ||
# - The default is false to protect the state of existing VMs | ||
OS.EnableFirewall=n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not recommend disabling this, what is the motivation for defaulting to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Norberto, thanks for looking into the changes for this pull request.
I based the default waagent.conf for devuan on the one for debian, and this appears to be the only one in which OS.EnableFirewall is disabled. I'm happy to enable it in the waagent.conf for devuan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just uploaded three changes to the devuan_support_new branch. The changes include setting waagent.conf to default to OS.EnableFirewall to y
# non-daemon instances of waagent may be running concurrently (e.g. when | ||
# "waagent -deprovision" is being run) and attempts to ensure that any | ||
# non-daemon instances are preserved when the daemon instance is stopped. | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the motivation for the checks on the pid file? i'm a little concerned about those because we are planning on re-structuring the agent and may not need a pid file, and not having that file may affect this script.
in particular "waagent -deprovision" should not be executed while the agent service is running, since a running agent may re-create part of the state that deprovision is trying to delete,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new init script was based on observations whilst trying waagent on a local test VM - I noticed that using the existing init script, an attempt to stop waagent also killed an instance which was running in a terminal. I can't remember what the terminal instance was running - it wasn't a deprovision. The script was an attempt to cope with any foreseeable possibility - maybe it addresses possibilities which couldn't actually exist in practice.
I wondered about rewriting the script so that it doesn't rely on PID files, and works out which are the daemon and non-daemon instances just from the output of the ps command. That should insulate it against any possibility that the use of pidfiles could be dropped in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just uploaded a new version of the devuan init script - I've rewritten it completely to remove all references to, and operations on, a pid file: it now operates only on the basis of output from the ps command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update
… pidfile, and simplified status to reflect this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of minor comments (about commented-out code), but LGTM
i'll do an automation run tomorrow morning
thanks for your contribution. and sorry again for all the delays
init/devuan/walinuxagent
Outdated
local NDPIDLIST i NDPIDCT | ||
declare -a NDPIDLIST | ||
debugmsg "check_non_daemon_instance: after init, #NDPIDLIST=${#NDPIDLIST[*]}" | ||
# NDPIDLIST=$( ps ax | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left-over code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now removed the commented-out lines (I'd only retained them for reference during local testing).
init/devuan/walinuxagent
Outdated
# just start waagent | ||
debugmsg "start_waagent: waagent is not currently running" | ||
log_daemon_msg "Starting ${NAME} daemon" | ||
# start-stop-daemon --start --quiet --pidfile ${PIDFILE} --background --name "${NAME}" --exec ${INTERPRETER} -- ${DAEMON} ${DAEMON_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now removed the commented-out code lines - only retained for reference during local testing.
init/devuan/walinuxagent
Outdated
debugmsg "start_waagent: trying to stop waagent first, and then start it" | ||
stop_waagent | ||
log_daemon_msg "Starting ${NAME} daemon" | ||
# start-stop-daemon --start --quiet --pidfile ${PIDFILE} --background --name ${NAME} --exec ${INTERPRETER} -- ${DAEMON} ${DAEMON_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now removed the commented-out codelines - I'd retained them for reference during local testing
# non-daemon instances of waagent may be running concurrently (e.g. when | ||
# "waagent -deprovision" is being run) and attempts to ensure that any | ||
# non-daemon instances are preserved when the daemon instance is stopped. | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update
Codecov Report
@@ Coverage Diff @@
## develop #2553 +/- ##
===========================================
- Coverage 71.90% 71.88% -0.02%
===========================================
Files 102 103 +1
Lines 15476 15503 +27
Branches 2464 2466 +2
===========================================
+ Hits 11128 11145 +17
- Misses 3848 3858 +10
Partials 500 500
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, waiting for end-to-end testing to merge.
@peter9370 Automation looks OK. Would you check my comments wrt commented-out code and update as needed? I can merge after that. Thanks! |
…d up some comments
@narrieta Thanks for that - yes, sorry, I had left in some commented-out code lines in the walinuxagent init script: it was mainly for reference in local testing. I've removed the commented-out lines now, and also tidied up a few comments. No worries about the delay in reviewing the pull request - I know things have been hard in the past two years. |
@peter9370 thank for this PR! |
@narrieta You're welcome - thanks for reviewing and merging my changes. |
@narrieta Hi Norberto - do you have any idea when the changes to include devuan support will be included in a release? |
@peter9370 We should start our next release within 2-3 weeks and this commit will be included there. |
Description
Issue #
Added support for linux distribution devuan
Will only work on devuan version 4 (chimaera) or later. In earlier versions of devuan, waagent uses the python module platform.linux_distribution to get the distribution details. If run under devuan, this incorrectly reports "debian" as the distro.
Devuan version 4 uses python 3.9, and in this, platform.linux_distribution has been removed, forcing waagent to use
distro.linux_distribution instead: this correctly identifies devuan.
PR information
Quality of Code and Contribution Guidelines