LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2008, 05:20 PM   #1
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Rep: Reputation: 15
updaterc.d to launch xbindkeys


I wish to use update-rc.d to start xbindkeys at startup.

The steps I take:

1) Write script (This script works if called directly from cmd line).

Quote:
#! /bin/sh
# /etc/init.d/xbindkeys.sh
#

# Some things that run always
/usr/bin/xbindkeys



exit 0
2) chmod 755 /etc/init.d/xbindkeys.sh

3) update-rc.d xbindkeys defaults

4) check for links in /etc/rc#.d

Quote:
root@develop:~/Documents# ls -Al /etc/rc[1-6].d | grep xbind
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 K20xbindkeys.sh -> ../init.d/xbindkeys.sh
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 S20xbindkeys.sh -> ../init.d/xbindkeys.sh
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 S20xbindkeys.sh -> ../init.d/xbindkeys.sh
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 S20xbindkeys.sh -> ../init.d/xbindkeys.sh
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 S20xbindkeys.sh -> ../init.d/xbindkeys.sh
lrwxrwxrwx 1 root root 22 2008-08-05 16:30 K20xbindkeys.sh -> ../init.d/xbindkeys.sh
yet, no love at boot
 
Old 08-05-2008, 05:37 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
The concept of runlevels and init.d and startup / kill scripts seems to have changed with the latest 'buntu's (and probably debian also).
I am still trying to understand these changes.

What happens if you resort to the trusted and reliable method of calling your script from /etc/rc.local ?

Just add /etc/init.d/xbindkeys.sh to the file /etc/rc.local just before the final exit 0 ?

Does that work?
 
Old 08-05-2008, 06:08 PM   #3
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I tried the following rc.local file. It did not work.

Quote:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/etc/init.d/xbindkeys.sh

exit 0
As per the comments of rc.local:
[QUOTE]$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 332 2008-08-05 17:50 /etc/rc.local[/QUO
 
Old 08-05-2008, 06:18 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Ah!
That's maybe because xbindkeys is binding keys for a particular user login.
But rc.local is for system-wide settings. My mistake.
Also, this is why it did not work for you when you put it as a startup script in /etc/rc#.d - because nobody is logged in at that time.

Please remove that line from rc.local - it is useless.

Try putting your script (making sure it is executable, though I think it already is) into the directory /home/yourusername/.kde/Autostart

Notice the dot in the path there.

Then restart X with <CTRL><ALT><BACKSPACE> or just logout and back in again.

Any better?

Last edited by tredegar; 08-05-2008 at 06:25 PM. Reason: Clarification
 
Old 08-05-2008, 06:19 PM   #5
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
Quote:
The concept of runlevels and init.d and startup / kill scripts seems to have changed with the latest 'buntu's (and probably debian also).
I am still trying to understand these changes.
Well, It seems that trying to use SystemV init is a losing proposition in 'buntu (perhaps Debian and debian-based) distros

http://www.linux.com/feature/125977?theme=print

Geez! it would have been nice to know this a couple of days ago. Well at least I learned a bit more about writing scripts -- I wrote several trying to get them to work!

Thanks for the heads-up.
 
Old 08-05-2008, 06:27 PM   #6
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
Quote:
Try putting your script (making sure it is executable, though I think it already is) into the directory /home/yourusername/.kde/Autostart
This I know will work. I had it that way when I started this little project. But noooo, I had to try and learn how the people who actually know what they are doing did things

Thanks Again and will remove the rc.local edit
 
Old 08-05-2008, 06:52 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Well, It seems that trying to use SystemV init is a losing proposition
It is, and I've learned SystemV init over the years, I'll miss it.

Thanks for that link, yes, it's now "upstart" (couldn't recall that when I was posting).

But linux development is progressing much faster than the other OSs, and I fully expect I'll get used to future changes as I have been very pleased with the replacement of devfs with udev. Waaaaay better, whilst a personal headache and unwelcome relearning experience.

Quote:
This I know will work. I had it that way when I started this little project.
So, two steps forward and one back. It's still progress.

I raise my hat to the developers who have managed this transition without many of us noticing anything at all: "Legacy scripts" are still acknowledged, but I accept that this may not last. For example check your /var/log/messages - mine has references to "This is deprecated: see http://xxx", but to give the developers credit, it is still all working, but we are being given good warnings that this may not be the case in the future, unless we all keep up.

Have fun.
 
  


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
xbindkeys and multimedia buttons. sblantipodi Linux - Laptop and Netbook 0 11-13-2007 08:42 PM
Need help with glade and xbindkeys David the H. Programming 0 10-28-2007 02:16 PM
Help with xbindkeys monkiidansu Linux - Software 1 08-14-2007 03:10 PM
Anything like xbindkeys to Windows XP? Mega Man X General 6 08-14-2006 12:54 PM
xbindkeys: How to get name of clicked program lagu2653 Linux - Software 1 06-27-2005 06:28 AM


All times are GMT -5. The time now is 10:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration