15 Jan

Install Microsoft Azure Linux Agent – WAAGENT

Install Microsoft Azure Linux Agent – WAAGENT

To install Microsoft Azure Linux Agent – WAAGENT, it is required to meet two requirements.

  1. SSH access should be working against the Azure virtual machine.
  2. VM should be running.

To install the package in CentOS, please execute the below command,

1
sudo yum install waagent

To install the package in Ubuntu, please execute the below command,

1
sudo apt-get install walinuxagent

If you couldn’t install the linux agent by following the above steps, please proceed with manual installation as given below,

Download Microsoft Azure Linux Agent – WAAGENT

To download Microsoft Azure Linux Agent 2.0.x, please execute,

1
2
3
4
5
wget wget https://github.com/Azure/WALinuxAgent/archive/WALinuxAgent-2.0.<version>.zip

unzip WALinuxAgent-2.0.<version>.zip

cd WALinuxAgent-[version]

Example

1
2
3
4
5
wget https://github.com/Azure/WALinuxAgent/archive/WALinuxAgent-2.0.16.zip

unzip WALinuxAgent-2.0.16.zip

cd WALinuxAgent-2.0.16

Refer : https://github.com/Azure/WALinuxAgent/releases

To download the latest version,

1
2
3
4
5
wget wget https://github.com/Azure/WALinuxAgent/archive/v2.x.x.zip

unzip v2.x.x.zip

cd v2.x.x

Example

1
2
3
4
5
wget https://github.com/Azure/WALinuxAgent/archive/v2.2.2.zip

unzip v2.2.2.zip

cd v2.2.2

Refer : https://github.com/Azure/WALinuxAgent/releases

Install Microsoft Azure Linux Agent – WAAGENT

The python package setuptools is a prequisite to install the waalinux agent. To install the setuptools in your virtual machine, please execute,

1
pip install -U pip setuptools

If pip is not installed in your machine, then download it and install it by following the below steps,

1
2
3
wget https://bootstrap.pypa.io/get-pip.py

python get-pip.py

Once the python package setuptools is installed, proceed with Azure Linux Agent installation,

1
sudo python setup.py install

Restart Azure Linux Agent – waagent

For Ubuntu based servers, please execute the below command to restart the agent,

1
sudo service walinuxagent restart

For most of other linux distros, the below command will work,

1
sudo service waagent restart

If not working, please try the below command,

1
sudo systemctl restart waagent

Check Azure Linux Agent Version

To check the Azure linux agent – waagent version, please execute the below command,

1
waagent -version

To know more about Azure linux agent installation, please refer the link,

 https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-update-agent#install-the-azure-linux-agent

27 Aug

/bin/sh: bad interpreter: Permission denied

The mentioned error occurrs when the /tmp is mounted with noexec permission. First step to ensure that the tmp is mounted with noexec permission is to check the /etc/fstab.

cat  /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
/dev/VolGroup00/LogVol04 /home                   ext3    defaults        1 2
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01 /tmp                    ext3 loop,noexec,nosuid,rw    defaults        1 2
/dev/VolGroup00/LogVol02 /usr                    ext3    defaults        1 2
/dev/VolGroup00/LogVol05 /var                    ext3    defaults        1 2
/dev/VolGroup00/LogVol03 swap                    swap    defaults        0 0
#/dev/tmppart           /tmp                     ext3 loop,noexec,nosuid,rw 0 0

If it is mounted with noexec permission, then our requirement to mount the same with execute permission.

Edit the /etc/fstab file. Remove the entry noexec from it.

Now the modified entry should look like,

/dev/VolGroup00/LogVol01 /tmp                    ext3 loop,nosuid,rw    defaults        1 2

Now we need to remount the partition

or

This will mount the /tmp with exec permission.

Once the script execution is over, remount the /tmp back to noexec.

10 Aug

Kernel Upgrade on CentOS

Kernel Upgrade on CentOS

1. Find your yum.conf file:
# find yum.conf

2. Verify your yum.conf file:
# nano /etc/yum.conf
“Exclude” line should be something like this:
exclude=courier* apache* mod_ssl* httpd* perl mysql* php* spamassassin* exim*
Note:kernel* should not be excluded on “exclude” line

3. Upgrade kernel using:
– If you have 1 proc:
# yum upgrade kernel
– For dual proc use:
# yum upgrade kernel-smp

When upgrade is complete,
Set “default” to 0 in /etc/grub.conf
Rebbot your server:

Rebbot your server:
# shutdown -r now