LinuxQuestions.org
Register a domain and help support LQ
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 06-20-2014, 06:34 AM   #1
unclesamcrazy
Member
 
Registered: May 2013
Posts: 187

Rep: Reputation: 1
start up vs rc.local


Log out and log in again is enough to execute script mentioned in Start up Applications but it needs complete restart to execute script mentioned in rc.local file.
why?
 
Old 06-20-2014, 07:45 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Because the rc.local script is called by the init system at boot time, while the Start up Applications system is managed by your desktop environment. Both serve different purposes, rc.local is the place for things you want run only once at boot systemwide, while the Start up Applications system is for things that have to be started on a per user basis (different users can have different applications there).
 
1 members found this post helpful.
Old 06-20-2014, 08:26 AM   #3
unclesamcrazy
Member
 
Registered: May 2013
Posts: 187

Original Poster
Rep: Reputation: 1
Thanks for the accurate answer.
one more thing,
Start up applications are stored in ~/.config/autostart as .desktop files.
If a Linux system has no desktop environment (only command line), the black screen with prompt appears when system boots successfully, in this case, the .desktop file can not be generated, correct? or still generated and used?

Can each user define start up task for his account using .desktop file but when there is no desktop environment then can he update rc.local for his account to run a script ?

Thanks again for your proper response.
 
Old 06-21-2014, 08:50 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Files in ~/.config/autostart are only used for starting applications if the desktop environment supports that. If you don't start a desktop environment those files will not be used.
For per user application starting without a desktop environment usually the configuration file of the user's shell is used, in most cases ~/.bashrc.
rc.local can not be used for user specific settings or application starts, it is executed before the login prompt even appears and can not know which user will log in.
 
1 members found this post helpful.
Old 06-24-2014, 10:30 PM   #5
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 290

Rep: Reputation: 55
Login will execute /sbin/bash --login
This will execute /etc/profile, which is where your prompt style is set, the PATH is set
and other things.
The user may have a ~/.profile which will be executed next.
Each user can put any bash script in their own profile. Including modified lines from /etc/profile is the usual use, or making a simple prompt style (maybe because including directory name in the prompt string has become a problem).

This applies to any login.

If you open a Konsole and do not see the colors when you "ls" (like you do when you use a real console), then fix that as follows:
Start Konsole, select profile settings from the menu, edit the profile you are using (usually shell), and change the line "/sbin/bash" to "/sbin/bash --login".
This will then also run the profile scripts when using Konsole.

I run Slackware. If you do not find profile, then it may be bashrc or some other file name on your distribution.

Last edited by selfprogrammed; 06-24-2014 at 10:37 PM.
 
  


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
/etc/init.d/local won't start zymos Gentoo 3 10-01-2010 05:51 AM
cannot start XServer with rc.local - not authorized LennyBPoint Linux - General 3 06-24-2008 02:09 PM
no /etc/rc.d/rc.local in suse? how do I start ... drokmed SUSE / openSUSE 2 10-18-2006 02:25 PM
Auto start with rc.local kingchaos Linux - Newbie 6 09-18-2004 03:01 PM
vncserver won't start from rc.local GD_19 Linux - Software 5 03-13-2004 01:27 AM


All times are GMT -5. The time now is 06:18 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