LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 07-05-2009, 10:10 PM   #1
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Rep: Reputation: 17
Exclamation how to start an application using the rc.local init script?


Hi guys,

I'm trying to start an application (qBittorrent) as a regular user, on the background (&) every time I enter runlevel 5 (graphical environment) using the script rc.local:

/etc/rc.d/rc.local:
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
su sleep -c "qbittorrent %f"
#I tried also with:
#/usr/bin/qbittorrent &
#./usr/bin/qbittorrent &
#source /usr/bin/qbittorrent &
partial $ls /etc/rc.d/rc5.d/ output:
Code:
...
lrwxrwxrwx 1 root root 11 2009-04-24 00:42 S99local -> ../rc.local
...
Also, if I run the command:
Code:
$qbittorrent %f
alone in a xterm window, it starts the application correctly.

What am I doing wrong?
Thanks in advance dudes,
sl33p
 
Old 07-05-2009, 10:18 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
You're trying to run an application before a user owned environment is up.

Either resort to starting the torrent once you're logged in, or use a
command line based client.


Cheers,
Tink
 
Old 07-06-2009, 03:56 PM   #3
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Tinkster View Post
You're trying to run an application before a user owned environment is up.

Either resort to starting the torrent once you're logged in, or use a
command line based client.


Cheers,
Tink
Thanks for the help.

You mean by "resort to starting the torrent once you're logged in", by running it in a login script, like /etc/.bashrc ??


sl33p
 
Old 07-06-2009, 04:47 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
From an autorun feature, e.g. KDE's autostart directory. That will depend on your
DE/WM ...


Cheers,
Tink
 
Old 07-07-2009, 04:06 PM   #5
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
Thumbs up

Quote:
Originally Posted by Tinkster View Post
From an autorun feature, e.g. KDE's autostart directory. That will depend on your
DE/WM ...


Cheers,
Tink
Thanks man, understood.

According to GNOME's documentation, this directory is ~/.config/autostart (user-specific) and /etc/xdg/autostart (system-wide).

Now I'm at work, so when I get home, I'll try it out on my (way better) linux box.

Regards,
sl33p
 
  


Reply

Tags
rclocal


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
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 04:50 PM
bash - start remote script from local script? babag Programming 7 04-06-2008 05:46 PM
What local init script does your distro use? tim914 Linux - Software 7 06-07-2007 12:35 PM
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 12:51 PM
custom init.d script will start but won't stop Qwerty9119 Linux - General 2 05-03-2007 12:23 PM


All times are GMT -5. The time now is 04:01 PM.

Main Menu
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