Hi Wenyi,

There might be a reason why the code in monitor_db_babysitter

if os.getuid() == 0:
   logging.critical("Running as root, aborting!")
   sys.exit(1)

was there in the first place.  So I'm not sure getting rid of that check is
a good idea.

I think the Permission Denied error you were getting is coming from sshd on
your test machines not allowing login as root, which is the default sshd
behavior (for security reasons).  So you should set up the sshd on all your
test machines to allow login as root.  See the sshd_config man page.

-Jongki


On Wed, Nov 16, 2011 at 1:20 AM, Wenyi Gao <[email protected]> wrote:

>
>  Currently, for ubuntu system, autotest.init will be used and start
> monitor_db_babysitter owned by user autotest,
> so when we use web front-end to create job, the autoserv also owned by
> user autotest runs ssh commands with default
> ssh user "root", known as "-l root", which causes the following permission
> problem on ubuntu.
>
>  * Command:
>      /usr/bin/ssh -a -x   -o StrictHostKeyChecking=no -o
>      UserKnownHostsFile=/tmp/tmpvUr_sL -o BatchMode=yes -o
> ConnectTimeout=60 -o
>      ServerAliveInterval=300 -l root -p 22 172.16.3.130 " true"
>  Exit status: 255
>  Duration: 0.342299938202
>
>  stderr:
>  Permission denied (publickey,password).
>
>
>  So the patch changes user from autotest to root when starting
> monitor_de_babysitter to keep consitent with ssh
> user "-l root".
>
>
>
> Signed-off-by: Wenyi Gao <[email protected]>
> ---
>  scheduler/monitor_db_babysitter |    3 ---
>  utils/autotest.init             |    2 +-
>  2 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/scheduler/monitor_db_babysitter
> b/scheduler/monitor_db_babysitter
> index 4625781..c8f67eb 100755
> --- a/scheduler/monitor_db_babysitter
> +++ b/scheduler/monitor_db_babysitter
> @@ -139,9 +139,6 @@ class MonitorProc(SiteMonitorProc):
>         log.close()
>
>
> -if os.getuid() == 0:
> -    logging.critical("Running as root, aborting!")
> -    sys.exit(1)
>
>  if utils.program_is_alive(monitor_db.BABYSITTER_PID_FILE_PREFIX):
>     logging.critical("Monitor_db_babysitter already running, aborting!")
> diff --git a/utils/autotest.init b/utils/autotest.init
> index 78ed9a8..30b6a51 100755
> --- a/utils/autotest.init
> +++ b/utils/autotest.init
> @@ -6,7 +6,7 @@
>  # update-rc.d autotest start 95 2 3 4 5 . stop 90 0 1 6 .
>
>  BASE_DIR=/usr/local/autotest
> -BECOME_USER=autotest
> +BECOME_USER=root
>
>  if (test -r /lib/lsb/init-functions)
>  then
> --
> 1.7.5.4
>
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to