Bug 99794 - mail/spampd: rc script for spampd
Summary: mail/spampd: rc script for spampd
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: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-05 01:50 UTC by Marshal Newrock
Modified: 2008-03-14 13:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marshal Newrock 2006-07-05 01:50:18 UTC
spampd currently has an old-style rc script, which requires editing the script to change options.  Attached is a new script.

Fix: 

#!/bin/sh
#
# PROVIDE: spampd
#
# Add the fellowing line to /etc/rc.conf to enable spampd:
#
# spampd_enable (bool):         Set it to "YES" to enable spampd
#                               Default is "NO"
# spampd_flags

. /etc/rc.subr

name="spampd"
rcvar=`set_rcvar`

: ${spampd_enable="NO"}
: ${spampd_pidfile="/var/run/spamd/spampd.pid"}
: ${spampd_flags="--user=spamd --group=spamd --host 127.0.0.1:10024 --relayhost=127.0.0.1:10025 --dose --tagall --auto-whitelist"}

load_rc_config $name

command=/usr/local/sbin/$name
command_args="${spampd_flags} --pid=${spampd_pidfile}"
pidfile=${spampd_pidfile}
sig_stop=-KILL

run_rc_command $1
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-07-05 02:29:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->perl

Over to maintainer
Comment 2 Sergey Matveychuk freebsd_committer freebsd_triage 2006-07-10 12:50:50 UTC
Responsible Changed
From-To: perl->freebsd-ports-bugs

Wrong responsible fixed
Comment 3 Sergey Matveychuk freebsd_committer freebsd_triage 2006-07-10 12:52:28 UTC
State Changed
From-To: open->feedback

Ask for maintainer approval.
Comment 4 Marshal Newrock 2006-07-31 15:33:43 UTC
The original script does not work properly because spampd is a perl process, 
and so "spampd" does not appear in the process list.  This version 
addresses this.


#!/bin/sh
#
# PROVIDE: spampd
#
# Add the fellowing line to /etc/rc.conf to enable spampd:
#
# spampd_enable (bool):         Set it to "YES" to enable spampd
#                               Default is "NO"
# spampd_flags

. /etc/rc.subr

name="spampd"
rcvar=`set_rcvar`

: ${spampd_enable="NO"}
: ${spampd_pidfile="/var/run/spamd/spampd.pid"}
: ${spampd_flags="--user=spamd --group=spamd --host 
127.0.0.1:10024 --relayhost=
127.0.0.1:10025 --dose --tagall --auto-whitelist"}

load_rc_config $name

command="/usr/local/sbin/$name"
command_args="${spampd_flags} --pid=${spampd_pidfile}"
pidfile="${spampd_pidfile}"
sig_stop="-KILL"
stop_cmd="stop_cmd"
status_cmd="status_cmd"

stop_cmd()
{
  if [ -f "$pidfile" ]; then
    kill `cat $pidfile`
    rm -f $pidfile
    echo -n " spampd"
  fi
}

status_cmd()
{
  if [ -f "$pidfile" ]; then
    echo "${name} is running as pid `cat $pidfile`."
  else
    echo "${name} is not running."
  fi
}

run_rc_command $1
Comment 5 dfilter service freebsd_committer freebsd_triage 2006-10-07 12:47:25 UTC
pav         2006-10-07 11:47:19 UTC

  FreeBSD ports repository

  Modified files:
    mail/spampd          Makefile 
  Added files:
    mail/spampd/files    spampd.in 
  Removed files:
    mail/spampd          pkg-plist 
    mail/spampd/files    spampd.sh.sample 
  Log:
  - Switch to rc_subr startup script. The app will now run under spamd user by
    default
  
  PR:             ports/99794
  Submitted by:   Marshal Newrock <marshal@idealso.com>
  Approved by:    maintainer timeout (3 months)
  
  Revision  Changes    Path
  1.6       +3 -1      ports/mail/spampd/Makefile
  1.1       +47 -0     ports/mail/spampd/files/spampd.in (new)
  1.2       +0 -21     ports/mail/spampd/files/spampd.sh.sample (dead)
  1.2       +0 -2      ports/mail/spampd/pkg-plist (dead)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2006-10-07 12:47:26 UTC
State Changed
From-To: feedback->closed

Committed, thanks!
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2008-03-14 11:39:43 UTC
State Changed
From-To: closed->open

Reopen with new feedback (caught in spamtrap due to HTML email): 

Comment 8 Mark Linimon freebsd_committer freebsd_triage 2008-03-14 11:39:43 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav
Comment 9 Wesley Shields freebsd_committer freebsd_triage 2008-03-14 12:57:16 UTC
This new information appears to be a duplicate of ports/121669 which I
intend to get into the tree soon(TM).  I'd say this PR can be closed as
the new information is already recorded in an active PR.

Any thoughts Pav?

-- WXS
Comment 10 Pav Lucistnik freebsd_committer freebsd_triage 2008-03-14 13:02:40 UTC
State Changed
From-To: open->closed

Duplicate of ports/121669 which is being actively handled, so close this one.