How to run script at startup

6 views
Skip to first unread message

Simran Jeet

unread,
Aug 10, 2015, 12:19:27 AM8/10/15
to lugg...@googlegroups.com
I have tried to run a script at startup. But it didn't worked. Can you
tell me how to do this?

Mandeep Singh

unread,
Aug 10, 2015, 12:33:07 AM8/10/15
to lugg...@googlegroups.com
On Mon, Aug 10, 2015 at 9:49 AM, Simran Jeet <jeet.s...@gmail.com> wrote:
> I have tried to run a script at startup. But it didn't worked. Can you
> tell me how to do this?

Can you please tell which method did you try that didn't work?

--
Mandeep Singh
http://mandeep7.wordpress.com
https://github.com/mandeeps708

Bharat Wadhawan

unread,
Aug 13, 2015, 1:35:17 AM8/13/15
to lugg...@googlegroups.com
Hi Simranjeet,
I recommend getting root access of the system.
Enter grub at boot startup. change linux parameter and and add '1' to the line starting with word 'linux'. This will make you enter single user mode (root access). you can either change your root password or follow the instructions given below.
First create your script executable as follows : chmod +x <your script file name>
Second put it in the /etc/init.d directory: cp <your script file name> /etc/init.d/
Third create a symlink to /etc/rc.d directory: ln -s /etc/init.d/<your script file name> /etc/rc.d
And don't forget to add '#!/bin/sh' to the top of the file.

I hope it satisfies your problem.

Regards,
Bharat Wadhawan

Simran Jeet

unread,
Sep 2, 2015, 9:41:48 AM9/2/15
to lugg...@googlegroups.com
Problem Solved. Thanks Bharat.


> Regards,
> Bharat Wadhawan
>
> --
> Whether you think you can or you cannot you are absolutely right.
> ---
> You received this message because you are subscribed to the Google Groups
> "Linux User Group , Ludhiana" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to luggndec+u...@googlegroups.com.
> Visit this group at http://groups.google.com/group/luggndec.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/luggndec/CAAoD3tZMbzP53s0e7T%3D%3DH_EYFdoq7t_ZC5S541PhQTNzgq9t9g%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages