LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What are the scripts accessed by the computer when linux starts up? (https://www.linuxquestions.org/questions/linux-newbie-8/what-are-the-scripts-accessed-by-the-computer-when-linux-starts-up-913349/)

venom4u31 11-13-2011 03:36 PM

What are the scripts accessed by the computer when linux starts up?
 
I would like to know the location of the files that linux uses when it starts up.

L.E. I would prefer for the ubuntu version.


Even more speciffic: Can you tell me if it is among either of those files?


/etc/startup
/etc/bash/startup
~/.start.rc
~/.profile
/etc/profile

TobiSGD 11-13-2011 03:46 PM

That depends on the distribution you use. Some use the System V init system, like Debian. Those store the scripts usually in /etc/init.d.
Other distros use a more BSD like init system, like Slackware, which is storing the scripts in /etc/rc.d.
Ubuntu and derived distros usually use Upstart as init system, I don't know where it stores the scripts.
Fedora uses Systemd, which has its modules written in C, as far as I know.

venom4u31 11-13-2011 03:50 PM

Quote:

Originally Posted by TobiSGD (Post 4523141)
That depends on the distribution you use. Some use the System V init system, like Debian. Those store the scripts usually in /etc/init.d.
Other distros use a more BSD like init system, like Slackware, which is storing the scripts in /etc/rc.d.
Ubuntu and derived distros usually use Upstart as init system, I don't know where it stores the scripts.
Fedora uses Systemd, which has its modules written in C, as far as I know.

If you find out about Ubuntu, please tell me.

the dsc 11-13-2011 04:52 PM

I don't really know anything about upstart, but it seems that the scripts are also on /etc/init.d:

http://upstart.ubuntu.com/getting-started.html

However, the correct way of changing this sort of thing often is not just creating a script and placing it there, it has to be "installed" through some command. On sysv (debian and some others) it is "update-rc.d", on upstart I don't know. But this link I gave seems to have these instructions.

These files you've listed, if/when they exist, they may be used at some later point on the startup anyway. But there will be quite a bit of stuff that happens before these are executed, if/when they are.

schneidz 11-14-2011 09:43 AM

if you want to add something to startup i would edit this file (e.g.-):
Code:

xbmc@XBMCLive:~/win/stuff/clips$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo USB0 | tee /proc/acpi/wakeup &

/home/xbmc/bin/masq.ksh &

/home/xbmc/bin/random-vid.ksh &

/home/xbmc/bin/onion.ksh &

exit 0

another possibility would be to add an @reboot line to the users crontab.


All times are GMT -5. The time now is 05:03 PM.