Mailing List Archive

writing startup script
Hi, list.

I have a question about writing startup script:

I use torsmo to monitor my system,
but every time I boot into my system
I should start torsmo manually, that's not a problem
but another thing is that torsmo having default priority is blinking
(appear and dissapear on my desktop for some seconds)
in forums.gentoo.org I've read that `nice 10 -p $PID` helps ($PID -
torsmo PID)

so I do the folloing
1) start torsmo
2) top -u mylogin (to know torsmo PID)
3) nive 10 -p $PID

Can you give me a piece of advice about script which would do this routine
and the right place to put it in?

Thanks


--
gentoo-user@gentoo.org mailing list
Re: writing startup script [ In reply to ]
bit wrote, On 03.10.2004 21:04:

> so I do the folloing
> 1) start torsmo
> 2) top -u mylogin (to know torsmo PID)
> 3) nive 10 -p $PID
>
> Can you give me a piece of advice about script which would do this routine
> and the right place to put it in?
>
> Thanks

It depends on the WM you use.
e.g. Xfce4 executes everything under ~/Desktop/Autostart/ during
startup and KDE uses ~/.kde/Autostart/

There in you can put any (bash)script you want to be executed.
or even just create a symlink to the binary ( if you need no extra
options)

There also is a file called ~/.xprofile
This should work in the same manner independent from your WM.

Just put the commands in there as you get used to in cli.


bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: writing startup script [ In reply to ]
On Sun, 2004-10-03 at 14:04, bit wrote:
> so I do the folloing
> 1) start torsmo
> 2) top -u mylogin (to know torsmo PID)
> 3) nive 10 -p $PID
>
> Can you give me a piece of advice about script which would do this routine

Look at man pidof. It should be able to replace the top part of you
process.
--
Owen Ford <oford@arghblech.com>

() ascii ribbon campaign - against html e-mail
/\ - against proprietary attachments
Re: writing startup script [ In reply to ]
bit wrote:

> 1) start torsmo
> 2) top -u mylogin (to know torsmo PID)
> 3) nive 10 -p $PID

why not just start the program niced to begin with?

# nice -n 10 torsmo

Or, in a shell script, you can get the pid of the last backgrounded
process via the $! variable:

#!/bin/sh
torsmo &
echo Started torsmo[$!]
renice +10 -p $!


--
gentoo-user@gentoo.org mailing list