LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-11-2015, 10:32 AM   #1
Dudki01
LQ Newbie
 
Registered: Dec 2015
Posts: 2

Rep: Reputation: Disabled
Who is real daemon owner?


Hi!
I'm playing with postfix theme now and this situation makes me curious.
I've installed amavisd daemon and want it to put it's log to file in /var/log/amavis.log. So, i put the proper line in avavisd config.
Executable of amavisd seems to be located in /usr/sbin/, at least "ps -aux" told me so.
"ls- la /usr/sbin" told me that owner of this file is root. Ok.
Owner of /var/log is also root.
But when i made user amavis an owner and writer of file /var/log/amavis.log amavisd at least started and "ps -aux" considers it started on behalf of user amavis, not root.
So, it there a way to know, which user is on duty to start /usr/sbin/amavisd or any other daemon while daemon is not started yet?
 
Old 12-11-2015, 08:22 PM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 3,430

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
The ownership of an executable file has, in principle, nothing to do with the user under which a process runs. The exception to this rule is the so-called setuid permission.

The user you see in the ps -aux output can be defined by the daemon's startup code or configuration. It can also be hardcoded in the daemon's program. Therefore, you would have to analyze both the startup code and the program's source code to find the identity under which it will run.

If the daemon sets its user to a hardcoded name, you could also use a tool like strace to see the system calls it's issuing at startup.

All that is UNIX semantics that date from the beginning of the world (i.e., Jan 1 1970).
 
Old 12-12-2015, 07:37 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Quote:
But when i made user amavis an owner and writer of file /var/log/amavis.log amavisd at least started and "ps -aux" considers it started on behalf of user amavis, not root.
"root" owns most of universal and system files. But the users can run some of these and since the user runs or uses the root-owned files, necessarily the process launched and daemonized belongs to the user initiating it.
There are system users residing in the system without need of logging in. To mention some: "lp" and "clamav", in your case you have just created another one by/with "amavis".

Quote:
So, it there a way to know, which user is on duty to start /usr/sbin/amavisd or any other daemon while daemon is not started yet?
Generally the one who is in front of the panel and above the keyboard is the user "on duty" over the whole system.

However, although amavis user (like clamav) is the one called up by virtue of software configuration (of the avavisd), still it is you who is the effective user, and therefore the one on duty, since you have control and command over the binary and the system as whole.

Thus, there are logging-in users, there are system users, and there are software-configured users (which also may be called system users); the latter usually own and become their group-names.

Hope this helps. Good luck and enjoy.

m.m.

Last edited by malekmustaq; 12-12-2015 at 07:41 AM.
 
Old 12-15-2015, 09:31 AM   #4
Dudki01
LQ Newbie
 
Registered: Dec 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you, guys, for puting everything in places.
Several hours i'd been staring at "start as amavis user" instructions in config but actually saw it only after reading your answers

Last edited by Dudki01; 12-15-2015 at 10:15 AM.
 
Old 01-10-2016, 05:04 AM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Quote:
Originally Posted by Dudki01 View Post
Thank you, guys, for puting everything in places.
Several hours i'd been staring at "start as amavis user" instructions in config but actually saw it only after reading your answers
I am very happy that my post was helpful.
Good luck and enjoy.

m.m.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
change of owner and group owner of a file belongs to diff user ? somorg Linux - Newbie 3 06-14-2015 09:11 AM
change of owner and group owner of a file belongs to diff user ? somorg Linux - Security 2 06-13-2015 02:33 AM
change of owner and group owner of a file belongs to diff user ? somorg Linux - General 2 06-12-2015 10:40 AM
Starting a daemon in an init.d bootup script without root being the owner BobTheSlob Linux - General 1 09-19-2007 11:19 AM
how to see the daemon owner? noir911 *BSD 2 08-24-2004 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration