LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-25-2012, 07:39 PM   #31
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40

I really hope that the OP wasn't newish to Linux, 'cos you lot just sent him running back to Windows.
 
Old 07-26-2012, 12:02 AM   #32
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 508

Rep: Reputation: Disabled
Quote:
Originally Posted by tooparam View Post


Hi there

I've added few lines to my rc.local file.
How can I execute rc.local without reboot of my Slackware 10.2 linux server

Please don't reply if your answer is: It can be executed as './rc.local'

Let me try, I am guessing that you are looking to execute those added lines with out having to reboot or run rc.local

Since you did not give anything with work with, I will make make my own example.

I like to keep my rc.local simple. Each section that does something has only three lines of code. Here is an excerpt from my rc.local to start my UPS daemon. In other words rc.local is used to start another script to perform a specific function.
Code:
# Start the apcupdd daemon.
#
if [ -x /etc/rc.d/rc.apcupsd ]; then
  /etc/rc.d/rc.apcupsd start
fi
Lets say you added a few lines to rc.local to turn on Num Lock. Useful if you boot runlevel 3 as I do.
Code:
# Turn on Num Lock
CLITTY=/dev/tty[1-6]
for tty in $CLITTY; do
  /usr/bin/setleds -D +num < $tty
done[/COLOR]
Now there is nothing wrong with adding those lines to rc.local. It just not how I like to do things. I created a rc.numlock script to actually do the task of turning on Num Lock.
Code:
#!/bin/sh
# /etc/rc.d/rc.numlock
# Turn on Num Lock

# Turn on Num Lock 
numlock_on() {
  if [ -x /usr/bin/setleds ]; then
    echo "Turning on Num Lock"
    CLITTY=/dev/tty[1-6]
    for tty in $CLITTY; do
      /usr/bin/setleds -D +num < $tty
    done
  fi
}

case "$1" in
'on')
  numlock_on
  ;;
*)
  echo "usage $0 on"
esac
Here is an excerpt from from my rc.local file showing the lines of code to start the rc.numlock script.
Code:
# Start the apcupdd daemon.
if [ -x /etc/rc.d/rc.apcupsd ]; then
  /etc/rc.d/rc.apcupsd start
fi

# Turn on Num Lock
if [ -x /etc/rc.d/rc.numlock ]; then
  /etc/rc.d/rc.numlock on 
fi
You can now run those few added lines without rebooting or running ./rc.local, simple type ./rc.numlock on.

Last edited by chrisretusn; 07-26-2012 at 12:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rc.local won't execute on Suse 10.0 advwebsys Suse/Novell 5 01-26-2006 06:45 PM
is there a way to make a local linux server the time stamp server for win2k? Lleb_KCir Linux - General 2 09-19-2005 08:05 PM
How to make a command execute on it every reboot? peterguo Linux - Software 5 11-04-2004 08:23 PM
how to execute my program when any user logs off my linux server ? rags2k Programming 8 08-17-2004 03:33 PM
Is it possible to make a Linux server execute a program on a WinXP system? Cichlasoma Linux - General 4 04-23-2004 07:00 AM


All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration