Submitted by websmurf on Fri, 06/10/2016 - 10:15
I'm working on an install procedure to install virtualmin through ansible, but running into a weird issue in my install routine.
The install script fails with the following error:
The Virtualmin install script must be run as root
I've narrowed it down to this part in the install.sh file:
# Only root can run this
id | grep "uid=0(" >/dev/null
if [ "$?" != "0" ]; then
When I execute the id command manually, this is my output:
root@web1:~# id
UID=0(root) GID=0(root) groepen=0(root)
It seems that the check fails due to the response being uppercase in stead of lowercase. When I change this line:
id | grep "uid=0(" >/dev/null
to
id | grep -i "uid=0(" >/dev/null
the install proceeds as expected
Status:
Closed (fixed)
Comments
Submitted by andreychek on Fri, 06/10/2016 - 10:33 Comment #1
Howdy -- well that's an odd problem, we've never seen that before after a bunch of testing on Debian.
I'm wondering if Debian changed something recently, or if maybe there's a different coreutils package installed?
What's the output of these two commands:
Submitted by websmurf on Fri, 06/10/2016 - 10:37 Comment #2
Narrowed it down a bit more, root cause is that ansible connected using the dutch locale and settings. Switching it to en_US solves the capital problems :-)
Submitted by JamieCameron on Sat, 06/11/2016 - 00:48 Comment #3
What does the
id -a
command output when the language is set to Dutch?Submitted by peter.vanpoucke on Sat, 09/02/2017 - 09:41 Comment #4
Executing LANG=C before executing the script does the trick for me.
Submitted by JamieCameron on Sat, 09/02/2017 - 11:39 Comment #5
I've seen this before - the easy solution is to change the grep command as suggested by the OP.
Submitted by Goeny on Thu, 11/02/2017 - 05:10 Comment #6
Same problem occured here on CentOS 7. Also dutch.
Fixed with the small fix in the install file
Fixed. Thanks for the heads up. It never crossed my mind that the language would effect the capitalization of that output of that command!
As an aside, using LANG=C will prevent Unicode from working so the progress bars would be homely, but en_US would do the trick. Though I guess that wouldn't matter in an automated install, since nobody will be looking at the output.
Submitted by IssueBot on Thu, 11/16/2017 - 18:42 Comment #8
Automatically closed - issue fixed for 2 weeks with no activity.