Bug 190005 - mail/spamassassin's /usr/local/etc/rc.d/sa-spamd r349854 incorrectly assumes the existence of the directory /var/run/${name}, i.e. /var/run/spamd
Summary: mail/spamassassin's /usr/local/etc/rc.d/sa-spamd r349854 incorrectly assumes ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-20 15:00 UTC by Trond Endrestøl
Modified: 2014-07-13 18:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2014-05-20 15:00:01 UTC
mail/spamassassin's /usr/local/etc/rc.d/sa-spamd r349854 incorrectly assumes the existence of the directory /var/run/${name}, i.e. /var/run/spamd.

If /var/run/spamd happens to be removed during deinstall, then it should be the responsibility of the port to create this directory during install.

Fix: 

Augment head/mail/spamassassin/files/sa-spamd.in to check if /var/run/${name}, i.e. /var/run/spamd exists, creating this directory if necessary as part of the start and restart sequences.

As an alternative, augment head/mail/spamassassin/pkg-plist to create /var/run/spamd during install.
How-To-Repeat: Install mail/spamassassin.
Forcefully upgrade mail/spamassassin, e.g. portupgrade -f mail/spamassassin.
Notice the absence of the directory /var/run/spamd.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-20 15:00:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->adamw

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Adam Weinberger freebsd_committer freebsd_triage 2014-06-20 18:32:42 UTC
pkg-plist now correctly ensures the directory is created, and I've added it to required_dirs in sa-spamd so it'll at least barf if it isn't there.

I believe this should resolve the problem here... please let me know if it still persists or if I've done it sub-optimally.

Thanks for the report!
Comment 3 Helge Oldach 2014-07-13 15:00:58 UTC
(In reply to Adam Weinberger from comment #2)
> pkg-plist now correctly ensures the directory is created, and I've added it
> to required_dirs in sa-spamd so it'll at least barf if it isn't there.
> 
> I believe this should resolve the problem here... please let me know if it
> still persists or if I've done it sub-optimally.

Problem persists: /var/run/spamd is NOT created upon install. Seems you missed the change to pkg-plist mentioned above?
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2014-07-13 16:33:02 UTC
Not sure what the issue is here... it certainly works for me installing from ports, and the directory is present in the tarball that I pull with 'pkg fetch'.

What OS version are you running, and are you using ports, pkgng, or pkg_install?
Comment 5 Helge Oldach 2014-07-13 17:12:50 UTC
running 9.3-STABLE
using old-style pkg

I observe there is no /var directory in the package:
# tar tvfz /usr/obj/usr/ports/mail/spamassassin/work/pkg/pamassassin-3.4.0_12.tbz | fgrep var
# 

Are you sure that the pkg-plist change mentioned above ("pkg-plist now correctly ensures the directory is created") is pushed to the repository? Because pkg-plist is >2 months old...
Comment 6 Helge Oldach 2014-07-13 17:17:02 UTC
(In reply to Helge Oldach from comment #5)
> using old-style pkg

That means: I am installing from ports.

> # tar tvfz /usr/obj/usr/ports/mail/spamassassin/work/pkg/pamassassin-3.4.0_12.tbz | fgrep var
> # 

I dropped an "s" letter here while copy & paste verbatim: That should of course read:
# tar tvfz /usr/obj/usr/ports/mail/spamassassin/work/pkg/spamassassin-3.4.0_12.tbz | fgrep var
#
Comment 7 Trond Endrestøl 2014-07-13 17:17:47 UTC
(In reply to Adam Weinberger from comment #4)
> Not sure what the issue is here... it certainly works for me installing from
> ports, and the directory is present in the tarball that I pull with 'pkg
> fetch'.
> 
> What OS version are you running, and are you using ports, pkgng, or
> pkg_install?

FreeBSD/amd64 stable/9 r268446.
ports without pkgng, using latest portupgrade.
(Boy, do I miss the old gnats system and its specific fields for this sort of information.)

In other words, the +CONTENTS file does NOT list /var/run/spamd for creation when installing, it's only listed for decomissioning:

@comment begin @dirrmtry /var/run/spamd
@unexec rmdir "/var/run/spamd" 2>/dev/null || true
@comment end @dirrmtry /var/run/spamd

I will succumb to peer pressure and migrate to pkgng on said system later this summer.
Comment 8 Adam Weinberger freebsd_committer freebsd_triage 2014-07-13 17:33:36 UTC
Ahh. I see the common thread here. You are both running pkg_install instead of pkgng. It appears that support for paths outside of ${PREFIX} was only added to pkgng.

Of course, I think you should both get on the bandwagon and come join us out here in 2014 with our smart phones and pkgng's ;-)

That said, it's still another 6 weeks before pkg_install is officially removed, so I'll take the originally submitted suggestion of creating the directory in sa-spamd.
Comment 9 commit-hook freebsd_committer freebsd_triage 2014-07-13 17:56:02 UTC
A commit references this bug:

Author: adamw
Date: Sun Jul 13 17:55:42 UTC 2014
New revision: 361699
URL: http://svnweb.freebsd.org/changeset/ports/361699

Log:
  Create /var/run/spamd manually in the rc(8) script, as pkg_tools does
  not create the directory from the @dirrm /var/run/spamd in the plist.

  So, we'll do it manually for the next 6 weeks.

  PR:		190005
  Submitted by:	Trond.Endrestol@ximalas.info

Changes:
  head/mail/spamassassin/Makefile
  head/mail/spamassassin/files/sa-spamd.in
Comment 10 Adam Weinberger freebsd_committer freebsd_triage 2014-07-13 18:00:47 UTC
Okay, I've committed what I'm hoping will finally fix this properly for you! It does what you'd originally suggested, and manually creates the directory during start and restart.

Thanks for bearing with me!