Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
This always works... Code: sudo modprobe floppy I put that in a file named "other". I put that in /bin, gave myself all permissions and if I type "other" in ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39

    how do include a script at bootup?

    This always works...
    Code:
    sudo modprobe floppy
    I put that in a file named "other". I put that in /bin, gave myself all permissions and if I type "other" in the console the floppy will get mounted... if I could just get rid of that pesky password prompt for sudo...
    is there any way to have the script answer the PW request?
    I looked through the man modprobe...I did not see anything on this. But, it's always possible I miised it. and lastly

    where can I put this command or the script to make it start at bootup, like autoexec or config.sys in the DOS days?
    Any thoughts are appreciated, and thanks in advance.

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Ok, well first off what Distro do you have?
    Since loads of Distros allow you to add a modprobe to the config... After that if also kinda depents your distro. if you have a /etc/rc.d/ folder go read the files in there. Sometimes I see /etc/init.sh its kinda diffrent on a lot of Distros..
    Next from that I'd love to point at you that Password-less sudo modprobe is quite dangerous from a Security point of view

    I hope this kinda helps you.
    But for a more direct answer I'd need to know your Distro.
    Sorry
    New Users, please read this..
    Google first, then ask..

  3. #3
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,301
    I'll assume you are in Ubuntu as this is an Ubuntu help section (@Robin )

    The simple answer is that you create your script and put it in /etc/init.d then you run "sudo update-rc.d <your script name> defaults" without the quotes
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  4. #4
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39
    RobinVossen,

    I am in the Ubuntu forum, therefore my question is related to Ubuntu.

    Next from that I'd love to point at you that Password-less sudo modprobe is quite dangerous from a Security point of view
    I thought of that before I asked the question. Ultimately, it is is up to me to make the decision to take a chance on a security breach on my computer.

    Obviously, it is your option to answer or not. Regardless of your choice, it certainly is not your responsibility to make sure I follow security policies on my system.

  5. #5
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39
    elija, thank you for your helpful reply!

    create your script and put it in /etc/init.d then you run "sudo update-rc.d <your script name>
    I will try that, but would you please explain what I'm doing so I can learn from this?

    Also, I am assuming there is a space between the word "update" and "-rc.d", so it looks like "update -rc.d", is that correct? Thanks again!

  6. #6
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,301
    /etc/init.d is the directory where your startup scripts actually live.

    sudo update-rc.d <your script name> defaults

    This command will create the symlinks in the directories rc0.d - rc6.d which equate to the different run levels.

    You can get more information by running "man update-rc.d"
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  7. #7
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39
    elija:

    Thanks for explaining that. Tried it, here are the results.

    flop (the script) is in init.df

    Code:
     joe@joe-desktop:~$ ls /etc/init.d/f*
    /etc/init.d/firestarter  /etc/init.d/flop
    I tried the command in both relative and absolute:

    Code:
    joe@joe-desktop:~$ sudo update-rc.d flop > defaults
    usage: update-rc.d [-n] [-f] <basename> remove
           update-rc.d [-n] <basename> defaults [NN | SS KK]
           update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
    		-n: not really
    		-f: force
    
    joe@joe-desktop:~$ sudo update-rc.d /etc/init.d/flop > defaults
    usage: update-rc.d [-n] [-f] <basename> remove
           update-rc.d [-n] <basename> defaults [NN | SS KK]
           update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
    		-n: not really
    		-f: force
    joe@joe-desktop:~$
    What am I doing wrong? Do I need NN SS KK after the "defaults", whatever that is?

    Thanks again

  8. #8
    Just Joined! brokndodge's Avatar
    Join Date
    Feb 2006
    Location
    Arkansas, USA
    Posts
    78
    i believe you can just ad your module to the end of /etc/modules

    sudo gedit /etc/modules

    add the name of the module you want to load (not ur script) to the end of the file, save, the next reboot should automatically load you
    r module

  9. #9
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39
    brokndodge, thanks for your reply.

    However I don't understand. What do you mean by "module"? I have a script I want to execute at boot time. I don't know anything about modules.

    Please keep your answer simple so I can understand. Although I am getting better, I still know next to nothing about Linux.

    Thanks again.

  10. #10
    Just Joined!
    Join Date
    Apr 2009
    Posts
    39

    problem solved , thank you!

    elija,
    Your idea works!

    Thanks so much for your help.... a nice easy solution
    Your patience and clear explanations are appreciated

    Thank You

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...