Creating a script to run at boot?

edited February 2004 in Science & Tech
I added the lines
echo "Starting Folding@Home"
exec /root/FAH/FAH4Console-Linux.exe -advmethods -forceasm
to the /etc/rc.d/rc.sysinit bootup script on my Linux machine using Metapad (which had been configured to save UNIX compatible text files as a default). When copied back onto the Linux box (using WinSCP) and rebooted, I got the message
"Cannot read /etc/rc.d/rc.sysinit"
then promptly halts. To get it back up and running I had to reinstall Smoothwall (the Linux distro I'm using).

What could I have done wrong? I double-checked Metapad's settings, and they're still default accept for the UNIX option I mentioned above.

Any thoughts?

Comments

  • a2jfreaka2jfreak Houston, TX Member
    edited February 2004
    I normally use vi when text editing in Linux.

    Also, Linux FAH is basically the exact same as Windows FAH in that it prints to STDOUT, correct? If so, you'll need to direct the text somewhere. Probably /dev/null. Also, I'm not sure if this matters when starting programs from init files, but it might. Use the & to return control back to the console.

    /root/FAH/FAH4Console-Linux.exe -advmethods -forceasm > /dev/null &

    Also, is the executable actually named FAH4Console-Linux.exe? Linux binaries do not normally have .exe as the last part of the filename. Also, make sure the file has the correct permissions. If it's an executable you'll want to make sure the executable flags are set using chmod.
  • -tk-tk Detroit, MI USA Icrontian
    edited February 2004
    if your distro has it, put your command at the end of /etc/rc.local, it'll excute after all the other services start. put >/dev/null 2>&1 at the end of it to redirect the STDOUT and STDERR to /dev/null
    example

    /some/path/to/command >/dev/null 2>&1
  • edited February 2004
    Just to make sure everything is spot on before I go rebooting, how do you check a file's ownership, and change the ownership to whatever it's supposed to be?
  • JBJB Carlsbad, CA
    edited February 2004
    just do ls -l and it will show the owner of the file. to change it simply type chown "username to change to" filename
  • edited February 2004
    Well... methinks I got it working... I didn’t use the ">/dev/null 2>&1" command afterwards, which means I have to CTRL-C it in order to get to the local logon prompt (which is fine as I would rather just log into the console remotely anyways).

    To get the rc.sysinit file to boot, I ran the command "chmod +xrw rc.sysinit", which apparently gave it the correct permissions it needed to boot.

    Now everything looks great! I still have the F@H info showing up locally, but seeing as how the machine is going to be running headless, it's not a problem.

    Anything else I should do?
  • a2jfreaka2jfreak Houston, TX Member
    edited February 2004
    Set the username to a2jfreak :)
  • edited February 2004
    WELL, it looks like it's not running as it should anyhow....

    It looks like it's copying all the files to the root (/) directory and running them out of there, rather than running it from the /root/FAH/ directory I made for it....

    How do I make it run where it is, rather than move the files elsewhere to run?
  • a2jfreaka2jfreak Houston, TX Member
    edited February 2004
    -local
  • -tk-tk Detroit, MI USA Icrontian
    edited February 2004
    TheSmJ wrote:
    Well... methinks I got it working... I didn’t use the ">/dev/null 2>&1" command afterwards, which means I have to CTRL-C it in order to get to the local logon prompt (which is fine as I would rather just log into the console remotely anyways).

    To get the rc.sysinit file to boot, I ran the command "chmod +xrw rc.sysinit", which apparently gave it the correct permissions it needed to boot.

    Now everything looks great! I still have the F@H info showing up locally, but seeing as how the machine is going to be running headless, it's not a problem.

    Anything else I should do?

    Which distro are you using?

    You really wanna try and find that /etc/rc.local file. Messing around with rc.sysinit could screw you all up.
  • edited February 2004
    I'm using Smoothwall (a router/firewall distro). While I understand you can make it use an rc.local file, Smoothwall doesn't have one "out of the box".

    I've already fuxored sysinit a couple of times, but because of the simplistic install and having the settings all backed up on floppy, a complete repartition/reformat/reinstall of the OS only takes 5 minutes.

    The people at Smoothwall.org helped me with the problem above. Turns out I had to switch to that directory before I actually ran anything from it to keep itself from making more copies.... stupid Unix....

    Anyways, it's now folding flawlessly without the need for my intervention. Perhaps I'll post a "how to" detailing the installation/configuration of Smoothwall, and how to make it fold. :rarr::fold:
Sign In or Register to comment.