You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2008/03/21 11:23:57 UTC

Re: Logging

Skip writes:
> My email is hosted on a shared hosting site where I don't have much 
> access to the good stuff, like syslog and /var/*anything*.  For that 
> reason, I believe spamc/spamd is out for me.  They do in fact have spamd 
> running.  Here's the ps -aux output
> root      9532  0.0  0.6 69628 24544 ?       Ss   Mar10   7:17 
> /usr/bin/spamd -d --allowed-ips=127.0.0.1 --pidfile=/var/run/spamd.pid 
> --max-children=5
> 
> So, I think if I am to have have any hope of getting a decent log out of 
> SA, then I will need to use the full spamassassin commandline from 
> procmail. No problem, but as I read in the faq, 
> (http://wiki.apache.org/spamassassin/SeparateLogFile) the instructions 
> there on how to get a different log file involve tinkering with things 
> that I don't have access to.  Are there any other options for me?  
> Commandline piping?  Creative file links?  I really need to figure out a 
> way to get into my logs so I can see what my installation is doing and 
> not doing.

hi --

You can install SpamAssassin into your home dir and run spamd from there;
then use the "spamd -s file" switch to log to a file.

However, many shared hosting setups will also limit CPU time, which
typically means you can't run daemons.

Unfortunately the "spamassassin" script isn't much use for logging :(

--j.

Re: Logging

Posted by James Wilkinson <sa...@aprilcottage.co.uk>.
Skip wrote:
> I am on a linux, shared hosting site (Bluehost.com).  I don't 
> know how I can get it into the startup script for that box, and I only have 
> access to my own home directory.  That may be a showstopper right there.  
> I'll have no way of knowing when they reboot the box.

Earlier, Matt Kettler wrote:
> Running from cron is only for things you want to run 
> at regular intervals. It is not a valid way for starting daemons (ie: 
> something you want to run once and leave running)

Actually, something like this (from man 5 crontab on Fedora 8) might be
relevant:

       These special  time  specification  "nicknames"  are  supported, which
       replace the 5 initial time and date fields, and are prefixed by the ’@’
       character:
       @reboot    :    Run once, at startup.

Skip may have permissions to edit his own crontab (with the crontab
command) and set a daemon going at reboot time.

There may be CPU time quota constraints, of course.

Hope this helps,

James.

-- 
E-mail:     james@ |    "Just for once, I wish we would encounter an alien
aprilcottage.co.uk | menace that wasn't immune to bullets..."
                   |     -- The Brigadier, 'Doctor Who'

Re: Logging

Posted by Martin Gregorie <ma...@gregorie.org>.
> > Generally it gets installed in /etc/init.d or /etc/rc.d/init.d, and 
> > then symlinked to various /etc/rc<runlevel number>.d directories to 
> > cause it to be called at various runlevels. If your system has 
> > redhat-ish and chkconfig, it can automate this part for you, as the 
> > redhat init script that comes with spamd has chkconfig tags in it.
> >
> 
> By the way, I believe the systems are redhat-ish.  chkconfig is installed.
> 
This may not be of great use to you, but here's the story. I'm running
RH Fedora 8.

If SA was installed from a RedHat rpm there will already be a
"spamassassin" script in /etc/rc.d/init.d and you should be able to tell
if spamd is running from the output of "ps -ef | grep spamd".

If it is running, it may be worthwhile adding spamc to your mail setup:
it should automatically use the running version of spamd which, of
course, will be restarted whenever the box is rebooted. It goes without
saying that you should talk to the system's owners before doing that,
specially if your mail volume is significant.


Martin



Re: Logging

Posted by Skip <sk...@pelorus.org>.

Matt Kettler wrote:
> Skip wrote:
>> One more dumb question (and this really is more of a linux question 
>> than a SA question), but if I start spamd -d from a console, and then 
>> quit that console, won't the daemon quit too?
> No, that's what makes it a daemon.. it detaches from the console 
> completely, thus remains active even if the shell that spawned it 
> terminates.
I thought that was the case.  Thanks.

>> I think the only other option is to "run it from cron" to get it out 
>> of a console, but that's a real kludge and I'd rather not do that.
> Erm.. definitely not. running from cron is only for things you want to 
> run at regular intervals. It is not a valid way for starting daemons 
> (ie: something you want to run once and leave running)
I was actually half-way thinking of doing something creative like 
running it from cron just once and then getting rid of the cron job.  
But since you confirmed my initial thoughts, I won't have to follow 
though on this route.

> You might also want to look at setting up an init script that 
> daemonizes spamd automatically at bootup. There's some sample init 
> scripts in with the spamd directory. How exactly you install it varies 
> with what OS you're using.
Good point.  I am on a linux, shared hosting site (Bluehost.com).  I 
don't know how I can get it into the startup script for that box, and I 
only have access to my own home directory.  That may be a showstopper 
right there.  I'll have no way of knowing when they reboot the box.

> Generally it gets installed in /etc/init.d or /etc/rc.d/init.d, and 
> then symlinked to various /etc/rc<runlevel number>.d directories to 
> cause it to be called at various runlevels. If your system has 
> redhat-ish and chkconfig, it can automate this part for you, as the 
> redhat init script that comes with spamd has chkconfig tags in it.
>

By the way, I believe the systems are redhat-ish.  chkconfig is installed.

Skip

Re: Logging

Posted by Matt Kettler <mk...@verizon.net>.
Skip wrote:
> One more dumb question (and this really is more of a linux question 
> than a SA question), but if I start spamd -d from a console, and then 
> quit that console, won't the daemon quit too?
No, that's what makes it a daemon.. it detaches from the console 
completely, thus remains active even if the shell that spawned it 
terminates.
> I think the only other option is to "run it from cron" to get it out 
> of a console, but that's a real kludge and I'd rather not do that.
Erm.. definitely not. running from cron is only for things you want to 
run at regular intervals. It is not a valid way for starting daemons 
(ie: something you want to run once and leave running)

You might also want to look at setting up an init script that daemonizes 
spamd automatically at bootup. There's some sample init scripts in with 
the spamd directory. How exactly you install it varies with what OS 
you're using.

Generally it gets installed in /etc/init.d or /etc/rc.d/init.d, and then 
symlinked to various /etc/rc<runlevel number>.d directories to cause it 
to be called at various runlevels. If your system has redhat-ish and 
chkconfig, it can automate this part for you, as the redhat init script 
that comes with spamd has chkconfig tags in it.


>
> John Hardin wrote:
>> On Fri, 21 Mar 2008, Skip wrote:
>>
>>> If I did go this route, how would I make sure that my spamc talks to 
>>> my spamd and not the other one that is already running on the box?
>>
>> Don't use the default network port number.
>>
>


Re: Logging

Posted by Skip <sk...@pelorus.org>.
One more dumb question (and this really is more of a linux question than 
a SA question), but if I start spamd -d from a console, and then quit 
that console, won't the daemon quit too?  I think the only other option 
is to "run it from cron" to get it out of a console, but that's a real 
kludge and I'd rather not do that.

John Hardin wrote:
> On Fri, 21 Mar 2008, Skip wrote:
>
>> If I did go this route, how would I make sure that my spamc talks to 
>> my spamd and not the other one that is already running on the box?
>
> Don't use the default network port number.
>

Re: Logging

Posted by John Hardin <jh...@impsec.org>.
On Fri, 21 Mar 2008, Skip wrote:

> If I did go this route, how would I make sure that my spamc talks to my 
> spamd and not the other one that is already running on the box?

Don't use the default network port number.

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Individual liberties are always "loopholes" to absolute authority.
-----------------------------------------------------------------------
  65 days until the Mars Phoenix lander arrives at Mars