Click to See Complete Forum and Search --> : Simple question from a noob


urinal cake
09-16-2001, 05:10 AM
All I want to do is start nvclock in runlevel3 everytime whether I'm root or user.

./nvclock -n 195 -m 210


That's all I want. How do I create the script file and where do I put/link to it? How do I get it called at runlevel3?

bwkaz
09-16-2001, 08:48 AM
What distro?

If it's RedHat-based, then go to /etc/rc.d/init.d/ and create a shell script that all it does is call nvclock (with the correct path and arguments, obviously). Call it whatever, nvclock I think would work (then make SURE you don't just do a ./nvclock, because if you do, you'll get into infinite recursion).

Then go to /etc/rc.d/rc3.d/ and create a symlink to your shell script called S99nvclock (or something -- the S and 99 are important, the rest is discretionary). The command to do this is something very much like this:

ln -s ../init.d/nvclock S99nvclock

Insert whatever you called the script for nvclock, and whatever you want the symlink called for S99nvclock.

Make sure the S is capitalized.

Another note: This way is probably not compliant to ANY standard, I think your shell script probably should have some commands in it to kill nvclock if given the right parameter, but oh well, it should still work.

------------------------------------------------------------------------------------------

I just thought of another way to do it more easily. Just open up /etc/rc.d/rc.local and add /path/to/nvclock to it (replace the path and add the arguments) at the end. This file gets executed last, and it is where I have (for example) the commands enabling DMA and 32-bit transfers on my hard drives. It gets executed every bootup, too.

urinal cake
09-16-2001, 06:46 PM
Thanks!

The Kooman
09-17-2001, 04:10 AM
Originally posted by bwkaz:
<STRONG>What distro?

If it's RedHat-based, then go to /etc/rc.d/init.d/ and create a shell script that all it does is call nvclock (with the correct path and arguments, obviously). Call it whatever, nvclock I think would work (then make SURE you don't just do a ./nvclock, because if you do, you'll get into infinite recursion).

Then go to /etc/rc.d/rc3.d/ and create a symlink to your shell script called S99nvclock (or something -- the S and 99 are important, the rest is discretionary). The command to do this is something very much like this:

ln -s ../init.d/nvclock S99nvclock

Insert whatever you called the script for nvclock, and whatever you want the symlink called for S99nvclock.

Make sure the S is capitalized.

Another note: This way is probably not compliant to ANY standard, I think your shell script probably should have some commands in it to kill nvclock if given the right parameter, but oh well, it should still work.

------------------------------------------------------------------------------------------

I just thought of another way to do it more easily. Just open up /etc/rc.d/rc.local and add /path/to/nvclock to it (replace the path and add the arguments) at the end. This file gets executed last, and it is where I have (for example) the commands enabling DMA and 32-bit transfers on my hard drives. It gets executed every bootup, too.</STRONG>

IIRC, you'd have to do more than just a simple script - your script should be capable of accepting 3 types of switches - start, stop and restart. Look at the files already there to get an idea.

Raskii
09-17-2001, 11:28 AM
Why don't you just run CLOCK.EXE from C:\WINDOWS? You can set it up in a personalized Start Menu or, if you really know what you're doing, you can even add a registry key to start it when you logon as the local Administrator or yourself.

:p

*quickly runs away*

[ 17 September 2001: Message edited by: Lucefiel ]

bwkaz
09-17-2001, 12:43 PM
Originally posted by The Kooman:
<STRONG>IIRC, you'd have to do more than just a simple script - your script should be capable of accepting 3 types of switches - start, stop and restart. Look at the files already there to get an idea.</STRONG>

Yes, that's what I meant by "it probably doesn't conform to any kind of standard".

But it SHOULD still work. The "killall" step that gets executed on runlevel 6 or 0 should kill nvclock, so the script shouldn't need to be able to kill nvclock.

But I guess if you want to, then put a K99nvclock symlink in rc6.d and rc0.d, and add "stop" and "restart" functionality to the script in init.d.

Originally posted by Lucefiel:
<STRONG>Why don't you just run CLOCK.EXE from C:\WINDOWS? You can set it up in a personalized Start Menu or, if you really know what you're doing, you can even add a registry key to start it when you logon as the local Administrator or yourself.

:p

*quickly runs away*</STRONG>

Ummm.... yeah.... except that nvclock is an nVidia chip overclocking utility, and clock.exe is just a clock......

But other than that, I suppose you could...