LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 07-05-2009, 11:10 PM   #1
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Backtrack 4 / Fedora 10 / Ubuntu 9.04
Posts: 32
Thanked: 3
Exclamation how to start an application using the rc.local init script?


[Log in to get rid of this advertisement]
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
sl33p is offline  
Tag This Post ,
Reply With Quote
Old 07-05-2009, 11:18 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :}
Posts: 18,846
Blog Entries: 1
Thanked: 160
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
Tinkster is offline     Reply With Quote
Old 07-06-2009, 04:56 PM   #3
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Backtrack 4 / Fedora 10 / Ubuntu 9.04
Posts: 32
Thanked: 3

Original Poster
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
sl33p is offline     Reply With Quote
Old 07-06-2009, 05:47 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :}
Posts: 18,846
Blog Entries: 1
Thanked: 160
From an autorun feature, e.g. KDE's autostart directory. That will depend on your
DE/WM ...


Cheers,
Tink
Tinkster is offline     Reply With Quote
Old 07-07-2009, 05:06 PM   #5
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Backtrack 4 / Fedora 10 / Ubuntu 9.04
Posts: 32
Thanked: 3

Original Poster
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
sl33p is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 09:19 AM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration