Hello Jerry,
In a nut-shell;
It generally takes root equivalent to initiate system services. Hence the su. The startup of the individual service usually handles changing the effective user to some definition defined in the individual setup files of the service providing it was written to allow changes. Look for the start script in the /etc/init.d/ folder it is called spamassassin. (full path= /etc/init.d/spamassassin) But make no changes here! You will see there that the spamassassin daemon is called spamd and is daemonized and run under the user spamd. (the user should of been created upon installation) In the case of Spamassassin, the general configuration files are typically in the /etc/spamassassin folder depending on distro. You should limit your changes to this folder.
As has been stated, all .cf files here are examined.
Specifically, the /etc/spamassassin/local.cf file which will contain setup information on bayes as well as other things. The bayes section should indicate (and allow) setting of the path to the db among other things.
Hope this helps with your main question.
Also if you are running Amavis, then Amavis calls spamassassin I think via spamc (the client to spamd the daemon) and does so using the user amavis. Amavis runs tend to run seperately from the normal spamassassin run structure and can be difficult at best to follow/troubleshoot.
Clear as mud ?
Regards
Bob

On 11/23/19 11:09 AM, Jerry Malcolm wrote:
Meanwhile, back at the ranch.... I still have the one outstanding question from before the 'interruption'....

I know it may be the unpardonable sin according to some to ask a question without having a PhD in Linux.  But after 30+ years in Windows and (yes) OS/2 design and  development for IBM, I have not had much Linux experience. Forgive me.  My assignments at IBM were not in the AIX/*un*x arenas.  I've learned a lot about Linux in the 4 months since moving to my new AWS environment.  But I'm still learning.  I understand about running as 'ec2-user' (the automatic default id that AWS gives you in each ec2 instance).  I also understand 'sudo su' which causes CLI commands to run as root.  But it gets murky when running services.  I have to use 'sudo' to start the spamassassin service.  But does the service itself really run as root?

My one single question is... where does SA expect to find bayes_toks when running the spamd service 'site-wide-only; no per-user stuff'

-- When running from the command line as a normal user, the SA log says it is looking for bayes_* in /user/ec-2user/.spamassassin. Ok, that makes sense.

-- When running from the command after "sudo su" (Horrors!!! how I can ever be forgiven????) the SA log says it is looking for bayes_* in /root/.spamassassin.  Ok, I can understand that as well.

-- But when I start up spamd as a service, the log says it now wants to find bayes_* in  /tmp/spamd-4551-init/.spamassassin. (and the 4-digit number changes each time I restart the service.

I have no problem putting bayes_toks wherever SA wants it to be for running as a service.  But I don't think a random named folder in /tmp is the right place.

What is causing SA to change from a fixed folder to a random /tmp folder for bayes_* when running spamd as a service?  What do I need to do to make it look in a fixed folder? And what folder would that be for 'site-wide-only' use?  (ok... that's 3 questions.... :-)  ).

Thanks so much.

Jerry




Reply via email to