[Ubuntu] Executing a script at startup and shutdown

Last update on July 29, 2009 11:37 AM by jak58
Published by jak58

[Ubuntu] Executing a script at startup and shutdown





To execute a script at startup of Ubuntu

Edit /etc/rc.local and add your commands.
The script must always end with an un exit 0

To execute a script at startup


Put your script in /etc/rc0.d
and make it executable (sudo chmod +x myscript)

Note that : The scripts in this directory are executed in alphabetical order.
The name of your script must begin with K99 to run at the right time.

To execute a script at shutdown


Put your script in /etc/rc6.d
and make it executable (sudo chmod +x myscript)

Note that: The scripts in this directory are executed in alphabetical order.
The name of your script must begin with K99 to run at the right time.
Best answers for « Executing a script at startup and shutdown » in :
Execute a script a startup and shutdown Show Execute a script a startup and shutdown The trick works Windows XP, Vista and 7, but the method varies depending on your edition of Windows. For professional or full editions Start the policy editor of the local group: Start Menu> Run> Type...
Shell script for telnet and run commands Show Shell script for telnet and run commands Issue Solution Note Issue I have made a shell script which can telnet automatically and run commands on the other machine and end the telnet session without any interact from the user, only he...
Start/stop a service using command line ShowStart/stop a service using command line The netsh tool (netsh.exe) can automate the startup or shutdown of a service through the following command line: To start a service: Net start name_of_service To stop a service:...
Unable to run executable files (. Exe) ShowUnable to run executable files (. Exe) First Solution Second solution My programs are launching no more It may happen that only executable files aren’t eager open properly: either you have the dialog box "Open With", it opens with...
[Windows] How to disable scan disk at Start up Show[Windows] How to disable scan disk at Start up It happened almost all the time when windows are improperly shut down after a troubleshoot that scandisk will run on the next reboot to check the contents of the hard disk. (see below...
Download Chrono Shutdown ShowIt is sometimes necessary to restart or shut down your computer in your absence. It is possible to switch off from the basic functions of Windows, but with time. Chrono Shutdown is a free program to program shutdown or reboot your computer at...
Operating Systems - Windows - Tips and Tricks - Using Windows ShowRestart Windows 9x without rebooting When you go to restart Windows, you click on Start, Shut Down, and then Restart. To restart Windows wthout having to restart the computer, simply hold while clicking on OK. A shortcut for shutting down...
User management in Windows NT ShowThe notion of a user Windows NT is an operating system which manages sessions, meaning that when the system is started, it is necessary to log in with a user name and password. When Windows NT is installed, the administrator account is created by...
Execution phase of a project ShowExecution phase Preparation Before beginning the execution of the work, it is necessary to take the time to break the project down into tasks in order to plan the performance of these tasks and determine what resources need to be mobilized....