大网数据广告活动
服务器运维问答

allow a user to run specific monit action

· 52CE 我爱测

I have installed monit for many applications with the root user. One of the applications is started with a non-root user account. Unfortunately, when I update my app, I also need to restart it. My update process uses the non-root…

问题原文

原帖链接 · Raphael · CC BY-SA 3.0

I have installed monit for many applications with the root user. One of the applications is started with a non-root user account.

Unfortunately, when I update my app, I also need to restart it. My update process uses the non-root user (I use capistrano to udpate my app)

Since Monit is checking this app and the update process is done with the non-root user. In order to restart the app, the non-root user kills the app and monit restarts it.

I would like to allow the non-root user to be allowed to only restart this specific app. This user shouldn't be aloud to run other monit related actions.

Is there a way to allow a user run a specific monit action, even if he is not the owner of the monitrc ?

已采纳解答

原帖链接 · ewwhite · CC BY-SA 3.0

Add an entry to /etc/sudoers...

%non-root-group ALL=NOPASSWD:/usr/bin/monit 

or

non-root-user ALL=NOPASSWD:/usr/bin/monit 

or

non-root-user ALL=NOPASSWD:/usr/bin/monit reload # to give a specific Monit command.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-01-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。