[Mailman-Users] openrc init.d script

Ruben Safir mrbrklyn at panix.com
Fri Oct 6 16:59:01 EDT 2017


I wrote an init.d script for mailman for openrc and I have bug I can't track down in mailmanctl

when I run the script it feeds me this:


www3 ~]# /etc/init.d/mailman start
Go find the config
Yo - go find /usr/lib/mailman/Mailman/mm_cfg.py
 * Starting mailman ...
PIDFILE /var/lib/mailman/data/master-qrunner.pid
PIDFILE /usr/lib/mailman/bin/mailmanctl
 * start-stop-daemon: fopen `/var/lib/mailman/data/master-qrunner.pid': No such file or directory
 * Detaching to start `/usr/lib/mailman/bin/mailmanctl' ...
Starting Mailman's master qrunner.                                                                                            [ ok ]
[www3 ~]# Traceback (most recent call last):
  File "/usr/lib/mailman/bin/mailmanctl", line 556, in <module>
    main()
  File "/usr/lib/mailman/bin/mailmanctl", line 412, in main
    fp = open(mm_cfg.PIDFILE, 'w')
IOError: [Errno 13] Permission denied: '/var/lib/mailman/data/master-qrunner.pid'


the file permissions look right:
[www3 ~]# ls -al /var/lib/mailman/
total 48
drwxrwsr-x 10 mailman mailman 4096 Oct 25  2015 .
drwxr-xr-x 28 root    root    4096 Oct  2 16:03 ..
drwxrwsr-x  4 root    mailman 4096 Oct  8  2014 archives
-rw-------  1 mailman mailman   27 Oct 25  2015 .bash_history
drwxrwsr-x  2 root    mailman 4096 Oct  6 16:28 data
drwxrwsr-x  5 root    mailman 4096 Apr  2  2017 lists
drwxrwsr-x  3 mailman mailman 4096 Oct 20  2015 .local
drwxrwsr-x  2 root    mailman 4096 Oct  6 16:30 locks
drwxrwsr-x  2 root    mailman 4096 Mar  5  2016 logs
drwxrwsr-x 12 root    mailman 4096 Jan  1  2016 qfiles
drwxrwsr-x  2 root    mailman 4096 Oct  8  2014 spam
-rw-------  1 mailman mailman  601 Oct 25  2015 .viminfo

[www3 ~]# ls -al /var/lib/mailman/data/
total 92
drwxrwsr-x  2 root    mailman  4096 Oct  6 16:28 .
drwxrwsr-x 10 mailman mailman  4096 Oct 25  2015 ..
-rw-r-----  1 root    mailman    41 Jan  1  2016 adm.pw
-rw-rw----  1 mailman mailman  2642 Apr 15 12:47 aliases
-rw-r-----  1 mailman mailman 12288 Apr 15 12:52 aliases.db
-rw-rw----  1 mailman mailman 34742 Mar 16  2017 bounce-events-09990.pck
-rw-rw-r--  1 mailman mailman  2390 Jun 11 03:13 heldmsg-hangout-122.pck
-rw-r--r--  1 root    mailman    10 Jan  1  2016 last_mailman_version
-rw-r--r--  1 root    mailman     5 Oct  6 16:28 master-qrunner.pid
-rw-r--r--  1 root    mailman 14100 Oct  8  2014 sitelist.cfg

And what really puzzles me is the error line on the trace

/usr/lib/mailman/bin/mailmanctl
  omask = os.umask(6)
        try:
            fp = open(mm_cfg.PIDFILE, 'w')
            print >> fp, os.getpid()
            fp.close()
        finally:
            os.umask(omask)

That file, mm_cfg.PIDFILE doesn't exist anywhere on the system.

When you run it from the command line, it works without complaining.

I think there is a problem with the permissions being created for the pid file.

I would really prefer the pid file to be put in /var/run

 
-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013


More information about the Mailman-Users mailing list