monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stop a service as a non root user


From: Nestor Urquiza
Subject: Re: stop a service as a non root user
Date: Tue, 2 Jul 2013 10:13:31 -0400

Thanks Martin. That did the trick. Thank you all guys!
- Nestor


On Tue, Jul 2, 2013 at 7:20 AM, Martin Pala <address@hidden> wrote:
You can set specific command for specific user in sudo with NOPASSWD option => run it without typing password, just will have to prefix it with sudo and use the same command (with path, etc.)

        myuser ALL=NOPASSWD: /usr/bin/monit stop tomcat

To use it, ssh as myuser and type:

        sudo /usr/bin/monit stop tomcat

... no password needed


Regards,
Martin



On Jul 2, 2013, at 1:02 PM, Nestor Urquiza <address@hidden> wrote:

> Hi Martin,
>
> That still does not address the user story. If I need to use sudo I must provide a password so I won't be able to 'manage the service the way I would do without monit' which is using the non root user without password.
>
> Let me give you a test case so you better understand:
>
> 1. Without monit looking after tomcat in a remote server: Use ssh to stop tomcat remotely. This is easy having the public key stored in remote server. No password will be asked. You can control 10 servers with just one command.
> 2. With monit: Use ssh to stop tomcat. Monit will restart it automatically. If sudo is used a password will need to be provided.
>
> It would look like a feature is needed: to instruct monit not to monitor if the command is the stop command is used manually. There is such feature to stop sending alert. Makes sense?
>
> Best regards,
> - Nestor
>
>
> - Nestor
>
> On Jul 2, 2013, at 4:01 AM, Martin Pala <address@hidden> wrote:
>
>> Hi,
>>
>> you can use sudo to allow that specific CLI command to non-root user.
>>
>> Regards,
>> Martin
>>
>>
>> On Jul 2, 2013, at 12:46 AM, Nestor Urquiza <address@hidden> wrote:
>>
>>> Hi folks,
>>>
>>> We run monit as root which is specially important for Apache service.
>>>
>>> Monit controls tomcat servers which run under a different user.
>>>
>>> As a non root user I want to to be able to run 'monit tomcat stop' so that I can manage the service the way I would do without monit.
>>>
>>> We can issue "service tomcat stop" but of course monit restarts it again.
>>>
>>> Thanks!
>>>
>>> - Nestor
>>>
>>>
>>>
>>>
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

[Prev in Thread] Current Thread [Next in Thread]