[ubuntu-us-nm] Boot script run as root

w robbi wlrobbi at gmail.com
Fri Apr 11 22:02:27 BST 2008


I had added that to my /etc/rc.local

At a command prompt sudo gedit /etc/rc.local  at the end of the file add the
command.  Every time the computer boot, the command is ran as root.

On Fri, Apr 11, 2008 at 2:34 PM, Leif Gregory <ldgregory69 at gmail.com> wrote:

> Hello all,
>
> My name is Leif and I guess I'll be the FNG till the next person subs.
> I'm relatively new to Linux. Played off and on over the years with
> Debian, Red Hat, Mandrake and a couple others pretty much in dual boot
> environments. Shortly after installing Breezy Badger, I decided to make
> the head on plunge and wiped Windows from all the home machines.
> Haven't looked back since.
>
> I'm a geek and love getting dirty tweaking things, but I still consider
> myself a n00b in Linux.
>
> So, to start the party off right, I figured I'd throw out a question
> I've been unable to find an answer to.
>
> To prevent my laptop hard drive from going to an early grave, I've been
> using hdparm to set the Advance Power Management settings to 254 in
> order to reduce the number of load/unload cycles.
>
> i.e. hdparm -B 254 /dev/sda
>
> hdparm requires su privileges and so I was doing this manually at
> first. Sometimes I'd forget. So then I made a quicky script and threw
> that into sessions with gksudo so when I log in, I get the password
> prompt and it runs and all is good.
>
> The downside is that one, it's annoying, and two, I have to log
> in so that it runs. I'd like to set it up so that the script runs
> during boot before login and does so with su privileges where I don't
> have to type in a password for it.
>
> I've googled all over and either I just am not getting the search terms
> correct, or it's not something people do often enough to take the time
> to write about.
>
> I tried messing with sudoers so that my user account could run hdparm
> without a password, but never could get it working. If I can't do the
> boot thing, then I'll go back to that and see if you all can help.
>
> Any ideas? Appreciate the help.
>
> --
> Leif Gregory
> Power Wagon Registry:  http://powerwagonregistry.org
> Truck Hacks:                http://trucks.PCWize.com
> Geocaching:                    http://gps.PCWize.com
> PHP Tutorials and snippets:    http://www.DevTek.org
>
> --
> ubuntu-us-nm mailing list
> ubuntu-us-nm at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-nm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-nm/attachments/20080411/76174ecb/attachment.htm 


More information about the ubuntu-us-nm mailing list