Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532094 - mail-filter/spamassassin - add sa-update cron job
Summary: mail-filter/spamassassin - add sa-update cron job
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 583908
  Show dependency tree
 
Reported: 2014-12-09 23:11 UTC by Toralf Förster
Modified: 2016-06-05 22:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2014-12-09 23:11:19 UTC
something in that direction, or ?

# cat /etc/cron.daily/sa-update 
#!/bin/sh
#

/usr/bin/sa-update && /etc/init.d/spamd reload 1>/dev/null
Comment 1 Michael Orlitzky gentoo-dev 2016-06-03 15:47:16 UTC
I'm a little worried about enabling this out-of-the-box, because some configuration will probably be necessary. I guess we could install it without its +x bit by default.

For example, my cron job looks like,

  # First, redirect stdout to /dev/null.
  exec 1>/dev/null

  # This thing spits out its progress to stderr.
  sa-update 2>/dev/null

  # Exit code 0 means new updates were installed. Exit code 1 means we
  # were already up-to-date. Anything else is failure.
  if [ $? -eq 0 ]; then
      sa-compile
      /etc/init.d/amavisd reload
  fi

But you're using spamd, so that last "reload" command would be different for you. I'm thinking I could put both in the cron job, commented out, and then we could tell users to pick the right reload command and then mark the cron job +x.
Comment 2 Toralf Förster gentoo-dev 2016-06-03 17:01:14 UTC
well, your script looks much more sophisticated - my is just quick & dirty - it just works, so feel free to release a better one than in comment #0
Comment 3 Michael Orlitzky gentoo-dev 2016-06-03 17:40:04 UTC
(In reply to Toralf Förster from comment #2)
> well, your script looks much more sophisticated - my is just quick & dirty -
> it just works, so feel free to release a better one than in comment #0

Another option to consider is a wiki page. Right now we have a big ugly postinst message that nobody reads, but we could replace that with a one-line link to the wiki. Then all of the information about cron jobs and whatnot could go there.
Comment 4 Toralf Förster gentoo-dev 2016-06-03 18:12:19 UTC
BTW I'm pretty sure sa-update in the mean while doesn't print to stderr, b/c I do use this cron job since years :and would otherwise being informed via email.
Comment 5 Michael Orlitzky gentoo-dev 2016-06-03 18:21:55 UTC
(In reply to Toralf Förster from comment #4)
> BTW I'm pretty sure sa-update in the mean while doesn't print to stderr, b/c
> I do use this cron job since years :and would otherwise being informed via
> email.

Huh. I added that line because it was always emailing me output. Not every time, but maybe once a week I would get a progress bar or something like that emailed to me *shrug*.

I wrote a wiki page:

  https://wiki.gentoo.org/wiki/SpamAssassin

I'll probably replace our postinst elog messages with that, and then if users can contribute e.g. systemd commands for the cron job it will be a lot easier to update.
Comment 6 Michael Orlitzky gentoo-dev 2016-06-05 22:39:35 UTC
Ok, here we go:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd452f87c73fb1dfb3050d980cdbf53f0382b216

Just set USE=cron. I got some mailing list feedback on how to make it work with systemd (thanks Rich and J. García).