#123 closed defect (fixed)
Wrong assumption that sudo is available on all Linux distribution by default
Reported by: | sylvestre | Owned by: | pferreir |
---|---|---|---|
Priority: | low | Milestone: | v0.97.0 |
Component: | Installation | Version: | 0.97.0 |
Keywords: | Cc: |
Description
Using indico_initial_setup, I get an error about sudo missing.
For example, under Debian, sudo is not installed by default. :
uid/gid not provided. Trying to guess them... found www-data(33) www-data(33)
We need to 'sudo' in order to set the permissions of some directories...
sh: sudo: command not found
sh: sudo: command not found
sh: sudo: command not found
sh: sudo: command not found
sh: sudo: command not found
Change History (6)
comment:1 Changed 6 years ago by pferreir
- Milestone set to v0.97
- Owner set to pferreir
- Status changed from new to assigned
- Version set to 0.97
comment:2 Changed 6 years ago by pferreir
- Resolution set to fixed
- Status changed from assigned to closed
comment:3 Changed 6 years ago by sylvestre
In my mind, adding sudo as a requirement is not the best way to do it... Especially on many systems where you are already root and not using sudo.
Instead, you should do something like:
--- installBase.py.orig 2010-01-14 19:21:21.000000000 +0100
+++ installBase.py 2010-01-14 19:24:24.000000000 +0100
@@ -301,7 +301,7 @@
dirs2check.append(dbInstalledBySetupPy)
for dir in dirs2check:
- print commands.getoutput("sudo chown -R %s:%s %s" % (accessuser, accessgroup, dir))
+ print commands.getoutput("if test $(which sudo); then CMD=\"sudo\"; fi; $CMD chown -R %s:%s %s" % (accessuser, accessgroup, dir))
def _existingConfiguredEgg():
I reopen to make sure you see it but I won't mind if you close it again.
comment:4 Changed 6 years ago by pferreir
Yes, you're right. People may be executing the script as root, already.
Thanks for the patch, I'll integrate it.
comment:5 Changed 6 years ago by jose.pedro.ferreira@…
commit 9def33c9626df1e9c504d8e9e27844d6603b7695
Author: Pedro Ferreira <jose.pedro.ferreira@…>
Date: Fri Jan 15 11:17:42 2010 +0100
[FIXED] sudo verification
- Thanks to Sylvestre Ledru
- Fixes #123
OK, we'll add sudo to the requirement list:
Admin/Installation