Executing a command at boot time

From MEPIS Documentation Wiki

Revision as of 10:45, 21 March 2007 by Jerry bond (Talk | contribs)
Jump to: navigation, search

To execute a command at boot time as root you need to add the command in /etc/rc.local script before the "exit 0" part. To edit the file type this in Konsole or Run command:

kdesu kwrite /etc/rc.local

If you just need to run the command as regular user when KDE starts, add the command in ~/.kde/Autostart/ directory. You can either copy the program or symlink to it or add a script that runs multiple commands.

Another way

  1. Create a script in /etc/init.d directory (you have to be root)
  2. Make the script executable: "chmod +x scriptname"
  3. Set it to load automatically with update-rc.d
update-rc.d scriptname defaults 80

For more info, type: man update-rc.d

You can also use Ksys| if you prefer a GUI instead of update-rc.d (install it with apt-get install ksysv). KsysV makes it easier to choose the execution order of different scripts.

FAQ | Main Page

See also: Starting a program automatically when KDE starts

Personal tools