- Add support for passing PID file name on command line to make it easier to keep system init and daemon configuration in sync.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
- Add new expand option to setup.py so various file system locations can be
|
||||
specified at build/install time rather than being hard coded
|
||||
- Install openrc init file for Gentoo and other openrc users
|
||||
- Add support for passing PID file name on command line to make it easier to
|
||||
keep system init and daemon configuration in sync
|
||||
|
||||
1.1.0 2019-04-12
|
||||
- Add SubDomains option to enable signing for sub-domains (LP: #1811535)
|
||||
|
||||
@@ -347,11 +347,16 @@ def main():
|
||||
privateEd25519 = False
|
||||
configFile = '/usr/local/etc/dkimpy-milter.conf'
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] in ('-?', '--help', '-h'):
|
||||
print('usage: dkimpy-milter [<configfilename>]')
|
||||
if (sys.argv[1] in ('-?', '--help', '-h')) or len(sys.argv) == 3 or \
|
||||
(len(sys.argv) == 4 and sys.argv[2] != '-P'):
|
||||
print('usage: dkimpy-milter [<configfilename>] [-P <pidfile>]')
|
||||
sys.exit(1)
|
||||
configFile = sys.argv[1]
|
||||
milterconfig = config._processConfigFile(filename=configFile)
|
||||
if len(sys.argv) == 4:
|
||||
if sys.argv[2] == '-P':
|
||||
# Command line PID file argument overrides config file
|
||||
milterconfig['PidFile'] = sys.argv[3]
|
||||
if milterconfig.get('Syslog'):
|
||||
facility = eval("syslog.LOG_{0}"
|
||||
.format(milterconfig.get('SyslogFacility').upper()))
|
||||
|
||||
@@ -7,7 +7,7 @@ required_files="${CONFFILE}"
|
||||
|
||||
command="/usr/local/bin/dkimpy-milter"
|
||||
pidfile="/run/dkimpy-milter/${RC_SVCNAME}.pid"
|
||||
command_args="-P ${pidfile} ${CONFFILE}"
|
||||
command_args="${CONFFILE} -P ${pidfile}"
|
||||
|
||||
depend() {
|
||||
use dns logger net
|
||||
|
||||
@@ -7,7 +7,7 @@ required_files="${CONFFILE}"
|
||||
|
||||
command="@BINDIR@/dkimpy-milter"
|
||||
pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
|
||||
command_args="-P ${pidfile} ${CONFFILE}"
|
||||
command_args="${CONFFILE} -P ${pidfile}"
|
||||
|
||||
depend() {
|
||||
use dns logger net
|
||||
|
||||
@@ -6,7 +6,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
PIDFile=/run/dkimpy-milter/dkimpy-milter.pid
|
||||
ExecStart=/usr/local/bin/dkimpy-milter /usr/local/etc/dkimpy-milter/dkimpy-milter.conf
|
||||
ExecStart=/usr/local/bin/dkimpy-milter /usr/local/etc/dkimpy-milter/dkimpy-milter.conf -P /run/dkimpy-milter/dkimpy-milter.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -6,7 +6,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
PIDFile=@RUNSTATEDIR@/dkimpy-milter.pid
|
||||
ExecStart=@BINDIR@/dkimpy-milter @CONFDIR@/dkimpy-milter.conf
|
||||
ExecStart=@BINDIR@/dkimpy-milter @CONFDIR@/dkimpy-milter.conf -P @RUNSTATEDIR@/dkimpy-milter.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user