systemctl start service as non-root

Edward Quick edwardquick at hotmail.com
Sun Jun 14 09:57:12 UTC 2015


Hi Fedora Users,

Does anyone know if it's possible to start a service using systemctl without root privileges?

For example, I've set up a tomcat instance, which starts up fine when issuing systemctl start with root:

[root at fedora22 tomcats]# systemctl start tomcat at instance1
[root at fedora22 tomcats]# ps -ef | grep java
tomcat   11056     1 46 09:44 ?        00:00:01 /usr/lib/jvm/jre/bin/java -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/lib/java/commons-daemon.jar -Dcatalina.base=/var/lib/tomcats/instance1 -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/var/lib/tomcats/instance1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start

But when trying to run the command as the tomcat user which owns the instance there's a message below I'm not sure about:

[root at fedora22 system]# sudo -u tomcat bash
bash-4.3$ id
uid=91(tomcat) gid=91(tomcat) groups=91(tomcat) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

bash-4.3$ systemctl start tomcat at instance1
Failed to start tomcat at instance1.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
bash-4.3$ 


Thanks for any help.
Edward
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150614/550ce229/attachment.html>


More information about the users mailing list