mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   Command line options (https://www.mersenneforum.org/showthread.php?t=23781)

Gerard 2018-11-06 14:16

Command line options
 
I am looking for a list of all the allowed command line options for "mprime". I discovered the "-d" for output, that that is about it. Is there a list available or a way to have "mprime" display one?

Thanks :uncwilly:

irowiki 2018-11-06 16:15

First set:

[QUOTE]./mprime -h
Usage: mprime [-cdhmstv] [-aN] [-wDIR]
-c Contact the PrimeNet server, then exit.
-d Print detailed information to stdout.
-h Print this.
-m Menu to configure mprime.
-s Display status.
-t Run the torture test.
-v Print the version number.
-aN Use an alternate set of INI and output files (obsolete).
-wDIR Run from a different working directory.
[/QUOTE]


There may be more in either readme.txt or undoc.txt!

ssybesma 2019-07-24 17:27

[QUOTE=irowiki;499739]First set

There may be more in either readme.txt or undoc.txt![/QUOTE]


I didn't see any additional CLI options for mprime in either of those two files.

There are what I consider a couple essential CLI options missing from mprime.
One is continue and the other is exit.

I need some way to automate stopping and exiting mprime so I can reboot the Linux machine it's on and then restart and continue automatically after it comes back up.

It would be nice to do this once a day or once every other day to ensure the machine doesn't freeze up so I cannot remote into it. With 8 of these Linux devices I have (soon to be 12), that's a pain to do manually every day.

M344587487 2019-07-24 21:36

[QUOTE=ssybesma;522220]I didn't see any additional CLI options for mprime in either of those two files.

There are what I consider a couple essential CLI options missing from mprime.
One is continue and the other is exit.

I need some way to automate stopping and exiting mprime so I can reboot the Linux machine it's on and then restart and continue automatically after it comes back up.

It would be nice to do this once a day or once every other day to ensure the machine doesn't freeze up so I cannot remote into it. With 8 of these Linux devices I have (soon to be 12), that's a pain to do manually every day.[/QUOTE]
I'm being particularly lazy so treat these as hints. Does mprime close cleanly when you CTRL-C the process? If so you can send a SIGINT signal to mprime using the kill command to do the same thing : [url]https://bash.cyberciti.biz/guide/Sending_signal_to_Processes[/url]

To automate starting on boot and closing+rebooting periodically you can use cron: [url]https://en.wikipedia.org/wiki/Cron[/url]


I'd look into why your machines freeze before resorting to automating periodic reboots, is it that the ssh daemon crashes and doesn't automatically restart? There's probably (definitely) a way to have systemd automatically restart daemons that crash.

ssybesma 2019-07-24 22:06

[QUOTE=M344587487;522244]<snip> Does mprime close cleanly when you CTRL-C the process?
<snip>

<snip> is it that the ssh daemon crashes and doesn't automatically restart?[/QUOTE]

I suppose Ctrl-C will close mprime cleanly but I haven't tried it. I'd bet it works.

I don't know what caused the crash but I can try to find the correct log file. When that happened, not only could I not remote to the device but I could not ping the device either.

The crash only happened once so far out of 8 devices since I've reconfigured the Peppermint 9 Linux image I use to eliminate unneeded apps/services from running and to give the devices more RAM and swap file space. I decreased the "Nice" value all the way down to -20 on all devices after the crash happened because mprime is the only app I want running on all of them (besides TeamViewer) and it has to have the highest priority possible.

What I was hoping to do is prevent anymore prolonged downtime on any of the devices which is what happened before I reconfigured the image I used. I now have Teamviewer on all of them and it's easier for me to more quickly see when a device is unreachable since the device cannot be connected to or even pinged to, but I was hoping to not have to check them frequently.

ssybesma 2019-07-24 23:00

Sending a killall -SIGINT mprime merely stopped mprime but didn't cause it to exit.


I'll have to figure out how to get the app itself to exit because a PID (changes everytime) can't be used.

ssybesma 2019-07-25 02:26

The command "killall mprime" causes mprime to exit completely, while the command "killall -SIGINT mprime" causes mprime to stop but not exit.

Now, just have to figure out how to create a script to cause the device to reboot, but also to start up and CONTINUE mprime.

When you start mprime, it doesn't actually start where it left off until you hit '4' to continue. It's in stopped mode until you do that.

Prime95 2019-07-25 06:37

mprime -d

SELROC 2019-07-25 06:51

[QUOTE=ssybesma;522261]The command "killall mprime" causes mprime to exit completely, while the command "killall -SIGINT mprime" causes mprime to stop but not exit.

Now, just have to figure out how to create a script to cause the device to reboot, but also to start up and CONTINUE mprime.

When you start mprime, it doesn't actually start where it left off until you hit '4' to continue. It's in stopped mode until you do that.[/QUOTE]




The SIGINT signal is (keyboard) Interrupt, is just like you press control-C in the terminal. It is the signal that commands gpuowl to exit, but saving a checkpoint before.
The command [CODE]pkill -int <programname>[/CODE] kills gracefully all instances of programname.

ssybesma 2019-07-25 13:15

[QUOTE=SELROC;522273]The SIGINT signal is (keyboard) Interrupt, is just like you press control-C in the terminal. It is the signal that commands gpuowl to exit, but saving a checkpoint before.
The command [CODE]pkill -int <programname>[/CODE] kills gracefully all instances of programname.[/QUOTE]



The command "pkill -int mprime" only stops the program but does not exit I found. I guess '-int' is equivalent to '-SIGINT'.

I was able to get to the command line using "killall mprime" which is the same thing as manually entering 5 to exit.
If there's a more graceful way to get to the command line, perhaps I should string the two commands together?

ssybesma 2019-07-25 17:28

[QUOTE=Prime95;522271]mprime -d[/QUOTE]


The 'd' switch acts to continue mprime? That's what I'm looking for.


The readme.txt file says this about the 'd' switch and that's why I had to ask:


-d Prints more detailed information to stdout. Normally mprime does not send any output to stdout.

paulunderwood 2019-07-25 17:38

[QUOTE=ssybesma;522289]The 'd' switch acts to continue mprime? That's what I'm looking for.


The readme.txt file says this about the 'd' switch and that's why I had to ask:


-d Prints more detailed information to stdout. Normally mprime does not send any output to stdout.[/QUOTE]

I think just running [c]./mprime &[/c] will run it in the background. So if you want it start at boot use [c]crontab -e[/c] and make the entry:

[code]
@reboot cd /home/ssybesma/mprime/ && ./mprime &
[/code]

The next time the machine boots it will run mprime.

SELROC 2019-07-31 05:30

[QUOTE=ssybesma;522280]The command "pkill -int mprime" only stops the program but does not exit I found. I guess '-int' is equivalent to '-SIGINT'.

I was able to get to the command line using "killall mprime" which is the same thing as manually entering 5 to exit.
If there's a more graceful way to get to the command line, perhaps I should string the two commands together?[/QUOTE]


Sorry about that, the pkill -int is good for gpuowl which expects Control-C.


All times are UTC. The time now is 20:40.

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