Discussion:
[users] Request: amavisd pid file location
David Hrbáč
2010-06-21 10:23:12 UTC
Permalink
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Thanks,
David Hrb??
Ned Slider
2010-06-21 10:49:14 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Mine is at:

/var/amavis/var/amavisd.pid

# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64

Hope that helps.
David Hrbáč
2010-06-21 12:21:47 UTC
Permalink
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
Did you changed the location? Within conf file is:
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P

But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
Ned Slider
2010-06-21 14:09:26 UTC
Permalink
Post by David Hrbáč
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
No, I didn't change the location from when it was installed/

Here's what I have in /etc/amavisd.conf, which I may have just uncommented:

$MYHOME = '/var/amavis'; # a convenient default for other settings, -H

$lock_file = "$MYHOME/var/amavisd.lock"; # -L
$pid_file = "$MYHOME/var/amavisd.pid"; # -P

So the pid file sits in /var/amavis/var/amavisd.pid as I originally
indicated.
Ned Slider
2010-06-21 14:09:26 UTC
Permalink
Post by David Hrbáč
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
No, I didn't change the location from when it was installed/

Here's what I have in /etc/amavisd.conf, which I may have just uncommented:

$MYHOME = '/var/amavis'; # a convenient default for other settings, -H

$lock_file = "$MYHOME/var/amavisd.lock"; # -L
$pid_file = "$MYHOME/var/amavisd.pid"; # -P

So the pid file sits in /var/amavis/var/amavisd.pid as I originally
indicated.
Ned Slider
2010-06-21 14:09:26 UTC
Permalink
Post by David Hrbáč
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
No, I didn't change the location from when it was installed/

Here's what I have in /etc/amavisd.conf, which I may have just uncommented:

$MYHOME = '/var/amavis'; # a convenient default for other settings, -H

$lock_file = "$MYHOME/var/amavisd.lock"; # -L
$pid_file = "$MYHOME/var/amavisd.pid"; # -P

So the pid file sits in /var/amavis/var/amavisd.pid as I originally
indicated.
Ned Slider
2010-06-21 14:09:26 UTC
Permalink
Post by David Hrbáč
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
No, I didn't change the location from when it was installed/

Here's what I have in /etc/amavisd.conf, which I may have just uncommented:

$MYHOME = '/var/amavis'; # a convenient default for other settings, -H

$lock_file = "$MYHOME/var/amavisd.lock"; # -L
$pid_file = "$MYHOME/var/amavisd.pid"; # -P

So the pid file sits in /var/amavis/var/amavisd.pid as I originally
indicated.
Ned Slider
2010-06-21 14:09:26 UTC
Permalink
Post by David Hrbáč
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
No, I didn't change the location from when it was installed/

Here's what I have in /etc/amavisd.conf, which I may have just uncommented:

$MYHOME = '/var/amavis'; # a convenient default for other settings, -H

$lock_file = "$MYHOME/var/amavisd.lock"; # -L
$pid_file = "$MYHOME/var/amavisd.pid"; # -P

So the pid file sits in /var/amavis/var/amavisd.pid as I originally
indicated.
David Hrbáč
2010-06-21 12:21:47 UTC
Permalink
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
Did you changed the location? Within conf file is:
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P

But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
David Hrbáč
2010-06-21 12:21:47 UTC
Permalink
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
Did you changed the location? Within conf file is:
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P

But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
David Hrbáč
2010-06-21 12:21:47 UTC
Permalink
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
Did you changed the location? Within conf file is:
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P

But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
David Hrbáč
2010-06-21 12:21:47 UTC
Permalink
Post by Ned Slider
/var/amavis/var/amavisd.pid
# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64
Hope that helps.
Did you changed the location? Within conf file is:
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P

But clean installation creates $MYHOME/amavisd.lock and
$MYHOME/amavisd.pid files.
DH
chris
2010-06-21 11:22:23 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Well . . .

In amavisd-new.2.6.4.tar.gz from the home site . . .

The "default" ( in amavisd.conf-default ) is

/var/amavis/amavisd.pid

but in the supplied amavisd.conf file it is

/var/amavis/var/amavisd.pid

which I suppose has a certain logic about it,

and

the amavisd.conf-sample has it in

/var/lib/amavis/amavisd.conf

though it is commented out and therefore the default
will be used.


I keep ALL my pid files in

/var/run

which allows anyone else, who may not be familiar with the
packages in question, to get at them without searching for and
through the relevant conf files, which I take to be a good
discipline in a production environment.

CB
Post by David Hrbáč
Thanks,
David Hrb??
_______________________________________________
users mailing list
users at lists.rpmforge.net
http://lists.rpmforge.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100621/08f192dd/attachment.html
David Hrbáč
2010-06-21 12:22:18 UTC
Permalink
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
have:
# pidfile: /var/run/amavisd.pid

and clean installation creates /amavis/var/amavisd.pid. There's a
problem during the system crash. Pid file remains, amavis won't start,
until /var/amavis/amavis.pid is removed.
DH
chris b
2010-06-22 11:47:41 UTC
Permalink
From: David Hrb?? <hrbac.conf at seznam.cz>
Cc: Rpmforge Users <users at lists.rpmforge.net>
Sent: Mon, 21 June, 2010 13:22:18
Subject: Re: [users] Request: amavisd pid file location
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
# pidfile: /var/run/amavisd.pid
Yup, it's commented out . . . .

The one in amavisd_init.sh in the tar.gz is

# pidfile: /var/amavis/amavisd.pid

so Dag must have changed it, but not in the .conf
and clean installation creates /amavis/var/amavisd.pid.
There's a
problem during the system crash. Pid file remains,
amavis won't start,
until /var/amavis/amavis.pid is removed.
I don't see this behavior trying to start amavisd
with the pid file in place.

In my view, pid files should all be below

/var/run/

so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.

CCB
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/4b08ed68/attachment.html
David Hrbáč
2010-06-22 13:09:07 UTC
Permalink
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.

(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm

DH
David Hrbáč
2010-06-22 13:09:07 UTC
Permalink
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.

(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm

DH
David Hrbáč
2010-06-22 13:09:07 UTC
Permalink
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.

(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm

DH
David Hrbáč
2010-06-22 13:09:07 UTC
Permalink
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.

(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm

DH
David Hrbáč
2010-06-22 13:09:07 UTC
Permalink
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.

(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm

DH
chris b
2010-06-22 11:47:41 UTC
Permalink
From: David Hrb?? <hrbac.conf at seznam.cz>
Cc: Rpmforge Users <users at lists.rpmforge.net>
Sent: Mon, 21 June, 2010 13:22:18
Subject: Re: [users] Request: amavisd pid file location
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
# pidfile: /var/run/amavisd.pid
Yup, it's commented out . . . .

The one in amavisd_init.sh in the tar.gz is

# pidfile: /var/amavis/amavisd.pid

so Dag must have changed it, but not in the .conf
and clean installation creates /amavis/var/amavisd.pid.
There's a
problem during the system crash. Pid file remains,
amavis won't start,
until /var/amavis/amavis.pid is removed.
I don't see this behavior trying to start amavisd
with the pid file in place.

In my view, pid files should all be below

/var/run/

so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.

CCB
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/4b08ed68/attachment-0001.html
chris b
2010-06-22 11:47:41 UTC
Permalink
From: David Hrb?? <hrbac.conf at seznam.cz>
Cc: Rpmforge Users <users at lists.rpmforge.net>
Sent: Mon, 21 June, 2010 13:22:18
Subject: Re: [users] Request: amavisd pid file location
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
# pidfile: /var/run/amavisd.pid
Yup, it's commented out . . . .

The one in amavisd_init.sh in the tar.gz is

# pidfile: /var/amavis/amavisd.pid

so Dag must have changed it, but not in the .conf
and clean installation creates /amavis/var/amavisd.pid.
There's a
problem during the system crash. Pid file remains,
amavis won't start,
until /var/amavis/amavis.pid is removed.
I don't see this behavior trying to start amavisd
with the pid file in place.

In my view, pid files should all be below

/var/run/

so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.

CCB
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/4b08ed68/attachment-0002.html
chris b
2010-06-22 11:47:41 UTC
Permalink
From: David Hrb?? <hrbac.conf at seznam.cz>
Cc: Rpmforge Users <users at lists.rpmforge.net>
Sent: Mon, 21 June, 2010 13:22:18
Subject: Re: [users] Request: amavisd pid file location
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
# pidfile: /var/run/amavisd.pid
Yup, it's commented out . . . .

The one in amavisd_init.sh in the tar.gz is

# pidfile: /var/amavis/amavisd.pid

so Dag must have changed it, but not in the .conf
and clean installation creates /amavis/var/amavisd.pid.
There's a
problem during the system crash. Pid file remains,
amavis won't start,
until /var/amavis/amavis.pid is removed.
I don't see this behavior trying to start amavisd
with the pid file in place.

In my view, pid files should all be below

/var/run/

so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.

CCB
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/4b08ed68/attachment-0003.html
chris b
2010-06-22 11:47:41 UTC
Permalink
From: David Hrb?? <hrbac.conf at seznam.cz>
Cc: Rpmforge Users <users at lists.rpmforge.net>
Sent: Mon, 21 June, 2010 13:22:18
Subject: Re: [users] Request: amavisd pid file location
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
# pidfile: /var/run/amavisd.pid
Yup, it's commented out . . . .

The one in amavisd_init.sh in the tar.gz is

# pidfile: /var/amavis/amavisd.pid

so Dag must have changed it, but not in the .conf
and clean installation creates /amavis/var/amavisd.pid.
There's a
problem during the system crash. Pid file remains,
amavis won't start,
until /var/amavis/amavis.pid is removed.
I don't see this behavior trying to start amavisd
with the pid file in place.

In my view, pid files should all be below

/var/run/

so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.

CCB
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.repoforge.org/pipermail/users/attachments/20100622/4b08ed68/attachment-0004.html>
David Hrbáč
2010-06-21 12:22:18 UTC
Permalink
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
have:
# pidfile: /var/run/amavisd.pid

and clean installation creates /amavis/var/amavisd.pid. There's a
problem during the system crash. Pid file remains, amavis won't start,
until /var/amavis/amavis.pid is removed.
DH
David Hrbáč
2010-06-21 12:22:18 UTC
Permalink
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
have:
# pidfile: /var/run/amavisd.pid

and clean installation creates /amavis/var/amavisd.pid. There's a
problem during the system crash. Pid file remains, amavis won't start,
until /var/amavis/amavis.pid is removed.
DH
David Hrbáč
2010-06-21 12:22:18 UTC
Permalink
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
have:
# pidfile: /var/run/amavisd.pid

and clean installation creates /amavis/var/amavisd.pid. There's a
problem during the system crash. Pid file remains, amavis won't start,
until /var/amavis/amavis.pid is removed.
DH
David Hrbáč
2010-06-21 12:22:18 UTC
Permalink
Post by chris
but in the supplied amavisd.conf file it is
/var/amavis/var/amavisd.pid
Right,
An there's inconsistency between conf and init file. Within init file we
have:
# pidfile: /var/run/amavisd.pid

and clean installation creates /amavis/var/amavisd.pid. There's a
problem during the system crash. Pid file remains, amavis won't start,
until /var/amavis/amavis.pid is removed.
DH
chris
2010-06-22 20:08:00 UTC
Permalink
Post by David Hrbáč
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.
(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm
Oh yes, I can see in the module. I've never used it tho.


Hmmm but amavisd doesn't use it either though.

On the other hand, amavisd does use its pid file.
It half validates it first, then uses it to stop anyone running
it more than once.

Doing a quick flick through the code

. . . [SNIP]

# is amavisd daemon already running?
. . . they're looking for a pid file . . .
if (defined $amavisd_pid && defined $mtime) { # got a PID from a file
# Is pid file older than system uptime? If so, it should be
disregarded,
# it must not prevent starting up amavisd after unclean shutdown.
my($now) = time; my($uptime,$uptime_fmt); # sys uptime in seconds

. . . now found a pid file which was created afer the last boot . .

if (!kill(0,$amavisd_pid)) { # does a process exist?
$! == ESRCH or die "Can't send SIG 0 to process [$amavisd_pid]:
$!";
undef $amavisd_pid; # process does not exist

. . . does the process with this pid exist, and are we starting or
stopping ??

# act on command line parameter in $cmd
my($killed_amavisd_pid); my($kill_sig_used);
if ($cmd =~ /^(?:start|debug|debug-sa|foreground)?\z/) {
!defined($amavisd_pid)
or die "The amavisd daemon is already running, PID:
[$amavisd_pid]\n";

. . . start being the default if nothing is on the command line . . .

Well
This means amavisd checks to see if a "valid" pid file exists,
( that is to say one of the correct name in the correct place,
contining a number, which was created after the last boot )
and if that's all ok, that a process with that pid is running.

If this is the case then it won't start, but it will restart or stop.

This illustrates the other issue with pif files, because if the
process crashes leaving a pid file behind and then
subsequently another different process starts which gets
allocated the old process number, then you won't be able
to start amavisd.
Oh well, i suppose it doesn't happen very often !!


My view is that ALL pid files should be below
/var/run/
which looks like what Dag was aiming at with his init script.
Post by David Hrbáč
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/afcfcadc/attachment.html
David Hrbáč
2010-06-21 10:23:12 UTC
Permalink
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Thanks,
David Hrb??
Ned Slider
2010-06-21 10:49:14 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Mine is at:

/var/amavis/var/amavisd.pid

# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64

Hope that helps.
chris
2010-06-21 11:22:23 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Well . . .

In amavisd-new.2.6.4.tar.gz from the home site . . .

The "default" ( in amavisd.conf-default ) is

/var/amavis/amavisd.pid

but in the supplied amavisd.conf file it is

/var/amavis/var/amavisd.pid

which I suppose has a certain logic about it,

and

the amavisd.conf-sample has it in

/var/lib/amavis/amavisd.conf

though it is commented out and therefore the default
will be used.


I keep ALL my pid files in

/var/run

which allows anyone else, who may not be familiar with the
packages in question, to get at them without searching for and
through the relevant conf files, which I take to be a good
discipline in a production environment.

CB
Post by David Hrbáč
Thanks,
David Hrb??
_______________________________________________
users mailing list
users at lists.rpmforge.net
http://lists.rpmforge.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100621/08f192dd/attachment-0001.html
chris
2010-06-22 20:08:00 UTC
Permalink
Post by David Hrbáč
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.
(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm
Oh yes, I can see in the module. I've never used it tho.


Hmmm but amavisd doesn't use it either though.

On the other hand, amavisd does use its pid file.
It half validates it first, then uses it to stop anyone running
it more than once.

Doing a quick flick through the code

. . . [SNIP]

# is amavisd daemon already running?
. . . they're looking for a pid file . . .
if (defined $amavisd_pid && defined $mtime) { # got a PID from a file
# Is pid file older than system uptime? If so, it should be
disregarded,
# it must not prevent starting up amavisd after unclean shutdown.
my($now) = time; my($uptime,$uptime_fmt); # sys uptime in seconds

. . . now found a pid file which was created afer the last boot . .

if (!kill(0,$amavisd_pid)) { # does a process exist?
$! == ESRCH or die "Can't send SIG 0 to process [$amavisd_pid]:
$!";
undef $amavisd_pid; # process does not exist

. . . does the process with this pid exist, and are we starting or
stopping ??

# act on command line parameter in $cmd
my($killed_amavisd_pid); my($kill_sig_used);
if ($cmd =~ /^(?:start|debug|debug-sa|foreground)?\z/) {
!defined($amavisd_pid)
or die "The amavisd daemon is already running, PID:
[$amavisd_pid]\n";

. . . start being the default if nothing is on the command line . . .

Well
This means amavisd checks to see if a "valid" pid file exists,
( that is to say one of the correct name in the correct place,
contining a number, which was created after the last boot )
and if that's all ok, that a process with that pid is running.

If this is the case then it won't start, but it will restart or stop.

This illustrates the other issue with pif files, because if the
process crashes leaving a pid file behind and then
subsequently another different process starts which gets
allocated the old process number, then you won't be able
to start amavisd.
Oh well, i suppose it doesn't happen very often !!


My view is that ALL pid files should be below
/var/run/
which looks like what Dag was aiming at with his init script.
Post by David Hrbáč
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/afcfcadc/attachment-0001.html
David Hrbáč
2010-06-21 10:23:12 UTC
Permalink
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Thanks,
David Hrb??
Ned Slider
2010-06-21 10:49:14 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Mine is at:

/var/amavis/var/amavisd.pid

# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64

Hope that helps.
chris
2010-06-21 11:22:23 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Well . . .

In amavisd-new.2.6.4.tar.gz from the home site . . .

The "default" ( in amavisd.conf-default ) is

/var/amavis/amavisd.pid

but in the supplied amavisd.conf file it is

/var/amavis/var/amavisd.pid

which I suppose has a certain logic about it,

and

the amavisd.conf-sample has it in

/var/lib/amavis/amavisd.conf

though it is commented out and therefore the default
will be used.


I keep ALL my pid files in

/var/run

which allows anyone else, who may not be familiar with the
packages in question, to get at them without searching for and
through the relevant conf files, which I take to be a good
discipline in a production environment.

CB
Post by David Hrbáč
Thanks,
David Hrb??
_______________________________________________
users mailing list
users at lists.rpmforge.net
http://lists.rpmforge.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100621/08f192dd/attachment-0002.html
chris
2010-06-22 20:08:00 UTC
Permalink
Post by David Hrbáč
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.
(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm
Oh yes, I can see in the module. I've never used it tho.


Hmmm but amavisd doesn't use it either though.

On the other hand, amavisd does use its pid file.
It half validates it first, then uses it to stop anyone running
it more than once.

Doing a quick flick through the code

. . . [SNIP]

# is amavisd daemon already running?
. . . they're looking for a pid file . . .
if (defined $amavisd_pid && defined $mtime) { # got a PID from a file
# Is pid file older than system uptime? If so, it should be
disregarded,
# it must not prevent starting up amavisd after unclean shutdown.
my($now) = time; my($uptime,$uptime_fmt); # sys uptime in seconds

. . . now found a pid file which was created afer the last boot . .

if (!kill(0,$amavisd_pid)) { # does a process exist?
$! == ESRCH or die "Can't send SIG 0 to process [$amavisd_pid]:
$!";
undef $amavisd_pid; # process does not exist

. . . does the process with this pid exist, and are we starting or
stopping ??

# act on command line parameter in $cmd
my($killed_amavisd_pid); my($kill_sig_used);
if ($cmd =~ /^(?:start|debug|debug-sa|foreground)?\z/) {
!defined($amavisd_pid)
or die "The amavisd daemon is already running, PID:
[$amavisd_pid]\n";

. . . start being the default if nothing is on the command line . . .

Well
This means amavisd checks to see if a "valid" pid file exists,
( that is to say one of the correct name in the correct place,
contining a number, which was created after the last boot )
and if that's all ok, that a process with that pid is running.

If this is the case then it won't start, but it will restart or stop.

This illustrates the other issue with pif files, because if the
process crashes leaving a pid file behind and then
subsequently another different process starts which gets
allocated the old process number, then you won't be able
to start amavisd.
Oh well, i suppose it doesn't happen very often !!


My view is that ALL pid files should be below
/var/run/
which looks like what Dag was aiming at with his init script.
Post by David Hrbáč
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/afcfcadc/attachment-0002.html
David Hrbáč
2010-06-21 10:23:12 UTC
Permalink
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Thanks,
David Hrb??
Ned Slider
2010-06-21 10:49:14 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Mine is at:

/var/amavis/var/amavisd.pid

# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64

Hope that helps.
chris
2010-06-21 11:22:23 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Well . . .

In amavisd-new.2.6.4.tar.gz from the home site . . .

The "default" ( in amavisd.conf-default ) is

/var/amavis/amavisd.pid

but in the supplied amavisd.conf file it is

/var/amavis/var/amavisd.pid

which I suppose has a certain logic about it,

and

the amavisd.conf-sample has it in

/var/lib/amavis/amavisd.conf

though it is commented out and therefore the default
will be used.


I keep ALL my pid files in

/var/run

which allows anyone else, who may not be familiar with the
packages in question, to get at them without searching for and
through the relevant conf files, which I take to be a good
discipline in a production environment.

CB
Post by David Hrbáč
Thanks,
David Hrb??
_______________________________________________
users mailing list
users at lists.rpmforge.net
http://lists.rpmforge.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100621/08f192dd/attachment-0003.html
chris
2010-06-22 20:08:00 UTC
Permalink
Post by David Hrbáč
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.
(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm
Oh yes, I can see in the module. I've never used it tho.


Hmmm but amavisd doesn't use it either though.

On the other hand, amavisd does use its pid file.
It half validates it first, then uses it to stop anyone running
it more than once.

Doing a quick flick through the code

. . . [SNIP]

# is amavisd daemon already running?
. . . they're looking for a pid file . . .
if (defined $amavisd_pid && defined $mtime) { # got a PID from a file
# Is pid file older than system uptime? If so, it should be
disregarded,
# it must not prevent starting up amavisd after unclean shutdown.
my($now) = time; my($uptime,$uptime_fmt); # sys uptime in seconds

. . . now found a pid file which was created afer the last boot . .

if (!kill(0,$amavisd_pid)) { # does a process exist?
$! == ESRCH or die "Can't send SIG 0 to process [$amavisd_pid]:
$!";
undef $amavisd_pid; # process does not exist

. . . does the process with this pid exist, and are we starting or
stopping ??

# act on command line parameter in $cmd
my($killed_amavisd_pid); my($kill_sig_used);
if ($cmd =~ /^(?:start|debug|debug-sa|foreground)?\z/) {
!defined($amavisd_pid)
or die "The amavisd daemon is already running, PID:
[$amavisd_pid]\n";

. . . start being the default if nothing is on the command line . . .

Well
This means amavisd checks to see if a "valid" pid file exists,
( that is to say one of the correct name in the correct place,
contining a number, which was created after the last boot )
and if that's all ok, that a process with that pid is running.

If this is the case then it won't start, but it will restart or stop.

This illustrates the other issue with pif files, because if the
process crashes leaving a pid file behind and then
subsequently another different process starts which gets
allocated the old process number, then you won't be able
to start amavisd.
Oh well, i suppose it doesn't happen very often !!


My view is that ALL pid files should be below
/var/run/
which looks like what Dag was aiming at with his init script.
Post by David Hrbáč
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoforge.org/pipermail/users/attachments/20100622/afcfcadc/attachment-0003.html
David Hrbáč
2010-06-21 10:23:12 UTC
Permalink
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Thanks,
David Hrb??
Ned Slider
2010-06-21 10:49:14 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Mine is at:

/var/amavis/var/amavisd.pid

# rpm -q amavisd-new
amavisd-new-2.6.4-2.el5.rf.x86_64

Hope that helps.
chris
2010-06-21 11:22:23 UTC
Permalink
Post by David Hrbáč
Hi,
would you be so kind to send me amavisd pid file location from your
production sites? I'd like to clean amavisd.spec/init file up. I do have
pid /var/amavis/amavisd.pid on all the sites I manage.
Well . . .

In amavisd-new.2.6.4.tar.gz from the home site . . .

The "default" ( in amavisd.conf-default ) is

/var/amavis/amavisd.pid

but in the supplied amavisd.conf file it is

/var/amavis/var/amavisd.pid

which I suppose has a certain logic about it,

and

the amavisd.conf-sample has it in

/var/lib/amavis/amavisd.conf

though it is commented out and therefore the default
will be used.


I keep ALL my pid files in

/var/run

which allows anyone else, who may not be familiar with the
packages in question, to get at them without searching for and
through the relevant conf files, which I take to be a good
discipline in a production environment.

CB
Post by David Hrbáč
Thanks,
David Hrb??
_______________________________________________
users mailing list
users at lists.rpmforge.net
http://lists.rpmforge.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.repoforge.org/pipermail/users/attachments/20100621/08f192dd/attachment-0004.html>
chris
2010-06-22 20:08:00 UTC
Permalink
Post by David Hrbáč
Post by chris b
so you know where to find them, though I don't
see much point to them anymore, unless you
want to run multiple instances and control
them independently because killproc doesn't
use pid files and stops all instances.
The point is that perl Net::Server detects stale PID files... And aborts
the execution.
(!)Net::Server: 2010/06/20-19:22:06 Pid_file already exists for running
process (3708)... aborting\n\n at line 277 in file
/usr/lib/perl5/vendor_perl/5.8.5/Net/Server.pm
Oh yes, I can see in the module. I've never used it tho.


Hmmm but amavisd doesn't use it either though.

On the other hand, amavisd does use its pid file.
It half validates it first, then uses it to stop anyone running
it more than once.

Doing a quick flick through the code

. . . [SNIP]

# is amavisd daemon already running?
. . . they're looking for a pid file . . .
if (defined $amavisd_pid && defined $mtime) { # got a PID from a file
# Is pid file older than system uptime? If so, it should be
disregarded,
# it must not prevent starting up amavisd after unclean shutdown.
my($now) = time; my($uptime,$uptime_fmt); # sys uptime in seconds

. . . now found a pid file which was created afer the last boot . .

if (!kill(0,$amavisd_pid)) { # does a process exist?
$! == ESRCH or die "Can't send SIG 0 to process [$amavisd_pid]:
$!";
undef $amavisd_pid; # process does not exist

. . . does the process with this pid exist, and are we starting or
stopping ??

# act on command line parameter in $cmd
my($killed_amavisd_pid); my($kill_sig_used);
if ($cmd =~ /^(?:start|debug|debug-sa|foreground)?\z/) {
!defined($amavisd_pid)
or die "The amavisd daemon is already running, PID:
[$amavisd_pid]\n";

. . . start being the default if nothing is on the command line . . .

Well
This means amavisd checks to see if a "valid" pid file exists,
( that is to say one of the correct name in the correct place,
contining a number, which was created after the last boot )
and if that's all ok, that a process with that pid is running.

If this is the case then it won't start, but it will restart or stop.

This illustrates the other issue with pif files, because if the
process crashes leaving a pid file behind and then
subsequently another different process starts which gets
allocated the old process number, then you won't be able
to start amavisd.
Oh well, i suppose it doesn't happen very often !!


My view is that ALL pid files should be below
/var/run/
which looks like what Dag was aiming at with his init script.
Post by David Hrbáč
DH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.repoforge.org/pipermail/users/attachments/20100622/afcfcadc/attachment-0004.html>
Loading...