Great 022 mystery solved ... now how to fix

"Ken McDonell" <[email protected]> Fri, 27 Jan 2017 17:17:08 +1100
Newsgroups gmane.comp.sysutils.pcp
Message-ID <[email protected]>
For sometime qa/022 has been sporadically failing on some systems.

This is a regression (qa/022 has existed since the epoch), but I've never been able to track it down.

Now I have a smoking bazooka ... systemd autorestart.

If systemd configured so that Restart=always, then note the following

kenj@vm31:~$ sudo /usr/share/pcp/lib/pcp start
Waiting for pmcd to terminate ...
Starting pmcd ... 
Starting pmlogger ... 
kenj@vm31:~$ [Fri Jan 27 17:11:37] pmcd(24211) Error: OpenRequestSocket(44321, INADDR_ANY, inet) __pmBind: Address already in use
[Fri Jan 27 17:11:37] pmcd(24211) Error: pmcd may already be running
[Fri Jan 27 17:11:38] pmcd(24211) Error: OpenRequestSocket(44321, INADDR_ANY, ipv6) __pmBind: Address already in use
[Fri Jan 27 17:11:38] pmcd(24211) Error: pmcd may already be running
[Fri Jan 27 17:11:39] pmcd(24211) Error: OpenRequestSocket(0, /var/run/pcp/pmcd.socket, unix) __pmBind: Address already in use
[Fri Jan 27 17:11:39] pmcd(24211) Error: pmcd may already be running
[Fri Jan 27 17:11:39] pmcd(24211) Error: pmcd: can't open any request ports, exiting
[Fri Jan 27 17:11:39] pmcd(24211) Error: pmcd not started due to errors!

And it gets worse ...

kenj@vm31:~$ pcp
Performance Co-Pilot configuration on vm31.localdomain:

 platform: Linux vm31.localdomain 4.4.8-300.fc23.x86_64+debug #1 SMP Wed Apr 20 16:42:11 UTC 2016 x86_64
 hardware: 2 cpus, 1 disk, 1 node, 972MB RAM
 timezone: AEDT-11
 services: pmcd
     pmcd: Version 3.11.8-3, 10 agents, 1 client
     pmda: root pmcd proc xfs sample sampledso linux mmv jbd2 simple
 pmlogger: primary logger: /var/log/pcp/pmlogger/vm31.localdomain/20170127.17.11
kenj@vm31:~$ pcp -h unix:
pcp-summary: Cannot connect to PMCD on host "unix:": No such file or directory
kenj@vm31:~$ ls -l /var/run/pcp/pmcd*
-r--r--r-- 1 root root 5 Jan 27 17:11 /var/run/pcp/pmcd.pid

Note there is no /var/run/pcp/pmcd.socket socket, which is why -h unix: fails, which is why qa/022 fails!

Now the open question (for which I have no clue) is what is the CORRECT way for out "init" script to do a "stop and then start" without systemd seeing the stop and trying a start ... the two start operations racing is the reason for the error messages above and the cleanup for the loser nukes the socket in /var/run/pcp/pmcd.socket.

Setting Restart=no and forcing a daemon-reload for systemctl makes our stop and then start operation 100% robust again ... so I'm sure of the diagnosis, but would love to know what's the officially sanctioned cure.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#15042): https://groups.io/g/pcp/message/15042
View All Messages In Topic (1): https://groups.io/g/pcp/topic/4255730
Mute This Topic: https://groups.io/mt/4255730?uid=174580
New Topic: https://groups.io/g/pcp/post
-=-=-
pcp mailing list
[email protected]
https://groups.io/g/pcp/messages
-=-=-
Change Your Subscription: https://groups.io/g/pcp/editsub?uid=174580
Group Home: https://groups.io/g/pcp
Contact Group Owner: [email protected]
Terms of Service: https://groups.io/static/tos
Unsubscribe: https://groups.io/g/pcp/leave/354243/563757577/xyzzy
-=-=-=-=-=-=-=-=-=-=-=-