Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a service in ubuntu server, whitch I need to start as a user. Main reason I need to do that is that I need to call it from www(php script).

lets say I got this script called demostart2, and when I start it as user I got this error:

service demostart2 start

start: Rejected send message, 1 matched rules; type="method_call", sender=":1.12" (uid=1000 pid=15085 comm="start demostart2 ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

Is it possible to start service as user? I tried chown that file, but notthing happend. Thank you

share|improve this question

migrated from Apr 26 '12 at 12:33

This question came from our site for professional and enthusiast programmers.

As what user did you execute this command? Does something like this sudo -u www-data service demostart2 start give the same error? – user689893 Apr 1 '12 at 9:50

It looks like this server is using an enhanced security model (possibly SELinux, but more likely AppArmour). You would need to update the security profile or disable the Mandatory Access Control.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .