mersenneforum.org  

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

Reply
 
Thread Tools
Old 2009-07-13, 20:40   #1
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52×29 Posts
Default Howto start mprime automically for (Debian) Linux

It's quite easy to automate the start of mprime

- create a mprime directory in your home directory (in my example joblack - change it for your user name ...)
- create an executable file called mprime in /etc/init.d/

---
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

. /lib/lsb/init-functions


case "$1" in
start)
su joblack -c /home/joblack/mprime/mprime &
;;
stop)
killall mprime
;;

force-reload|restart)
killall mprime
su joblack -c /home/joblack/mprime/mprime &
;;

*)
echo "Usage: /etc/init.d/mprime {start|stop|restart|force-reload}"
exit 1
;;
esac

exit 0

---

create a link in /etc/rc2.d called

root root 16 2009-07-09 20:22 S30mprime -> ../init.d/mprime

(ln -s is your friend ).

Now you can start mprime with /etc/init.d/mprime start or it starts automatically if you get in init 2 (normal in debian and a lot of clones like kubuntu).

Other Linuxes have probably slightly different methods but it should be nearly the same ..
---

Suggestions and improvements are welcome

Last fiddled with by joblack on 2009-07-13 at 20:50
joblack is offline   Reply With Quote
Old 2009-11-09, 02:13   #2
BGK
 
Jan 2009

3 Posts
Default

Im no Linux expert but, couldnt you simply add the path to mprime in a file that gets checked at startup? For example, in ubuntu you could add /path/to/mprime in the /etc/rc.local file and it should be executed every time the computer starts.

If this would cause issues let me know...
BGK is offline   Reply With Quote
Old 2009-11-09, 22:33   #3
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52×29 Posts
Default

Quote:
Originally Posted by BGK View Post
Im no Linux expert but, couldnt you simply add the path to mprime in a file that gets checked at startup? For example, in ubuntu you could add /path/to/mprime in the /etc/rc.local file and it should be executed every time the computer starts.

If this would cause issues let me know...
Try it out - I'm not familiar with /etc/rc.local - seem to be something proprietary ... at least you have to make it executable.
joblack is offline   Reply With Quote
Old 2010-01-30, 13:46   #4
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

13258 Posts
Default

Quote:
Originally Posted by BGK View Post
Im no Linux expert but, couldnt you simply add the path to mprime in a file that gets checked at startup? For example, in ubuntu you could add /path/to/mprime in the /etc/rc.local file and it should be executed every time the computer starts.

If this would cause issues let me know...
You can do that but in that case it would run as root (which you obviously don't want).
joblack is offline   Reply With Quote
Old 2010-01-30, 15:22   #5
xilman
Bamboozled!
 
xilman's Avatar
 
May 2003
Down not across

270816 Posts
Default

Quote:
Originally Posted by joblack View Post
You can do that but in that case it would run as root (which you obviously don't want).
"man su"


Paul
xilman is offline   Reply With Quote
Old 2010-04-14, 21:00   #6
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52·29 Posts
Default

Quote:
Originally Posted by xilman View Post
"man su"

Paul
??
joblack is offline   Reply With Quote
Old 2010-04-14, 21:29   #7
sdbardwick
 
sdbardwick's Avatar
 
Aug 2002
North San Diego County

5×7×19 Posts
Default

man su
sdbardwick is online now   Reply With Quote
Old 2010-04-14, 22:03   #8
CADavis
 
CADavis's Avatar
 
Jul 2005
Des Moines, Iowa, USA

2528 Posts
Default

man means read the "user manual" and su means the superuser command
CADavis is offline   Reply With Quote
Old 2010-04-15, 06:42   #9
lfm
 
lfm's Avatar
 
Jul 2006
Calgary

42510 Posts
Default

An alternative that works well for me is:

echo "@reboot cd ~/gimps ; ./mprime & " | crontab -

Assuming you aren't already using crontab.
lfm is offline   Reply With Quote
Old 2010-06-22, 11:07   #10
musicworld1
 
Jun 2010

23 Posts
Default

i think you have error in this message.
musicworld1 is offline   Reply With Quote
Old 2010-06-22, 16:41   #11
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52×29 Posts
Default

Quote:
Originally Posted by CADavis View Post
man means read the "user manual" and su means the superuser command
I know but why did he write it.

By the way: su means 'substitute user' and not superuser (you can switch to another (normal) user as well).
joblack 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 12:58.

Tue May 26 12:58:28 UTC 2020 up 62 days, 10:31, 1 user, load averages: 1.44, 1.48, 1.51

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