Author Topic: Where to add commands at boot time  (Read 2482 times)

EddieA

  • Zen Monk
  • **
  • Posts: 70
  • Karma: +3/-0
    • View Profile
Where to add commands at boot time
« on: August 30, 2012, 09:29:50 am »
Is /etc/rc.local the right place, or will this get overwritten at any point.

Which script is the best for boot time options, like setting disk spindown options.

Cheers.

stuartiannaylor

  • Guest
Re: Where to add commands at boot time
« Reply #1 on: August 30, 2012, 12:37:14 pm »
Not what you asked for but a reply.

I think its /etc/init.d/bootmisc.sh

Think you might have to play with the init.d settings.

Disk spindown can be a problem though as all the services might bring the disks up.

If your testing stop your services and start them up one at a time.

You might find on an active system this is impossible.

Also fstab has some parameters about disk access.
« Last Edit: August 30, 2012, 01:29:56 pm by stuartiannaylor »

christian

  • Guest
Re: Where to add commands at boot time
« Reply #2 on: August 30, 2012, 01:26:07 pm »
Does this help?

stuartiannaylor

  • Guest
Re: Where to add commands at boot time
« Reply #3 on: August 30, 2012, 01:51:00 pm »
I had a snoop around out of interest.

Quote
#! /bin/sh
### BEGIN INIT INFO
# Provides:          rc.local
# Required-Start:    $remote_fs $syslog $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO


PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

do_start() {
        if [ -x /etc/rc.local ]; then
                [ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"

So I guess /etc/rc.local would do the trick after all.
You still might be hampered that services such as mysql... will keep accessing the disks and spin down might never happen.

EddieA

  • Zen Monk
  • **
  • Posts: 70
  • Karma: +3/-0
    • View Profile
Re: Where to add commands at boot time
« Reply #4 on: August 31, 2012, 12:16:22 am »
Thanks.

This is not for the disk I have Zentyal loaded on.  I have 5 other disks in the machine as a media library, and it's those I want to spin down.

Cheers.

stuartiannaylor

  • Guest
Re: Where to add commands at boot time
« Reply #5 on: August 31, 2012, 12:20:06 am »
fstab then :)

EddieA

  • Zen Monk
  • **
  • Posts: 70
  • Karma: +3/-0
    • View Profile
Re: Where to add commands at boot time
« Reply #6 on: August 31, 2012, 12:35:57 am »
fstab then :)
How.  AFAIK That only controls the mounts.

I need to use hdparm to set the spindown time.  Unless you know a different way.

Cheers.

stuartiannaylor

  • Guest