mersenneforum.org  

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

Reply
 
Thread Tools
Old 2004-09-28, 05:55   #1
xode
 
Sep 2004

7 Posts
Default Automatically starting mprime.

I want mprime to automatically start when a specific user (say userx) logs in but not when linux as a whole is started. What scripts need to be modified and how. Please provide details. I am running Mandrake 9.0.
xode is offline   Reply With Quote
Old 2004-09-28, 07:38   #2
garo
 
garo's Avatar
 
Aug 2002
Termonfeckin, IE

1010110000012 Posts
Default

What shell are you running? The easiest way is to add it to the rc script - say .bashrc or .cshrc.
garo is offline   Reply With Quote
Old 2004-09-29, 03:14   #3
xode
 
Sep 2004

7 Posts
Default

I'm guessing that it is bash, since that is what the terminal consoles identify themselves as. However, all of it runs in a GUI format, which, as far as I currently know, is completely independent of any shells. George Woltman said something about modifying rc.local. What is that, what does it do and how can you safely modify it? Please provide details.
xode is offline   Reply With Quote
Old 2004-09-29, 22:35   #4
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

Quote:
Originally Posted by xode
However, all of it runs in a GUI format, which, as far as I currently know, is completely independent of any shells.
A simple-minded approach would be to start mprime when the X-windows session starts and stop it when it ends. That would not allow for the possibility of console or remote logins, or multiple simultaneous logins by the same user, but if that is OK then you just need to modify the .Xsession script in the user's home directory (or create it if it doesn't exist). The following works on my system (Debian), in principle it should work on any system running X-windows, but in practice some distributions bypass the .Xsession script. If it doesn't work then maybe someone who has a Mandrake system could help. Change x-window-manager and MPRIMEDIR to suit your system. The script may also be called .xsession.
Code:
#!/bin/sh
MPRIMEDIR=$HOME/gimps
# Start mprime in the background.
mprime -b -W$MPRIMEDIR
# Start the window manager.
x-window-manager
# Stop mprime.
kill `grep -i "^Pid=" $MPRIMEDIR/local.ini | cut -d= -f2`
geoff is offline   Reply With Quote
Old 2004-09-30, 02:52   #5
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

757710 Posts
Default

Code:
kill `grep -i "^Pid=" $MPRIMEDIR/local.ini | cut -d= -f2`
You could use "killall" for that, I think...
Xyzzy is offline   Reply With Quote
Old 2004-09-30, 18:57   #6
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2BE16 Posts
Default

Quote:
Originally Posted by xode
I'm guessing that it is bash, since that is what the terminal consoles identify themselves as. However, all of it runs in a GUI format, which, as far as I currently know, is completely independent of any shells. George Woltman said something about modifying rc.local. What is that, what does it do and how can you safely modify it? Please provide details.
I just stuck it in rc.local. This is the Linux startup script. I edited it using the standard RHL9 text editor. Just CD to the mprime directory and do mprime -B. Before you stick it in rc.local, work out the exact commands in the bash prompt.
PrimeCruncher is offline   Reply With Quote
Old 2004-10-01, 04:27   #7
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13·89 Posts
Default

rc.local is the usual place to start mprime at boot, but he wanted to start it just when a particular user logged in. (And I assume stop it when that user logged out).
geoff is offline   Reply With Quote
Old 2004-10-20, 12:09   #8
rkolasie
 

22·2,143 Posts
Default

For starting mprime i use crontab (in case something kills my mprime), and screen (to see how much work is done).

Crontab job is set as:
Code:
10/* * * * * /path/to/my/mpcheck > /dev/null 2>&1
And my mpcheck script is:
Code:
#!/bin/bash

out=`ps aux | grep mprime | grep -v grep | wc -l`

[if $out -eq 0 ]
then
    cd /path/to/my/mprime/
    screen -m -d ./mprime -d
fi
  Reply With Quote
Old 2004-10-20, 14:47   #9
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

7,577 Posts
Default

Mprime has a lock file so there is no need to check if it is running before you start it again...
Xyzzy is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting mprime at boot daxmick PrimeNet 18 2019-03-17 01:12
Automatically updating factordb chris2be8 FactorDB 9 2012-05-03 10:20
Automatically start Prime95 on the mac koekie Software 2 2012-02-06 15:39
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

All times are UTC. The time now is 16:37.

Thu Aug 6 16:37:32 UTC 2020 up 20 days, 12:24, 1 user, load averages: 1.22, 1.56, 1.81

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.