Re: Mersenne: Prime95 on linux, a tech question

1999-06-07 Thread Nick Craig-Wood

On Sun, Jun 06, 1999 at 10:58:13AM -0700, [EMAIL PROTECTED] wrote:
> First of all put the following at the bottom of your /etc/rc.d/rc.local
> file:
> 
> /Your/path/to/mprime/mprime &

I'd recommend starting it as a particular user not as root.  I like to
generalise this and give the user a script file to run at boot, eg put
this at the end of rc.local

# start the users' background jobs off

if [ -f ~user/.rc.local ]; then
su - user -c ./.rc.local &
fi

And then something like this into ~user/.rc.local

#!/bin/sh
(cd ~/mprime ; ./mprime -d >>out.txt 2>&1 &)

> To start it from the command line do this:
> 
> nohup /Your/path/to/mprime/mprime &

Nohup shouldn't be necessary with the & if you are using a modern
shell (eg bash) though it certainly is necessary on some old /bin/sh's

-- 
|- Nick Craig-Wood -- http://www.axis.demon.co.uk/ -- [EMAIL PROTECTED] -|

Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-06 Thread Pierre Abbat

On Sun, 06 Jun 1999, [EMAIL PROTECTED] wrote:
> I wouldn't recommend the "> /dev/null" command. If you start it remotely,
> the stdout and stderr usually (but not always) go to e-mail. This way you
> can still see the output and not lose any critical messages...

I pipe the output to a program that keeps the last 25 lines in a file.

phma
---
[phma@littlecat bin]$ cat runtail
#!/usr/bin/tclsh

# Reads standard input and writes the last n lines to a file.
# Usage: runtail n file

proc outem {} {
  global n ;
  global file;
  global line ;
  set f [open $file w];
  for {set i 0} {$i < $n} {incr i} {puts $f $line($i)};
  close $f;
  }

proc scroll {str} {
  global n;
  global line;
  for {set i 1} {$i < $n} {incr i} {set line([expr $i - 1]) $line($i)};
  set line([expr $n - 1]) $str;
  }

foreach {n file} $argv {}
for {set i 0} {$i < $n} {incr i} {set line($i) ""}

while {1} {
  scroll [gets stdin];
  outem;
  }


Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-06 Thread poke


I wouldn't recommend the "> /dev/null" command. If you start it remotely,
the stdout and stderr usually (but not always) go to e-mail. This way you
can still see the output and not lose any critical messages...

-Chuck

On Thu, 3 Jun 1999, Philip Heede wrote:

> On Thu, 3 Jun 1999 12:03:25 +0200, [EMAIL PROTECTED] wrote:
> 
>  >Now I can start mprime remotely through telnet - which works fine.
>  >But as soon as I quit the particular telnet-session  - mprime quits 
>  >too.
>  >Anybody can give me a hint how do keep mprime running?
> 
> Sure..
> I run mprime remotely on a server by using a simple 
> "./mprime > /dev/null &" command. The "> /dev/null" suppresses output and 
> the "&" makes MPrime run in the background. If you want output in a file 
> simply replace "/dev/null" with the filename.
> 
> -- 
> Sincerely,
> Philip Heede
> 
> 
> 
> Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
> 

 --
 ~~~
: WWW: http://www.silverlink.net/poke   :
: E-Mail: [EMAIL PROTECTED] :
 ~~
: Ask Mike! Aviation's response to Dear :
: Abby. http://www.avstarair.com: 
 ~~~


Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-06 Thread poke


First of all put the following at the bottom of your /etc/rc.d/rc.local
file:

/Your/path/to/mprime/mprime &

To start it from the command line do this:

nohup /Your/path/to/mprime/mprime &

-Chuck


On Thu, 3 Jun 1999 [EMAIL PROTECTED] wrote:

> I'm trying to run mprime on a (test)webserver (linux/apache) with no
> console access.
> Now I can start mprime remotely through telnet - which works fine.
> But as soon as I quit the particular telnet-session  - mprime quits too.
> Anybody can give me a hint how do keep mprime running?
> 
> thanks in advance
> 
> 
> 
> Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
> 

 --
 ~~~
: WWW: http://www.silverlink.net/poke   :
: E-Mail: [EMAIL PROTECTED] :
 ~~
: Ask Mike! Aviation's response to Dear :
: Abby. http://www.avstarair.com: 
 ~~~


Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-04 Thread Pierre Abbat

> if ( $mersenne > 5 ) then
Why 5? Isn't one enough? If there is more than one running, they'll just
compete with each other for the CPU, even though they're being nice to everyone
else.

phma

Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-04 Thread Nicolau C. Saldanha

On Thu, 3 Jun 1999, Kevin Jaget wrote:

> On Thu, 03 Jun 1999 17:58:34 +0200, you wrote:
> 
> >On Thu, 3 Jun 1999 12:03:25 +0200, [EMAIL PROTECTED] wrote:
> >
> > >Now I can start mprime remotely through telnet - which works fine.
> > >But as soon as I quit the particular telnet-session  - mprime quits 
> > >too.
> > >Anybody can give me a hint how do keep mprime running?
> >
> >Sure..
> >I run mprime remotely on a server by using a simple 
> >"./mprime > /dev/null &" command. The "> /dev/null" suppresses output and 
> >the "&" makes MPrime run in the background. If you want output in a file 
> >simply replace "/dev/null" with the filename.
> 
> You might also want to look at the nohup and nice commands,
> depending on what exactly you are trying to do.  If you've got root
> access (and the permission on the box's owner) you can also set
> mprime up to start when the system boots by modifying the init files
> in /etc/rc.d.

On the other hand, if you do not have root access or do not want to fool
around with init files (always dangerous), you can start mprime via cron
as a normal user: this is what I do and here is my script file which is
called every hour via cron. See the crontab command.

#!/bin/tcsh
set mersenne=`ps aux | grep -v grep | grep nicolau | grep mprime | wc -l`
if ( $mersenne == 0 ) then
echo "No mprime program running! Program will be initialized..."
pushd ~/mprime >& /dev/null
nice +19 ./mprime >& /dev/null &
popd >& /dev/null
else
if ( $mersenne > 5 ) then
echo $mersenne "mprime programs running!"
endif
endif

The variable "mersenne" counts the number of processes called mprime
run by nicolau; make sure your script is *not* called mprime_init
or it will count the script itself!
You must of course substitute your login where "nicolau" is.
You may also want to add parameters to mprime, or change the path
where mprime is located, or change the level of niceness.

http://www.mat.puc-rio.br/~nicolau


Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-03 Thread Kevin Jaget

On Thu, 03 Jun 1999 17:58:34 +0200, you wrote:

>On Thu, 3 Jun 1999 12:03:25 +0200, [EMAIL PROTECTED] wrote:
>
> >Now I can start mprime remotely through telnet - which works fine.
> >But as soon as I quit the particular telnet-session  - mprime quits 
> >too.
> >Anybody can give me a hint how do keep mprime running?
>
>Sure..
>I run mprime remotely on a server by using a simple 
>"./mprime > /dev/null &" command. The "> /dev/null" suppresses output and 
>the "&" makes MPrime run in the background. If you want output in a file 
>simply replace "/dev/null" with the filename.

You might also want to look at the nohup and nice commands,
depending on what exactly you are trying to do.  If you've got root
access (and the permission on the box's owner) you can also set
mprime up to start when the system boots by modifying the init files
in /etc/rc.d.





-- 
Kevin Jaget (or an FDA approved generic equivalent)
kcjaget at mindspring.com  

Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Re: Mersenne: Prime95 on linux, a tech question

1999-06-03 Thread Philip Heede

On Thu, 3 Jun 1999 12:03:25 +0200, [EMAIL PROTECTED] wrote:

 >Now I can start mprime remotely through telnet - which works fine.
 >But as soon as I quit the particular telnet-session  - mprime quits 
 >too.
 >Anybody can give me a hint how do keep mprime running?

Sure..
I run mprime remotely on a server by using a simple 
"./mprime > /dev/null &" command. The "> /dev/null" suppresses output and 
the "&" makes MPrime run in the background. If you want output in a file 
simply replace "/dev/null" with the filename.

-- 
Sincerely,
Philip Heede



Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm



Mersenne: Prime95 on linux, a tech question

1999-06-03 Thread f_3

I'm trying to run mprime on a (test)webserver (linux/apache) with no
console access.
Now I can start mprime remotely through telnet - which works fine.
But as soon as I quit the particular telnet-session  - mprime quits too.
Anybody can give me a hint how do keep mprime running?

thanks in advance



Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm