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 10-31-2012, 01:32 AM   #1
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Rep: Reputation: 3
run script at startup or after login


hi,

i have one script which i want to run at boot time or after login can any one help me, how to do this.
 
Old 10-31-2012, 02:31 AM   #2
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
If you want the script to be execute on system boot time. You can set @reboot parameter in cron

@reboot /path/to/script


http://www.thegeekstuff.com/2009/06/...ntab-examples/
http://www.cyberciti.biz/faq/linux-e...system-reboot/
 
Old 10-31-2012, 05:03 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
or
if it is cent and depending on what it is you need to do
create a script and drop it in "/etc/profile.d"

but be VERY careful that is dose NOT conflict with some other script that is NEEDED

Last edited by John VV; 10-31-2012 at 05:05 AM.
 
Old 10-31-2012, 05:15 AM   #4
v11pandey
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Rep: Reputation: Disabled
need to give execute permission for the script placed under /etc/profile.d/
 
Old 10-31-2012, 05:22 AM   #5
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103


Another option is to include in a start up file like /home/user/.xinitrc or /home/user/.config/openbox/autostart . Depends on your set up. ( XFCE , GNOME , Openbox et cettera).
 
Old 10-31-2012, 06:59 AM   #6
adol83
Member
 
Registered: Jul 2012
Location: Rome
Distribution: RHEL6, CentOs
Posts: 92

Rep: Reputation: 1
/etc/init.d/rc.n

here you can set the "Snn" process and the "Knn" process where "nn" is the number of the process. I warn you do not edit existing files because your system could not boot up anymore.
 
Old 10-31-2012, 04:01 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
it boils down to
just WHAT is it doing
what dose it need to do
then the "best" ( or a "good" place) and or how it is ran can be determined

a start up cron job
a user specific session
universal settings
a back up script
and so on
 
  


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
startup script after login ddaas Ubuntu 3 01-11-2011 03:32 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 03:53 AM
Run Script at Startup?? usaf_sp SUSE / openSUSE 5 11-11-2005 02:43 PM
Run a script at startup iain.ross Linux - Newbie 8 08-27-2004 05:03 PM
How to run script on startup Angelis Linux - General 1 11-16-2003 06:45 AM


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