Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: GAH bootscripts.

  1. #21

    Re:GAH bootscripts.

    I have no idea... It was in the original and I just put in what I thought would be right.

    Oh and byt the way what did this part do;
    Code:
    >/dev/null 2>&1
    I know that it sent it to /dev/null but what is that 2>&1 business?

  2. #22

    Re:GAH bootscripts.

    Well I was wondering if someone might be able to help me fix this error message when I start up FAH from the script above I get this:
    Code:
    [root@thalia init.d]# /sbin/service folding start
    Starting Folding@Home client ... /etc/init.d/folding: line 11: evaluate_retval: command not found
    I assume that it is a problem with the /etc/init.d/functions part toward the top of the script but not certain.

  3. #23
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re:GAH bootscripts.

    You can remove that line from teh script if you want to, all it does is see if it went well, and print the [OK] or [FAILED] according to it.

    Since you already use:
    source /etc/init.d/functions
    I would guess this would have the same effect:
    Code:
    #!/bin/sh
    source /etc/init.d/functions
    FAH="/home/mcdours/fah/FAH3Console-Linux.exe"
    cd /home/mcdours/fah/ >/dev/null 2>&1
    RETVAL=1
    case "$1" in
            start)
                    echo -n "Starting Folding@Home client ... "
                    su mcdours -c "$FAH >/dev/null 2>&1 &"
                    RETVAL=$?
                    ;;
            stop)
                    echo -n "Stopping Folding@Home's FAH3Console-Linux.exe ..."
                    killproc FAH3Console-Linux.exe
                    RETVAL=$?
                    ;;
            restart)
                    $0 stop
                    /usr/bin/sleep 1
                    $0 start
                     RETVAL=$?
                    ;;
            status)
                    statusproc FAH3Console-Linux.exe
                     RETVAL=$?
                    ;;
            *)
                    echo "Usage: $0 {start|stop|restart|status}"
                    exit 1
                    ;;
    esac
    exit $RETVAL

  4. #24
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re:GAH bootscripts.

    Hmm... just thought, if you get into trouble with the killproc and status_proc functions aswell.. here is the way I would make the script..

    Code:
    #!/bin/sh
    source /etc/init.d/functions
    FAH="/home/mcdours/fah/FAH3Console-Linux.exe"
    cd /home/mcdours/fah/ >/dev/null 2>&1
    MY_USER=mcdours
    RETVAL=1
    case "$1" in
            start)
                    echo -n "Starting Folding@Home client ... "
                    TMP=`su $MY_USER -c "$FAH >/dev/null 2>&1 &"`
                    echo $TMP | awk '{print $2}' >! /var/run/$MY_USER-FAH.pid
                    RETVAL=$?
                    ;;
            stop)
                    echo -n "Stopping Folding@Home's FAH3Console-Linux.exe ..."
                    kill `cat /var/run/$MY_USER-FAH.pid`
                    RETVAL=$?
                    ;;
            restart)
                    $0 stop
                    /usr/bin/sleep 1
                    $0 start
                    RETVAL=$?
                    ;;
            status)
                    echo -n "Pid of running FAH: "
                    cat /var/run/$MY_USER-FAH.pid
                    RETVAL=$?
                    ;;
            *)
                    echo "Usage: $0 {start|stop|restart|status}"
                    ;;
    esac
    exit $RETVAL

  5. #25

    Re:GAH bootscripts.

    [quote author=redhead link=board=22;threadid=3564;start=0#56471 date=1040598348]
    You can remove that line from teh script if you want to, all it does is see if it went well, and print the [OK] or [FAILED] according to it.

    Since you already use:
    source /etc/init.d/functions
    I would guess this would have the same effect:
    [/quote]

    Thanx man I used your fisrt script as the second one gave me troubles... I do want to change one thing though... I want to forward it to tty12 so I can actually keep an eye on it, BUT I get a permission denied error for the startup for this:
    Code:
            start)
                    echo -n "Starting Folding@Home client ... "
                    su mcdougrs -c "$FAH >/dev/tty12 &"
                    RETVAL=$?
                    ;;
    Can I safely change the permissions on tty12 or is there someway I can forward the output of FAH to some sort of terminal? I would REALLY like to be able to keep an eye on FAHs output, if its possible

  6. #26
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re:GAH bootscripts.

    You could either change the permission on /dev/tty12, or add your user to the tty group ie:
    > usermod -G tty mcdougrs

    Either way the user will be allowed to write to /dev/tty12, when adding your user to the tty group, you will assure that it can write to any tty, not just the one where the permissions has been change.

  7. #27

    Re:GAH bootscripts.

    [quote author=redhead link=board=22;threadid=3564;start=0#56494 date=1040631964]
    You could either change the permission on /dev/tty12, or add your user to the tty group ie:
    > usermod -G tty mcdougrs

    Either way the user will be allowed to write to /dev/tty12, when adding your user to the tty group, you will assure that it can write to any tty, not just the one where the permissions has been change.
    [/quote]
    Awesome THANX!!!

  8. #28

    Re:GAH bootscripts.

    OOOOOOOOOOOOOOPPPPPPPPPPPPPSSSSSSSSSS!!!!!!! I figured out what that second & does in the script! : It returns the prompt to the computer.. right now it just freezes waiting for FAH to finish... I need to get in and re-edit the script... I made a boot disk at RH8.0 install time but how do I boot up so that I can JUST edit that script?

  9. #29
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re:GAH bootscripts.

    boot into runlevel 1.
    If you use lilo as the bootmanager, then at the LILO: prompt, type 'linux single' (without the quotes) then you're droped into a root shell, without any of the normal processes beeing started.
    Then when you're finished editing the script, just use: 'telinit 5' (if its runlevel 5 you're used to boot into)

  10. #30

    Re:GAH bootscripts.

    [quote author=redhead link=board=22;threadid=3564;start=0#56568 date=1040722763]
    boot into runlevel 1.
    If you use lilo as the bootmanager, then at the LILO: prompt, type 'linux single' (without the quotes) then you're droped into a root shell, without any of the normal processes beeing started.
    Then when you're finished editing the script, just use: 'telinit 5' (if its runlevel 5 you're used to boot into)
    [/quote]
    I use grub, but I figured out how to get into my system with out using the boot disk.... I just entered Interactive Startup and I didn't start the folding script! It was that easy then I went in and edited it and wholla here I am!

    Thanx for all the help and thanx for posting that revised script for me!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •