我有一个uwsgi的新贵,我希望非sudo用户运行uwsgi。在ubuntu服务器14.04中,我有两个用户,user1
(具有sudo访问权限)和user2
(没有sudo访问权限)。
upstart脚本我有/etc/init/uwsgi.conf
:
description "uWSGI instance"
start on runlevel [2345]
stop on runlevel [!2345]
exec uwsgi --emperor /etc/uwsgi/vassals --uid user1 --gid user2 --post-buffering 1 --env DJANGO_SETTINGS_MODULE=in_accounts.settings.production
我可以将此uwsgi.conf作为sudo restart uwsgi
运行。但我想将user2
作为restart uwsgi
运行同一命令。如果我跑,我得到以下错误:
restart: Rejected send message, 1 matched rules; type="method_call", sender=":1.140" (uid=1001 pid=41623 comm="restart uwsgi ") interface="com.ubuntu.Upstart0_6.Job" member="Restart" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")