Bug 148893 - UPDATE fix security/swatch rc.d script
Summary: UPDATE fix security/swatch rc.d script
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: Gabor Kovesdan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-24 13:30 UTC by Michael Scheidell
Modified: 2012-01-23 19:30 UTC (History)
0 users

See Also:


Attachments
file.diff (244 bytes, patch)
2010-07-24 13:30 UTC, Michael Scheidell
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scheidell 2010-07-24 13:30:05 UTC
many rc.d scripts that use perl may not function correctly unless procname=/usr/local/bin/perl is set.
if it can't find the pid, a restart or start will just start multiple copies of swatch.  critical maintenance functions, scripts, routines might be duplicated, causing strange problems.

example is swatch, since, at least 6.2 days.

./rc.d/swatch(.sh) status can't find swatch, since rc.subr is trying to find a PROGRAM called swatch and can't.
set procname, and it can find it.

/usr/local/etc/rc.d/swatch restart
swatch not running?
Starting swatch.
ionspam.spammertrap.net# ps -auxww | grep swatch
root    25957  2.5  1.4  9000  7364  ??  Ss    8:09AM   0:00.00 /usr/local/bin/perl /tmp/.swatch_script.25955
root    19676  0.0  0.4  9004  1896  ??  Is   17Jul10   0:00.60 /usr/local/bin/perl /tmp/.swatch_script.19674
root    25960  0.0  0.2  3312   948  p0  S+    8:09AM   0:00.00 grep swatch
ionspam.spammertrap.net#
ionspam.spammertrap.net# pkill -9 -f swatch
ionspam.spammertrap.net# ps -auxww | grep swatch
root    25970  0.0  0.2  3312   960  p0  S+    8:10AM   0:00.00 grep swatch
ionspam.spammertrap.net# /usr/local/etc/rc.d/swatch start
Starting swatch.
ionspam.spammertrap.net# /usr/local/etc/rc.d/swatch status
swatch is not running.
ionspam.spammertrap.net# ps -auxww | grep swatch
root    25980  1.4  1.4  9000  7380  ??  Ss    8:10AM   0:00.00 /usr/local/bin/perl /tmp/.swatch_script.25978
root    25995  0.0  0.2  3312   960  p0  S+    8:10AM   0:00.00 grep swatch
ionspam.spammertrap.net# pkill -9 -f swatch
ionspam.spammertrap.net# patch swatch < patch.txt
ionspam.spammertrap.net# /usr/local/etc/rc.d/swatch start
Starting swatch.
ionspam.spammertrap.net# ps -auxww | grep swatch
root    26029  2.8  1.4  9000  7380  ??  Ss    8:11AM   0:00.00 /usr/local/bin/perl /tmp/.swatch_script.26027
root    26037  0.0  0.2  3312   960  p0  S+    8:11AM   0:00.00 grep swatch
ionspam.spammertrap.net# /usr/local/etc/rc.d//swatch status
swatch is running as pid 26029.

How-To-Repeat: ./rc.d/swatch start
./rc.d/swatch status

(note: it doesn't ALWAYS miss it, can't tell you why, some systems find it, but it will ALWAYS find it if you add procname. but I have seen this since at least 6.2 sparc64.  there even might be patches I submitted years ago, trying to fix it, but this will fix it and is upwards compatible. tested on 6.2 through 7.3. tested on amd64, sparc64, and i386.
tested with perl 5.8.8 through 5.10.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-07-24 13:30:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gabor

gabor@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-07-24 13:30:36 UTC
Maintainer of security/swatch,

Please note that PR ports/148893 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148893

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2010-07-24 13:30:39 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Joseph Scott 2010-07-24 16:49:49 UTC
Fine with me.

On Sat, Jul 24, 2010 at 6:30 AM, Edwin Groothuis <edwin@freebsd.org> wrote:
> Maintainer of security/swatch,
>
> Please note that PR ports/148893 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
> =C2=A0 =C2=A0http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/148893



--=20
Joseph Scott
joseph@josephscott.org
http://josephscott.org/
Comment 5 dfilter service freebsd_committer freebsd_triage 2010-08-10 12:46:20 UTC
gabor       2010-08-10 11:46:11 UTC

  FreeBSD ports repository

  Modified files:
    security/swatch      Makefile 
    security/swatch/files swatch.in 
  Log:
  - Set procname in rc.d script to make it always work correctly
  - Bump PORTREVISION
  
  PR:             ports/148893
  Submitted by:   Michael Scheidell <scheidell@secnap.net>
  Approved by:    Joseph Scott <joseph@randomnetworks.com> (maintainer)
  
  Revision  Changes    Path
  1.30      +1 -0      ports/security/swatch/Makefile
  1.5       +2 -1      ports/security/swatch/files/swatch.in
_______________________________________________
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 Gabor Kovesdan freebsd_committer freebsd_triage 2010-08-10 12:48:42 UTC
State Changed
From-To: feedback->closed

Committed, thanks.
Comment 7 Michael Scheidell freebsd_committer freebsd_triage 2012-01-23 19:24:45 UTC
Joseph:

just a heads up on one of my old pr's... something (maybe that rc_var 
ish thing?) makes swatch status, which affects 'restart' and stop, stop 
working for SOME cases.

I am working on tracking it down, and look forward to working with you 
to try to lay this to bed finally.

it LOOKS like if the swatch_x_flags like is either LONGER then 
(CMDLINEBUFFER MAX?), or you include more than (x) files in the line, 
and/or, tail args, it won't start, or will start and won't status, or 
won't stop.

I'll try to spend a couple of hours on it today to see what happens.


-- 
Michael Scheidell, CTO
o: 561-999-5000
d: 561-948-2259
 >*| *SECNAP Network Security Corporation

    * Best Mobile Solutions Product of 2011
    * Best Intrusion Prevention Product
    * Hot Company Finalist 2011
    * Best Email Security Product
    * Certified SNORT Integrator