mersenneforum.org  

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

Reply
 
Thread Tools
Old 2021-03-14, 19:02   #1
drkirkby
 
"David Kirkby"
Jan 2021
Althorne, Essex, UK

26·7 Posts
Default How can I start mprime at book on Linux?

I'm trying to get mprime to start to run when a linux machine is booted, but can't seem to get this to work. Any help appreciated.

I have two operating systems of interest - Centos 7.8 (same as Redhat 7.8) and Debian 10. Both use systemd to start processes, but I can't seem to get it to work.

I found this web page
https://wiki.debian.org/systemd/Services
on using systemd. I want to start primed as user "gimps" in the directory /home/gimps, but even my attempt to not mess with the directory and username fail. The default is to start as root in the directory /root.

I have the following in /etc/systemd/system/mprime.service
Code:
[Unit]
Description=GIMPS
After=network.target remote-fs.target nss-lookup.target


[Service]
Type=simple  
Restart=always
WorkingDirectory=/home/gimps 

ExecStart=/usr/local/bin/mprime  

[Install]
WantedBy=multi-user.target
root@4-CORE:~# cat  /etc/systemd/system/mprime.service
[Unit]
Description=GIMPS
After=network.target remote-fs.target nss-lookup.target


[Service]
Type=simple  
Restart=always
WorkingDirectory=/home/gimps 

ExecStart=/usr/local/bin/mprime  

[Install]
WantedBy=multi-user.target
Then when I try to start it, this fails.



Code:
root@4-CORE:~# systemctl daemon-reload
root@4-CORE:~# systemctl enable mprime.service
root@4-CORE:~# systemctl start mprime.service

root@4-CORE:~# systemctl status  mprime.service
● mprime.service - GIMPS
   Loaded: loaded (/etc/systemd/system/mprime.service; enabled; vendor preset: e
   Active: failed (Result: signal) since Sun 2021-03-14 19:55:57 CET; 27s ago
  Process: 3841 ExecStart=/usr/local/bin/mprime (code=killed, signal=SEGV)
 Main PID: 3841 (code=killed, signal=SEGV)

Mar 14 19:55:57 4-CORE systemd[1]: mprime.service: Service RestartSec=100ms expi
Mar 14 19:55:57 4-CORE systemd[1]: mprime.service: Scheduled restart job, restar
Mar 14 19:55:57 4-CORE systemd[1]: Stopped GIMPS.
Mar 14 19:55:57 4-CORE systemd[1]: mprime.service: Start request repeated too qu
Mar 14 19:55:57 4-CORE systemd[1]: mprime.service: Failed with result 'signal'.
Mar 14 19:55:57 4-CORE systemd[1]: Failed to start GIMPS.

I've tried starting mprime as a "simple" service, as well as "mprime -d" as forking. Neither work for me. Can anyone help me out?
drkirkby is offline   Reply With Quote
Old 2021-03-15, 09:02   #2
S485122
 
S485122's Avatar
 
"Jacob"
Sep 2006
Brussels, Belgium

2·3·7·43 Posts
Default

Quote:
Originally Posted by drkirkby View Post
I'm trying to get mprime to start to run when a linux machine is booted, but can't seem to get this to work. Any help appreciated.
...
WorkingDirectory=/home/gimps

ExecStart=/usr/local/bin/mprime
...
AFAIK mprime works if the executable and the accompanying files are all in one folder. If one wants to use different folders one must add specific entries in the mprime configuration files.

I would try again after moving all the mprime files to the /home/mprime folder. If you want another configuration you should delve in the undoc.txt file.

Jacob
S485122 is offline   Reply With Quote
Old 2021-03-15, 10:01   #3
M344587487
 
M344587487's Avatar
 
"Composite as Heck"
Oct 2017

37D16 Posts
Default

You can learn systemd daemons if you like, but it's probably easier to just use a cron job, which on systemd systems will be a systemd service: https://www.cyberciti.biz/faq/linux-...system-reboot/


Even if you wanted to do it the "native" systemd way you'd probably use the cron replacement called timers instead of rolling your own daemon: https://opensource.com/article/20/7/systemd-timers
M344587487 is offline   Reply With Quote
Old 2021-03-20, 15:38   #4
UBR47K
 
UBR47K's Avatar
 
Aug 2015

10001002 Posts
Default

If you want this to work without root, place the following into ~/.config/systemd/user/mprime.service for the user that will run mprime.
Code:
[Unit]
Description=Prime95 client

[Service]
Type=simple
ExecStart=/usr/local/bin/mprime -d -w%h/mprime-data
KillMode=process
KillSignal=SIGINT
Restart=always

[Install]
WantedBy=multi-user.target
Afterwards, still logged in as the mprime user, enable this at boot with:
Code:
systemctl enable --user mprime.service
Lastly, as root, enable lingering for that particular user with:
Code:
loginctl enable-linger <user>
UBR47K is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto start mprime automically for (Debian) Linux joblack Software 26 2018-11-05 11:18
mprime 28.9 - occassional segmentation fault during start pessoft Software 0 2016-06-13 20:58
Installing mprime on Linux lidocorc Software 9 2009-11-06 20:59
mprime and linux Echoblade Information & Answers 3 2007-06-24 22:28
MPrime on Linux optim Software 13 2003-12-06 04:27

All times are UTC. The time now is 06:01.


Sat May 21 06:01:48 UTC 2022 up 37 days, 4:03, 0 users, load averages: 1.62, 1.83, 1.78

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔