VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

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

retired1af

  • Administrator
  • Vectorian
  • *****
  • Posts: 1330
[SOLVED] rc.local
« on: July 11, 2007, 04: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, 06:41:25 am by retired1af »
Logged
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, 04: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

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

retired1af

  • Administrator
  • Vectorian
  • *****
  • Posts: 1330
Re: rc.local
« Reply #2 on: July 11, 2007, 04: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?
Logged
ASUS K73 Intel i3 Dual Core 2.3GHz

retired1af

  • Administrator
  • Vectorian
  • *****
  • Posts: 1330
Re: rc.local
« Reply #3 on: July 11, 2007, 06: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
Logged
ASUS K73 Intel i3 Dual Core 2.3GHz

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: rc.local
« Reply #4 on: July 11, 2007, 06: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 &"
Logged

retired1af

  • Administrator
  • Vectorian
  • *****
  • Posts: 1330
Re: rc.local
« Reply #5 on: July 11, 2007, 06: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, 06:40:59 am by retired1af »
Logged
ASUS K73 Intel i3 Dual Core 2.3GHz