Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

I'd like to run a script at the startup of my system but only at that time. I did some experimenting and found that /etc/profile.d is NOT the place to put this sort of script as it runs anytime someone logs in. I simply want the script to run at startup. It should be run as root.

asked 08 Dec '10, 20:24

Andy's gravatar image

Andy
2972920
accept rate: 14%




There's three ways I can think of doing this offhand:

  1. Put the command in /etc/rc.local.
  2. Add it to root's crontab with the time @reboot.
  3. dd it as a script in /etc/init.d/ and then modify your system's start up by linking it to /etc/rc3.d/S##scriptname and /etc/rc5.d/S##scriptname.

The first method is probably the most straightforward and will work on the largest number of distributions.

link

answered 09 Dec '10, 12:13

ranxxerox's gravatar image

ranxxerox
6316
accept rate: 66%

1 did the trick!

(09 Dec '10, 18:13) Andy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: 08 Dec '10, 20:24

Seen: 1,223 times

Last updated: 09 Dec '10, 12:13

powered by OSQA