LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-24-2003, 06:02 AM   #1
El_Angelo
LQ Newbie
 
Registered: Sep 2003
Distribution: lunar-linux
Posts: 15

Rep: Reputation: 0
lirc init script...


I have installed lirc on my slackbox and the remotecontrol works pretty fine (not pretty.. just perfect )...

but (there is always a but....)

I have to start lircd myself at bootup time (it is a daemon) by typing in a console "lircd" this works pretty fine but as I am planning to get rid of the keyboard it is not an option to keep doing it like this... (I don't have a screen or mouse either... don't mind understanding it... it has to do with making a mp3box)
Long time ago I was trying the same with debian and there you can install lirc with a deb package and it adds automatically the initscript so it starts the lircd daemon the moment you start the computer...
but (again)
I didn't like debian (sorry debian users) and switched to slack (which I like quite a lot) but now as is the case with slack it doesn't do these things so lircd automatically starts up by itself... That's allright with me but I want it to start-up and that's where I'm stuck...
in the /usr/share/lirc/contrib directory you can find a few init-scripts for certain distributions (being : suse, redhat, debian and so on...) but guess what : NO SLACKWARE... althought there is a script without a name (actually it is called lircs). I posted it here below...

Now the question... Would it be enought to add this script to the /etc/rc.d directory and make it executable to make sure that the lirc-daemon starts up??? Or do I still have to adjust another file? Or is there a more simple way??? (I already tried to adjust rc.inet1, but this doesn't work : I added
#start up lircd daemon
if [ -x /usr/share/sbin/lircd ] then
echo "starting the lircd daemon"
. /usr/share/sbin/lircd
fi
but this doesn't seem to work... (not even a single bit )


lircs-file :


#!/bin/bash
#
# ---------------------------------------------------------------------
#
# LIRC starter (called 'lircs' for simplicity)
#
# A simple shell script to make the configuration of LIRC more comfortable.
#
# It may be necessary to change the script if ...
# - you have a non-standard installation or
# - you use more or other client applications (see below) or
# - the init scripts are located elsewhere on your Linux system (see below).
#
# ---------------------------------------------------------------------
#
# author: Michael Kammerer <M.Kammerer@gmx.de>
#
# PLEASE send me your comments, ideas, bug reports, ... via E-Mail.
#
# ---------------------------------------------------------------------

# location of the LIRC config file
# change this if your LIRC config file is located elsewhere
CONFIG_FILE=${HOME}/.lircrc

# any editor to edit LIRC config file
FILE_EDITOR=vim



# function declarations

start_clients () {
if [ -s ${CONFIG_FILE} ]; then
echo -n Starting LIRC clients ...

# add more clients HERE or change the ones I put here as a start
irxevent &
irexec --daemon

echo " done"
else
echo "LIRC config file not found in ${CONFIG_FILE}"
exit 1
fi
}

restart_lircd () {
if [ "${USER}" = "root" ]; then
# change this if your Linux system keeps the init scripts elsewhere
/sbin/init.d/lircd restart
else
echo "`basename ${0}`: you must be 'root' to restart the LIRC daemon (lircd)."
exit 1
fi
}

stop_lircd () {
if [ "${USER}" = "root" ]; then
# change this if your Linux system keeps the init scripts elsewhere
/sbin/init.d/lircd stop
else
echo "`basename ${0}`: you must be 'root' to stop the LIRC daemon (lircd)."
exit 1
fi
}

edit_config_file () {
${FILE_EDITOR} ${CONFIG_FILE}
}

print_info () {
echo "LIRC starter version 0.2, 09/2000 "
echo "Written by Michael Kammerer <M.Kammerer@gmx.de>."
echo "Visit 'www.crosswinds.net/~michaelkammerer/lircs' for updates."
}

print_help () {
echo "LIRC starter usage: lirc [option]"
echo "'option' can be:"
echo "as any user:"
echo "-h | --help print this short help text"
echo "-c | --clients start LIRC clients (necessary if lircd was restarted)"
echo "-e | --edit edit LIRC config file '${CONFIG_FILE}'"
echo "-v | --version print script version and other info"
echo "only as 'root':"
echo "-r | --restart restart LIRC daemon (lircd) "
echo "-s | --stop stop LIRC daemon"
}


# processing of command line arguments

case $1 in
-r)
restart_lircd
;;
--restart)
restart_lircd
;;
-s)
stop_lircd
;;
--stop)
restart_lircd
;;
-c)
start_clients
;;
--clients)
start_clients
;;
-h)
print_help
;;
--help)
print_help
;;
-e)
edit_config_file
;;
--edit)
edit_config_file
;;
-v)
print_info
;;
--version)
print_info
;;
*)
print_help
;;
esac
 
Old 09-24-2003, 06:18 AM   #2
mrpdaemon
Member
 
Registered: Jun 2003
Distribution: Slackware 9.1
Posts: 41

Rep: Reputation: 15
really simple to do.

add "lircd" in the file "/etc/rc.d/rc.local"

and lircd will be run at next reboot.
 
Old 09-24-2003, 06:27 AM   #3
El_Angelo
LQ Newbie
 
Registered: Sep 2003
Distribution: lunar-linux
Posts: 15

Original Poster
Rep: Reputation: 0
I'll try that... (do you use lirc?)
 
Old 09-24-2003, 10:05 AM   #4
mrpdaemon
Member
 
Registered: Jun 2003
Distribution: Slackware 9.1
Posts: 41

Rep: Reputation: 15
Quote:
Originally posted by El_Angelo
I'll try that... (do you use lirc?)
no I do not

but rc.local is one of the many ways to add something to the boot sequence of Slack 9.
 
Old 09-25-2003, 01:20 AM   #5
El_Angelo
LQ Newbie
 
Registered: Sep 2003
Distribution: lunar-linux
Posts: 15

Original Poster
Rep: Reputation: 0
it worked
but I fucked up the kernel yesterday so I can start all over.... :'(
 
  


Reply



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
can't get my init script working nukeu666 Linux - Newbie 4 12-16-2004 11:12 AM
help with init script output ierickson Linux - General 0 05-07-2004 12:05 PM
INIT script hangs up? quixy Debian 1 02-08-2004 11:58 AM
Is it possible to switch lirc modes with a script? cmisip Linux - Software 0 05-31-2003 12:40 PM
could use some help with my init.d script.... BrianK Linux - General 3 10-31-2002 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:41 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
Open Source Consulting | Domain Registration