mersenneforum.org  

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

Reply
 
Thread Tools
Old 2018-01-04, 21:52   #1
daxmick
 
daxmick's Avatar
 
Feb 2014

22×3×7 Posts
Default Starting mprime at boot

Us Linux folk have options on how our system boots. That said, most modern flavors of Linux have converted to something called "systemd". This boot "manager" starts daemons differently than us grey beards are used to. So, I thought I'd document what/how I've done to get my systemd machine (aka Ubuntu 17.10) to run mprime at bootup.

Note: Use these steps after you have ran mprime -m to configure your system's profile.

First, change directory to the location where the boot scripts are stored:
Code:
cd /etc/systemd/system
Create a new file. I called mine mprime.service:
Code:
sudo nano mprime.service
Insert the following into that file:
Code:
[Unit]
Description=GIMPS mprime service
After=network.target

[Service]
Type=simple
User=daxm
WorkingDirectory=/home/daxm/mersenne/mprime
ExecStart=/home/daxm/mersenne/mprime/mprime -d
Restart=on-abort

[Install]
WantedBy=multi-user.target
Change the "User", "WorkingDirectory" and "ExecStart" to lines to be what works for your setup and where you installed mprime.

Save that file by typing control-x press y and then press ENTER.

Change the file to be executable with this command:
Code:
sudo chmod 755 mprime.service
Now that the file exists and is executable we need to let the systemd process know to run it at bootup. Issue the following command to do so:
Code:
sudo systemctl enable mprime.service
Issue the following command to manually start this service.
Code:
systemctl start mprime.service
Verify it loaded correctly with this command:
Code:
sudo systemctl status mprime.service
Reboot your box. Then rerun the verification commands to see if your mprime service is running!

If you modify your mprime.service file. You'll need to issue the following command to reload systemd with the changes:
Code:
sudo systemctl daemon-reload
Happy GIMPS'ing!
daxmick is offline   Reply With Quote
Old 2018-01-04, 23:20   #2
daxmick
 
daxmick's Avatar
 
Feb 2014

5416 Posts
Default

I forgot to attribute my learning about how to build a Unit file. I used the following website:
https://www.devdungeon.com/content/c...-service-files
daxmick is offline   Reply With Quote
Old 2018-01-04, 23:23   #3
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Surely the final command could be replaced with something like systemctl reload mprime.service? So that systemctl doesn't reload *all* running services, rather just the one you want.
Dubslow is offline   Reply With Quote
Old 2018-01-04, 23:40   #4
daxmick
 
daxmick's Avatar
 
Feb 2014

22·3·7 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Surely the final command could be replaced with something like systemctl reload mprime.service? So that systemctl doesn't reload *all* running services, rather just the one you want.
Good catch. I didn't see that. (I was caught up in formatting the post message.) Doh! However, reload isn't an option. It's restart. :-)

Code:
sudo systemctl restart mprime.service

Last fiddled with by daxmick on 2018-01-04 at 23:42
daxmick is offline   Reply With Quote
Old 2018-01-04, 23:43   #5
daxmick
 
daxmick's Avatar
 
Feb 2014

22·3·7 Posts
Default

As an aside, you can use the following command to look at the "log" for this service:
Code:
journalctl -u mprime.service
daxmick is offline   Reply With Quote
Old 2018-01-05, 01:47   #6
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

160658 Posts
Default

Quote:
Originally Posted by daxmick View Post
Doh! However, reload isn't an option. It's restart. :-)

Code:
sudo systemctl restart mprime.service
Ah yes, I forgot that mprime isn't such sophisticated software as, say, an HTTP server or ssh daemon
Dubslow is offline   Reply With Quote
Old 2018-01-05, 19:31   #7
TheJudger
 
TheJudger's Avatar
 
"Oliver"
Mar 2005
Germany

3×7×53 Posts
Default

There is no need to set the executable bit on mprime.service.

Oliver
TheJudger is offline   Reply With Quote
Old 2018-01-05, 19:33   #8
daxmick
 
daxmick's Avatar
 
Feb 2014

22·3·7 Posts
Default

Quote:
Originally Posted by TheJudger View Post
There is no need to set the executable bit on mprime.service.

Oliver
To be honest, I wasn't sure. It makes sense that you wouldn't but I did what I learned. :-)
daxmick is offline   Reply With Quote
Old 2018-01-05, 19:54   #9
heliosh
 
Oct 2017
++41

7D16 Posts
Default

Thanks for sharing. This could be in the mprime package.
heliosh is offline   Reply With Quote
Old 2018-01-05, 21:14   #10
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

5×353 Posts
Default

Quote:
Originally Posted by heliosh View Post
Thanks for sharing. This could be in the mprime package.
Don't forget the Slackware users who still have init!
Nick is offline   Reply With Quote
Old 2018-01-05, 21:16   #11
daxmick
 
daxmick's Avatar
 
Feb 2014

22×3×7 Posts
Default

Quote:
Originally Posted by Nick View Post
Don't forget the Slackware users who still have init!
Wow. Slackware. Now there is an OS that I haven't run in... 15 years.
daxmick is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk starting to go Chuck Hardware 8 2013-05-20 06:40
Starting new bases MrOzzy Conjectures 'R Us 104 2010-03-18 22:11
mprime starting spaz Software 9 2009-05-03 06:41
starting mprime at boot time on a multicore pc tha Software 6 2008-10-15 23:38
Automatically starting mprime. xode Software 8 2004-10-20 14:47

All times are UTC. The time now is 02:52.


Fri Dec 9 02:52:25 UTC 2022 up 113 days, 20 mins, 0 users, load averages: 1.26, 1.40, 1.36

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.

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