mersenneforum.org  

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

Reply
 
Thread Tools
Old 2018-11-02, 18:26   #23
irowiki
 
Sep 2018

4516 Posts
Default

Quote:
Originally Posted by chalsall View Post
Or, to avoid any dependencies, I use this:
Code:
@reboot ~/prime/mprime -d </dev/null >>~/prime/mprime.log 2>/dev/null &
Then, if I want, I can log into the machine and "tail -f ~/prime/mprime.log".
Do you setup a logrotate with this?
irowiki is offline   Reply With Quote
Old 2018-11-02, 18:43   #24
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

9,767 Posts
Default

Quote:
Originally Posted by irowiki View Post
Do you setup a logrotate with this?
Nah... I like to have the file around for analysis in the case of a mis-match or other issues (I only do P-1'ing or DC'ing). And on one of my fastest machines (with frequent logging) it only generates about 10 MB a month; nothing now-a-days....
chalsall is offline   Reply With Quote
Old 2018-11-04, 07:57   #25
irowiki
 
Sep 2018

1058 Posts
Default

Quote:
Originally Posted by chalsall View Post
Nah... I like to have the file around for analysis in the case of a mis-match or other issues (I only do P-1'ing or DC'ing). And on one of my fastest machines (with frequent logging) it only generates about 10 MB a month; nothing now-a-days....
Well thanks a bunch either way, linux has been a hobby of mine for many years, and there's many things I have no idea of what to do.

Up until now I'd log into one of my linux boxes, kill mprime, and restart it in the SSH session so I could see how it was doing!
irowiki is offline   Reply With Quote
Old 2018-11-04, 08:24   #26
SELROC
 

60638 Posts
Default

Quote:
Originally Posted by ET_ View Post
Five years have passed since the last message on topic.

Now, having Ubuntu, and wanting to run mprime in background (./mprime &) and unmanned at each restart of the computer, especially after a power blackout (quite frequent in this season in Italy), what script would you suggest?

I have seen flavours of init.d, crontab and rc.local, with pros and cons, and would appreciate your actual hint.

Thank you



With "systemd" systems like Debian and Ubuntu you should write something like that in a file named /etc/systemd/system/mprime.service :


Code:
[Unit]
Description=Mprime Service
After=network.target


[Service]
Type=simple
Restart=always
ExecStart=/path/to/mprime/mprime -d

[Install]
WantedBy=multi-user.target
and then issue some commands:

Code:
systemctl daemon-reload
and

Code:
systemctl enable mprime.service
systemctl start mprime.service
  Reply With Quote
Old 2018-11-05, 11:18   #27
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018

5·7 Posts
Default Run MPrime after a specified idle time

This install script automatically sets up crontab to run MPrime after a specified idle time: https://www.mersenneforum.org/showthread.php?t=23486

It uses this very long command:
Code:
crontab -l | { cat; echo "* * * * * if who -s | awk '{ print \$2 }' | (cd /dev && xargs -r stat -c '\%U \%X') | awk '{if ('\"\$(date +\%s)\"'-\$2<$TIME) { print \$1\"\t\"'\"\$(date +\%s)\"'-\$2; ++count }} END{if (count>0) { exit 1 }}' > /dev/null; then pgrep mprime > /dev/null || (cd $DIR && nohup ./mprime &); else pgrep mprime > /dev/null && killall mprime; fi"; } | crontab -
See here for context: https://github.com/tdulcet/Distribut.../mprime.sh#L66
tdulcet is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
mprime 28.9 - occassional segmentation fault during start pessoft Software 0 2016-06-13 20:58
Seeking help on packaging mprime for Debian alexvong1995 Linux 3 2015-05-13 12:49
Linux (debian/grub) help LaurV Linux 10 2015-04-24 15:39
HowTo: Switch to Linux to finish factoring Batalov Linux 25 2009-09-18 06:38
Debian package of mprime Matt Linux 1 2007-02-22 22:36

All times are UTC. The time now is 18:15.


Sun Aug 1 18:15:40 UTC 2021 up 9 days, 12:44, 0 users, load averages: 2.85, 3.03, 2.70

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.