Azure / custom-script-extension-linux

Azure Custom Script Virtual Machine Extension :new:
Apache License 2.0
108 stars 33 forks source link

Fails to install software that need sudo even though azure runs it as root #126

Closed vairamsvsjdo closed 6 years ago

vairamsvsjdo commented 6 years ago

ENV Ubuntu 17.10 Canonical Template available in azure.

Fails to install software that need sudo even though azure runs it as root

example script for script.sh

time  apt-get -y update
time  apt install -y python3-pip 

The above script fails to run unless other sudo sh script.sh is the command in custom extension to execute

boumenot commented 6 years ago

You need to provide logs for progress to make on this issue. Please see the issue template (displayed when you opened the bug) for the list of logs to include.

johanburati commented 6 years ago

I was not able to replicate on Canonical:UbuntuServer:17.10:latest image , both commands worked fine, python3-pip package and dependencies got installed.

/var/lib/waagent/custom-script/download/0/script.sh

#/bin/sh
time  apt-get -y update
time  apt install -y python3-pip 

/var/lib/waagent/Microsoft.Azure.Extensions.customScript-2.0.6/status/0.status:

[
        {
                "version": 1,
                "timestampUTC": "2018-03-10T23:00:00Z",
                "status": {
                        "operation": "Enable",
                        "status": "success",
                        "formattedMessage": {
                                "lang": "en",
                                "message": "Enable succeeded: \n[stdout]\ning to unpack .../45-python3-dev_3.6.3-0ubuntu2_amd64.deb ...\r\nUnpacking python3-dev (3.6.3-0ubuntu2) ...\r\nSelecting previously unselected package python3-secretstorage.\r\nPreparing to unpack .../46-python3-secretstorage_2.3.1-2_all.deb ...\r\nUnpacking python3-secretstorage (2.3.1-2) ...\r\nSelecting previously unselected package python3-keyring.\r\nPreparing to unpack .../47-python3-keyring_10.4.0-1_all.deb ...\r\nUnpacking python3-keyring (10.4.0-1) ...\r\nSelecting previously unselected package python3-keyrings.alt.\r\nPreparing to unpack .../48-python3-keyrings.alt_2.2-2_all.deb ...\r\nUnpacking python3-keyrings.alt (2.2-2) ...\r\nSelecting previously unselected package python3-pip.\r\nPreparing to unpack .../49-python3-pip_9.0.1-2_all.deb ...\r\nUnpacking python3-pip (9.0.1-2) ...\r\nSelecting previously unselected package python3-setuptools.\r\nPreparing to unpack .../50-python3-setuptools_36.2.7-2_all.deb ...\r\nUnpacking python3-setuptools (36.2.7-2) ...\r\nSelecting previously unselected package python3-wheel.\r\nPreparing to unpack .../51-python3-wheel_0.29.0-2_all.deb ...\r\nUnpacking python3-wheel (0.29.0-2) ...\r\nSelecting previously unselected package python3-xdg.\r\nPreparing to unpack .../52-python3-xdg_0.25-4_all.deb ...\r\nUnpacking python3-xdg (0.25-4) ...\r\nSetting up libquadmath0:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libgomp1:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libatomic1:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up python-pip-whl (9.0.1-2) ...\r\nSetting up libcc1-0:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up make (4.1-9.1) ...\r\nSetting up libasan4:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libcilkrts5:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up python3-crypto (2.6.1-7build2) ...\r\nSetting up libubsan0:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libtsan0:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up python3-xdg (0.25-4) ...\r\nSetting up python3-keyrings.alt (2.2-2) ...\r\nSetting up linux-libc-dev:amd64 (4.13.0-36.40) ...\r\nSetting up libdpkg-perl (1.18.24ubuntu1) ...\r\nSetting up python3-wheel (0.29.0-2) ...\r\nSetting up liblsan0:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up binutils-common:amd64 (2.29.1-4ubuntu1) ...\r\nSetting up libfile-fcntllock-perl (0.22-3build2) ...\r\nSetting up libmpx2:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libisl15:amd64 (0.18-1) ...\r\nProcessing triggers for libc-bin (2.26-0ubuntu2.1) ...\r\nSetting up libfakeroot:amd64 (1.21-1ubuntu2) ...\r\nSetting up python3-pip (9.0.1-2) ...\r\nSetting up libalgorithm-diff-perl (1.19.03-1) ...\r\nProcessing triggers for man-db (2.7.6.1-2) ...\r\nSetting up libmpc3:amd64 (1.0.3-2) ...\r\nSetting up libc-dev-bin (2.26-0ubuntu2.1) ...\r\nSetting up python3-setuptools (36.2.7-2) ...\r\nSetting up python3-secretstorage (2.3.1-2) ...\r\nSetting up manpages-dev (4.13-3) ...\r\nSetting up libc6-dev:amd64 (2.26-0ubuntu2.1) ...\r\nSetting up libitm1:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up python3-keyring (10.4.0-1) ...\r\nSetting up libbinutils:amd64 (2.29.1-4ubuntu1) ...\r\nSetting up fakeroot (1.21-1ubuntu2) ...\r\nupdate-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode\r\nSetting up libgcc-7-dev:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up cpp-7 (7.2.0-8ubuntu3.2) ...\r\nSetting up libstdc++-7-dev:amd64 (7.2.0-8ubuntu3.2) ...\r\nSetting up libalgorithm-merge-perl (0.08-3) ...\r\nSetting up libalgorithm-diff-xs-perl (0.04-4build3) ...\r\nSetting up libexpat1-dev:amd64 (2.2.3-1) ...\r\nSetting up binutils-x86-64-linux-gnu (2.29.1-4ubuntu1) ...\r\nSetting up cpp (4:7.2.0-1ubuntu1) ...\r\nSetting up libpython3.6-dev:amd64 (3.6.3-1ubuntu1) ...\r\nSetting up binutils (2.29.1-4ubuntu1) ...\r\nSetting up python3.6-dev (3.6.3-1ubuntu1) ...\r\nSetting up libpython3-dev:amd64 (3.6.3-0ubuntu2) ...\r\nSetting up gcc-7 (7.2.0-8ubuntu3.2) ...\r\nSetting up g++-7 (7.2.0-8ubuntu3.2) ...\r\nSetting up python3-dev (3.6.3-0ubuntu2) ...\r\nSetting up gcc (4:7.2.0-1ubuntu1) ...\r\nSetting up dpkg-dev (1.18.24ubuntu1) ...\r\nSetting up g++ (4:7.2.0-1ubuntu1) ...\r\nupdate-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode\r\nSetting up build-essential (12.4ubuntu1) ...\r\nProcessing triggers for libc-bin (2.26-0ubuntu2.1) ...\r\n\n[stderr]\n4.37user 0.52system 0:06.77elapsed 72%CPU (0avgtext+0avgdata 108424maxresident)k\n6816inputs+396456outputs (26major+103263minor)pagefaults 0swaps\n\nWARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n\ndebconf: unable to initialize frontend: Dialog\ndebconf: (TERM is not set, so the dialog frontend is not usable.)\ndebconf: falling back to frontend: Readline\ndebconf: unable to initialize frontend: Readline\ndebconf: (This frontend requires a controlling tty.)\ndebconf: falling back to frontend: Teletype\ndpkg-preconfigure: unable to re-open stdin: \n10.35user 2.83system 1:06.90elapsed 19%CPU (0avgtext+0avgdata 108740maxresident)k\n51352inputs+554264outputs (216major+771278minor)pagefaults 0swaps\n"
                        }
                }
        }
]
boumenot commented 6 years ago

Thank you for trying to reproduce. I am closing this issue for now. Please re-open if you can provide the necessary logs.