Re: init script

From: Steve Jenkins <stevejenkins_at_gmail.com>
Date: Thu, 9 Jun 2011 15:59:26 -0700

On Thu, Jun 9, 2011 at 1:16 PM, Murray S. Kucherawy <msk_at_cloudmark.com> wrote:
>> -----Original Message-----
>> From: opendkim-dev-bounce_at_lists.opendkim.org [mailto:opendkim-dev-bounce_at_lists.opendkim.org] On Behalf Of Todd Lyons
>> Sent: Thursday, June 09, 2011 11:47 AM
>> To: opendkim-dev_at_lists.opendkim.org
>> Subject: init script
>>
>> Per the recent redhat init script changes, I'm not comfortable with
>> the init script figuring out where the pid file is supposed to be.
>> Since this is a RedHat/CentOS system, doing things in the init script
>> should be done the RedHat way.
>>
>> Option 1:
>> On RH, /var/run is the designated place for pid files (postfix being
>> the one exception, it keeps its pid files in /var/spool/postfix).
>> Just hardcode it everywhere to /var/run/opendkim/opendkim.pid if
>> opendkim writes it as a regular user, or /var/run/opendkim.pid if the
>> init script writes it (because init script running as root can write
>> there).
>
> I think I'm inclined to revert to this approach given the two options, if consensus agrees with your position.  We would just use the location provided by autoconf and be done with it; if the sysadmin sets a different value in opendkim.conf, he/she can edit the script as well.
>
> Any other opinions?

+1. The initial init script I submitted followed Todd's Option 1: I
just hard-coded these three variables in it:

DAEMON=/usr/local/sbin/opendkim
PID_FILE=/var/run/opendkim/opendkim.pid
CONF_FILE=/etc/opendkim.conf

But that's probably because I was (and still am) relatively new to
writing init scripts, so I didn't know of any other way to do it. :)
But hard-coded to the "normal" locations is fine with me - anyone who
has a valid reason to need them elsewhere will likely know how to edit
the script and/or conf file to find everything.

Also, I notice that on my system, the main binary is at
/usr/local/sbin/opendkim while the opendkim-genkey, -genzone, -stats,
-testadsp, and -testkey files are in /usr/local/bin. Should they all
be in /usr/local/bin and then have the init script hard coded to that
location for the daemon?

SteveJ
Received on Thu Jun 09 2011 - 22:59:39 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:33:10 PST