mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2018-11-02, 14:18   #1
Gerard
 
Gerard's Avatar
 
Oct 2018
Stem, NC (USA)

32 Posts
Question Create "PID" file

I am running FreeBSD 11.2 / amd64 with the latest version of mprime for that system.

I have discovered that "mprime" does not create a "PID" file. I am starting "mprime" with a startup script in the "rc.d" directory. It would be easier if "mprime" actually created a "PID" file.

I am wondering if it is something that might be considered in future versions?

Thanks!
Gerard is offline   Reply With Quote
Old 2018-11-02, 18:32   #2
irowiki
 
Sep 2018

3·23 Posts
Default

You could try creating it like so:

https://superuser.com/questions/2384...om-bash-script


I had to do something similar once on my webserver to get monit to monitor a process that didn't create a pid file either.

Speaking of that... I wonder if I could use monit to start/restart mprime...

Last fiddled with by irowiki on 2018-11-02 at 18:35
irowiki is offline   Reply With Quote
Old 2018-11-02, 19:34   #3
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

35·31 Posts
Default

I'll look into adding this for the next release.
Prime95 is offline   Reply With Quote
Old 2018-11-03, 08:02   #4
Gerard
 
Gerard's Avatar
 
Oct 2018
Stem, NC (USA)

10012 Posts
Thumbs up

Quote:
Originally Posted by Prime95 View Post
I'll look into adding this for the next release.

Great idea. It really doesn't take too much programming code to accomplish it and it does make running and monitoring programs easier.


Gerard is offline   Reply With Quote
Old 2018-11-03, 12:16   #5
GP2
 
GP2's Avatar
 
Sep 2003

5×11×47 Posts
Default

The file local.txt gets updated with a Pid= line when mprime runs. Would that be sufficient?
GP2 is offline   Reply With Quote
Old 2018-11-06, 14:41   #6
Gerard
 
Gerard's Avatar
 
Oct 2018
Stem, NC (USA)

32 Posts
Post

Quote:
Originally Posted by GP2 View Post
The file local.txt gets updated with a Pid= line when mprime runs. Would that be sufficient?

Not really. Programs like https://mmonit.com/monit/ use the PID file to determine if the application is running. It is also used in "rc" startup scripts in FreeBSD. In FreeBSD, "man 3 pidfile" gives a good bit of info on how to create and use the PID file.
Gerard is offline   Reply With Quote
Old 2018-11-06, 16:19   #7
irowiki
 
Sep 2018

3·23 Posts
Default

I'll dig up one of my monit pid creation scripts from my webserver for you and post it when I can.
irowiki is offline   Reply With Quote
Old 2018-11-06, 16:58   #8
Gerard
 
Gerard's Avatar
 
Oct 2018
Stem, NC (USA)

32 Posts
Wink

Quote:
Originally Posted by irowiki View Post
I'll dig up one of my monit pid creation scripts from my webserver for you and post it when I can.

I have done that myself; however, it is not really the best idea. The program that is started should create the PID and remove it when it terminates. It should also check for any stale PID files and remove them upon startup. It is for those very reasons that I abandoned that idea. I am not looking to reinvent the wheel here.
Gerard is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" wildrabbitt Miscellaneous Math 11 2015-03-06 08:17
"ERROR: Unable to open spool file." no1hasdisid Software 1 2013-05-06 05:24
what's the point of "Iterations between results file outputs"? ixfd64 Software 3 2012-08-01 18:55
mprime on FC4 on x86_64 : "cannot execute binary file" T.Rex Software 9 2006-09-01 21:21
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 03:32.


Sun Aug 1 03:32:02 UTC 2021 up 8 days, 22:01, 0 users, load averages: 1.08, 1.22, 1.37

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.