You are not logged in.
Pages: 1
I'm working on installing a removable hard drive system to use with my bacula backup system. I need to write an index to the drives, and to do that I'm supposed to use a command that includes the user that a bacula sub-program "runs as".
This is a question that I run into from time to time, and although I occasionally think I'm making progress in learning linux, I can never figure out what that means or how to determine the answer.
I do know that bacula has to start as root, but then it can drop down to another user. If I try to run the command with the "drop down" user, it doesn't work, have to run it as root, which leads to other problems not relevant here.
The bottom line is, how do you find out who a program "runs as"?
Last edited by timm (2009-08-28 17:29:57)
Offline
If you simply want to know what user a specific program is running under, use you can 'ps aux'. For instance, I'm running openbox right now:
ps aux | grep openbox
skottish 3422 0.0 0.0 88544 7572 tty1 S 14:04 0:00 /usr/bin/openbox
skottish 3742 0.0 0.0 8012 944 pts/0 R+ 14:44 0:00 grep --color=always openbox
It's showing grep also because the above command is using grep. ps aux without arguments will show you all processes running, including programs, and the user that it's running under.
This will print only the first occurrence of the user name:
ps aux | grep openbox | awk '{print $1}' | awk 'NR < 2'
Of course now that this is posted, you should get even better answers from people that know more than I do.
Offline
Pages: 1