How to run a script in startup

I needed this feature to run a “read-only” mount for windows file system on startup (because I always hibernate Windows, so Ubuntu can’t mount it “read-write” by default on startup)

1- Write the script in a file and save it in /etc/init.d
sudo gedit /etc/init.d/my_script

2- make the file executable
chmod +x /etc/init.d/my_script

3- add the script to rc.d files
sudo update-rc.d my_script defaults

And …. it’s done.

There is a GUI tool to edit the rc.d called Boot-Up Manager (bum) , but I haven’t try it. It can be found here

Note: Many thanks to Ahmad Amr for adding me as a contributer in this blog …..

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s