start ubuntu service as user

2

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

user899119

Posted 2012-03-12T02:04:07.927

Reputation: 121

1As what user did you execute this command? Does something like this sudo -u www-data service demostart2 start give the same error? – user689893 – 2012-04-01T09:50:08.207

Answers

0

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.

davidgo

Posted 2012-03-12T02:04:07.927

Reputation: 49 152