Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to start a script?

19 views
Skip to first unread message

Frits

unread,
Feb 22, 2013, 3:45:19 PM2/22/13
to
I am trying to get a nasbox work with seagateharddisks with the headparking
issue.

I've written a script withe the name "ungreen.sh"

#!/bin/bash
hdparm -B 255 /dev/hdc
hdparm -B 255 /dev/hde

I've put it in the /etc dir and made it executible with chmod 755
/etc/ungreen.sh

Now how to run it once automaticaly at startup ? Do I have to use

update -rc.d ungreen.sh defaults 98 02

or

update -rc.local ungreen.sh defaults ?

Or is there an other way to run the script once at startup??

(Im not to familliar with unix so most of the commands are new for me)

Frits



Ivan Shmakov

unread,
Feb 22, 2013, 4:07:27 PM2/22/13
to
>>>>> Frits <nietbe...@dummy.nl> writes:

> I am trying to get a nasbox work with seagateharddisks with the
> headparking issue.

> I've written a script withe the name "ungreen.sh"

> #!/bin/bash
> hdparm -B 255 /dev/hdc
> hdparm -B 255 /dev/hde

[...]

> Now how to run it once automaticaly at startup ?

There already is a script that's run at startup and is intended
to invoke hdparm(8) as appropriate. The script is configured
via /etc/hdparm.conf, which, in your case, should probably
contain (untested):

/dev/hda {
apm = 255
}

/dev/hde {
apm = 255
}

Be sure to check the comments there, and also
/usr/share/doc/hdparm/README.Debian.gz.

[...]

--
FSF associate member #7257

Frits

unread,
Feb 23, 2013, 2:05:00 PM2/23/13
to

"Ivan Shmakov" <onei...@gmail.com> schreef in bericht
news:87ehg8a...@violet.siamics.net...
Nope, I've looked arround in the etc directory but there lives no
hdparm.conf.

By the way, my nas is a readynas duo with fw 4.1.9 so maybe the hdparm
values are in an other place.

Frits


J G Miller

unread,
Feb 23, 2013, 3:05:03 PM2/23/13
to
On Saturday, February 23rd, 2013, at 20:05:00h +0100,
Frits explained:

> Nope, I've looked arround in the etc directory but there lives no
> hdparm.conf.

Do you have the hdparm package installed?

> By the way, my nas is a readynas duo with fw 4.1.9 so maybe the hdparm
> values are in an other place.

You are posting in als.os.linux.debian so that tends to imply that
your question is with regard to a Debian installation, regardless of
hardware.

Does
man hdparm

on your system give an indication of where the configuration file
should be placed, as in

FILES
/etc/hdparm.conf

Regardless it may just be that /etc/hdparm.conf on your system
has become lost in the mists of time.

Create one with the contents advised by Ivan Shmakov,
reboot and see (provided hdparm is installed) if hdparm
runs with that new configuration.

Richard Kettlewell

unread,
Feb 23, 2013, 4:11:11 PM2/23/13
to
J G Miller <mil...@yoyo.ORG> writes:
> On Saturday, February 23rd, 2013, at 20:05:00h +0100,
> Frits explained:
>> Nope, I've looked arround in the etc directory but there lives no
>> hdparm.conf.
>
> Do you have the hdparm package installed?
>
>> By the way, my nas is a readynas duo with fw 4.1.9 so maybe the hdparm
>> values are in an other place.
>
> You are posting in als.os.linux.debian so that tends to imply that
> your question is with regard to a Debian installation, regardless of
> hardware.

From poking around on the web it looks like the readynas firmware is
based on a (old and/or stripped down) Debian - presumably either
predating the default hdparm.conf, or having removed it for some (good
or bad) reason.

--
http://www.greenend.org.uk/rjk/
0 new messages