-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(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
- Loading branch information
Showing
7 changed files
with
831 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# Copyright 2018 Microsoft Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Requires Python 2.6+ and Openssl 1.0+ | ||
# | ||
|
||
import os # pylint: disable=W0611 | ||
import re # pylint: disable=W0611 | ||
import pwd # pylint: disable=W0611 | ||
import shutil # pylint: disable=W0611 | ||
import socket # pylint: disable=W0611 | ||
import array # pylint: disable=W0611 | ||
import struct # pylint: disable=W0611 | ||
import fcntl # pylint: disable=W0611 | ||
import time # pylint: disable=W0611 | ||
import base64 # pylint: disable=W0611 | ||
import azurelinuxagent.common.logger as logger # pylint: disable=W0611 | ||
import azurelinuxagent.common.utils.fileutil as fileutil # pylint: disable=W0611 | ||
import azurelinuxagent.common.utils.shellutil as shellutil | ||
import azurelinuxagent.common.utils.textutil as textutil # pylint: disable=W0611 | ||
from azurelinuxagent.common.osutil.default import DefaultOSUtil | ||
|
||
|
||
class DevuanOSUtil(DefaultOSUtil): | ||
|
||
def __init__(self): | ||
super(DevuanOSUtil, self).__init__() | ||
self.jit_enabled = True | ||
|
||
def restart_ssh_service(self): | ||
logger.info("DevuanOSUtil::restart_ssh_service - trying to restart sshd") | ||
return shellutil.run("/usr/sbin/service restart ssh", chk_err=False) | ||
|
||
def stop_agent_service(self): | ||
logger.info("DevuanOSUtil::stop_agent_service - trying to stop waagent") | ||
return shellutil.run("/usr/sbin/service walinuxagent stop", chk_err=False) | ||
|
||
def start_agent_service(self): | ||
logger.info("DevuanOSUtil::start_agent_service - trying to start waagent") | ||
return shellutil.run("/usr/sbin/service walinuxagent start", chk_err=False) | ||
|
||
def start_network(self): | ||
pass | ||
|
||
def remove_rules_files(self, rules_files=""): | ||
pass | ||
|
||
def restore_rules_files(self, rules_files=""): | ||
pass | ||
|
||
def get_dhcp_lease_endpoint(self): | ||
return self.get_endpoint_from_leases_path('/var/lib/dhcp/dhclient.*.leases') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# | ||
# Microsoft Azure Linux Agent Configuration | ||
# | ||
|
||
# Enable extension handling. Do not disable this unless you do not need password reset, | ||
# backup, monitoring, or any extension handling whatsoever. | ||
Extensions.Enabled=y | ||
|
||
# Which provisioning agent to use. Supported values are "auto" (default), "waagent", | ||
# "cloud-init", or "disabled". | ||
Provisioning.Agent=auto | ||
|
||
# Password authentication for root account will be unavailable. | ||
Provisioning.DeleteRootPassword=y | ||
|
||
# Generate fresh host key pair. | ||
Provisioning.RegenerateSshHostKeyPair=y | ||
|
||
# Supported values are "rsa", "dsa", "ecdsa", "ed25519", and "auto". | ||
# The "auto" option is supported on OpenSSH 5.9 (2011) and later. | ||
Provisioning.SshHostKeyPairType=auto | ||
|
||
# Monitor host name changes and publish changes via DHCP requests. | ||
Provisioning.MonitorHostName=y | ||
|
||
# Decode CustomData from Base64. | ||
Provisioning.DecodeCustomData=n | ||
|
||
# Execute CustomData after provisioning. | ||
Provisioning.ExecuteCustomData=n | ||
|
||
# Algorithm used by crypt when generating password hash. | ||
#Provisioning.PasswordCryptId=6 | ||
|
||
# Length of random salt used when generating password hash. | ||
#Provisioning.PasswordCryptSaltLength=10 | ||
|
||
# Allow reset password of sys user | ||
Provisioning.AllowResetSysUser=n | ||
|
||
# Format if unformatted. If 'n', resource disk will not be mounted. | ||
ResourceDisk.Format=y | ||
|
||
# File system on the resource disk | ||
# Typically ext3 or ext4. FreeBSD images should use 'ufs2' here. | ||
ResourceDisk.Filesystem=ext4 | ||
|
||
# Mount point for the resource disk | ||
ResourceDisk.MountPoint=/mnt/resource | ||
|
||
# Create and use swapfile on resource disk. | ||
ResourceDisk.EnableSwap=n | ||
|
||
# Size of the swapfile. | ||
ResourceDisk.SwapSizeMB=0 | ||
|
||
# Comma-separated list of mount options. See mount(8) for valid options. | ||
ResourceDisk.MountOptions=None | ||
|
||
# Enable verbose logging (y|n) | ||
Logs.Verbose=n | ||
|
||
# Enable Console logging, default is y | ||
# Logs.Console=y | ||
|
||
# Is FIPS enabled | ||
OS.EnableFIPS=n | ||
|
||
# Root device timeout in seconds. | ||
OS.RootDeviceScsiTimeout=300 | ||
|
||
# If "None", the system default version is used. | ||
OS.OpensslPath=None | ||
|
||
# Set the SSH ClientAliveInterval | ||
# OS.SshClientAliveInterval=180 | ||
|
||
# Set the path to SSH keys and configuration files | ||
OS.SshDir=/etc/ssh | ||
|
||
# If set, agent will use proxy server to access internet | ||
#HttpProxy.Host=None | ||
#HttpProxy.Port=None | ||
|
||
# Detect Scvmm environment, default is n | ||
# DetectScvmmEnv=n | ||
|
||
# | ||
# Lib.Dir=/var/lib/waagent | ||
|
||
# | ||
# DVD.MountPoint=/mnt/cdrom/secure | ||
|
||
# | ||
# Pid.File=/var/run/waagent.pid | ||
|
||
# | ||
# Extension.LogDir=/var/log/azure | ||
|
||
# | ||
# Home.Dir=/home | ||
|
||
# Enable RDMA management and set up, should only be used in HPC images | ||
# OS.EnableRDMA=y | ||
|
||
# Enable or disable goal state processing auto-update, default is enabled | ||
# AutoUpdate.Enabled=y | ||
|
||
# Determine the update family, this should not be changed | ||
# AutoUpdate.GAFamily=Prod | ||
|
||
# Determine if the overprovisioning feature is enabled. If yes, hold extension | ||
# handling until inVMArtifactsProfile.OnHold is false. | ||
# Default is enabled | ||
# EnableOverProvisioning=y | ||
|
||
# Allow fallback to HTTP if HTTPS is unavailable | ||
# Note: Allowing HTTP (vs. HTTPS) may cause security risks | ||
# OS.AllowHTTP=n | ||
|
||
# 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 | ||
|
||
# Enforce control groups limits on the agent and extensions | ||
CGroups.EnforceLimits=n | ||
|
||
# CGroups which are excluded from limits, comma separated | ||
CGroups.Excluded=customscript,runcommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# To disable the Microsoft Azure Agent, set WALINUXAGENT_ENABLED=0 | ||
WALINUXAGENT_ENABLED=1 |
Oops, something went wrong.