Find the user under which a Ubuntu service runs?
15,807
You can use ps -ef
to known who is running cassandra.
All services are located in /etc/init.d/
.
If you are not running cassandra as a service, you can search where is the program with the whereis
command:
$ whereis cassandra
Related videos on Youtube
Author by
Milen Kovachev
Updated on September 18, 2022Comments
-
Milen Kovachev almost 2 years
I have a Cassandra service on my Ubuntu but I cannot figure under what user this service runs. I know how to find the owner and the permissions of files and directories. But how can I do this for a Ubuntu service. Assuming the service is just an executable file, how can I find the location of a particular service?
-
Jacek over 8 yearsIf the application is running - "ps" might help you, for example. Search for your process on the list and check what user owns the process.
-
-
Milen Kovachev over 8 yearsBut it is not running, I cannot start it due to permissions problems.
-
Milen Kovachev over 8 yearsI see this: install -d -ocassandra -gcassandra -m755
dirname $PIDFILE
. And also: start-stop-daemon -S -c cassandra -a /usr/sbin/cassandra -q -p "$PIDFILE" -t >/dev/null || return 1. It looks like it is running as a cassandra user? -
user1946705 over 8 yearsYou are right !