Please support VectorLinux!

Author Topic: [SOLVED] rc.local  (Read 2186 times)

retired1af

  • Packager
  • Vectorian
  • ****
  • Posts: 1280
[SOLVED] rc.local
« on: July 11, 2007, 03:22:44 am »
Someone really needs to take away my keys first thing in the morning.

Was playing around with the Folding@Home client for linux, and decided I wanted to run it as a service. No problem sez I. Just slap the appropriate command at the end of rc.local and let 'er rip. Riiiiiiiiight... Silly me, I forgot to close off the file properly (I use fi, right?) and now when I boot, it launches the folding client, and stays there. It doesn't boot into X and KDE. Is there a way to bypass/cancel or have I really borked it and now need to reinstall?
« Last Edit: July 11, 2007, 05:41:25 am by retired1af »
ASUS K73 Intel i3 Dual Core 2.3GHz

The Headacher

  • Louder than you
  • Global Moderator
  • Vectorian
  • *****
  • Posts: 1553
  • I like the bass to go BOOM!
    • Multimedia on VL (work in progress)
Re: rc.local
« Reply #1 on: July 11, 2007, 03:28:27 am »
You could just put a default rc.local back if you boot a livecd.

Code: [Select]
#!/bin/sh
# rc.local
# This file is provided for custom initialisation because
# Admin is not encouraged to touch rc.S or rc.M.
#
# This file is launched on the end of entering multi user mode (2-5)

# Setting up Linux logo text
if [ "$INSTALL_DATE" ]; then
   linux_logo -c -t "Operating since $INSTALL_DATE" > /etc/issue
else
   linux_logo -c -t "Brought to you by Vector-Linux" > /etc/issue
fi

## Setting up remote login message
echo "Welcome to $HOSTNAME. Unauthorized access is prohibited !" > /etc/issue.net

## Setting login message
if [ -f /etc/vector-version ]; then
    echo "`head -n1 /etc/vector-version` on `uname -a | cut -d\  -f1,3`" > /etc/motd
else
    echo "Vector Linux on `uname -a | cut -d\  -f1,3`" > /etc/motd
fi

## Vector Linux initialisation is very fast ...
## So uncomment this if you want to enjoy the show a bit longer
#sleep 5
iface=`ifconfig |cut -d " " -f 1|grep -v lo`
if [ "x$iface" == "x" ];then
  for i in 0 1 2 3 4; do
  if [ -x /etc/rc.d/rc.inet$i ]; then
    /etc/rc.d/rc.inet$i start
  fi
done
fi
## You may add custom initialisation below this

Most music on my soundcloud page was arranged in programs running on VL.

retired1af

  • Packager
  • Vectorian
  • ****
  • Posts: 1280
Re: rc.local
« Reply #2 on: July 11, 2007, 03:32:13 am »
Hmmmm.. Yeah, if I had one...  :D I'll go out and snag one and fix it that way. No way to get around it otherwise?
ASUS K73 Intel i3 Dual Core 2.3GHz

retired1af

  • Packager
  • Vectorian
  • ****
  • Posts: 1280
Re: rc.local
« Reply #3 on: July 11, 2007, 05:27:15 am »
OK.. Where did I go wrong here? This is the line I added to rc.local...

sudo -u retired1af sh -c "cd /home/retired1af/Folding; ./start"

Start is the script file I created to start the client.

#!/bin/bash
./FAH504-Linux.exe
ASUS K73 Intel i3 Dual Core 2.3GHz

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: rc.local
« Reply #4 on: July 11, 2007, 05:32:04 am »
not sure but maybe you need to start it in the background

Code: [Select]
sudo -u retired1af sh -c "cd /home/retired1af/Folding; ./start &"

retired1af

  • Packager
  • Vectorian
  • ****
  • Posts: 1280
Re: rc.local
« Reply #5 on: July 11, 2007, 05:37:05 am »
BINGO!!!! Thanks! I knew there was a switch that I needed to use, but couldn't remember what it was. Off to give it a shot..

(Oh, and kudos to the Live CD team... That really saved my bacon this time!)

Edit -- Worked like a charm.. Thanks!
« Last Edit: July 11, 2007, 05:40:59 am by retired1af »
ASUS K73 Intel i3 Dual Core 2.3GHz