-
Notifications
You must be signed in to change notification settings - Fork 2
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
[vm] disable unattended upgrades on debian/ubuntu on EC2 #1207
[vm] disable unattended upgrades on debian/ubuntu on EC2 #1207
Conversation
vmArgs.userData = vmArgs.userData + sshUserData | ||
} else if vmArgs.osInfo.Flavor == os.Ubuntu || vmArgs.osInfo.Flavor == os.Debian { | ||
vmArgs.userData = vmArgs.userData + os.DebianDisableUnattendedUpgradesScriptContent |
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.
Does it really work if vmArgs.userData
already contains something?
I feel like we could end with a script that looks like:
#!/bin/bash
echo "First userdata"
#!/bin/bash
apt-get -y remove unattended-upgrades
And I am not sure it would work
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.
TIL #!
is called shebang. A script starting with shebang that is used as if it was an executable will use the interpreter defined after the shebang to interpret commands.
Following shebang are discarded as comments.
Tried running the following on zsh
#!/bin/bash
echo "First userdata"
#!/bin/bash
echo "something else"
And I get
First userdata
something else
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 see! As long as we provide user data with same language it should work. If we start to pass bash script and python script it will break but that is unlikely we do that
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 could also enforce bash scripting and automatically set the shebang to bash.
/merge |
🚂 MergeQueue: pull request added to the queue The median merge time in Use |
What does this PR do?
Disable apt unattended upgrades at startup through userdata
Which scenarios this will impact?
aws debian and ubuntu
Motivation
ADXT-686
Additional Notes