You are not logged in.

#1 2006-07-20 15:44:11

allucid
Member
Registered: 2006-01-06
Posts: 259

commands to run at startup

Where do I put commands that I want run at startup? Right now I just dumped them in /etc/rc.sysinit but I'm not sure that is the proper way to do things.

Offline

#2 2006-07-20 15:51:19

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: commands to run at startup

Just out of curiousity, which commands are you running?

Anyway, you'd want to put them in /etc/rc.local

Offline

#3 2006-07-20 16:18:18

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: commands to run at startup

hdparm -u1 -c3 -d1 -m16 /dev/hda
echo 1024 > /proc/sys/dev/rtc/max-user-freq

Offline

#4 2006-07-20 16:25:29

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: commands to run at startup

You have just to them in /etc/rc.local, with a & after them.


Mortuus in anima, curam gero cutis

Offline

#5 2006-07-20 18:59:48

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: commands to run at startup

For /proc/sys settings, I prefer to use /etc/sysctl.conf e.g. your rtc setting:

dev.rtc.max-user-freq=1024

Offline

#6 2006-07-21 08:22:08

tmadhavan
Member
From: Wales :D
Registered: 2004-03-26
Posts: 441

Re: commands to run at startup

patroclo7 wrote:

You have just to them in /etc/rc.local, with a & after them.

Is that necessary for these commands? I thought it was only for apps you run with the window manager? Well not only for them, but mainly...

Offline

#7 2006-07-21 13:14:05

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: commands to run at startup

It is not necessary but it won't hurt, either. It backgrounds the process but these commands should exit fairly quickly anyways.

Offline

#8 2006-07-21 14:48:32

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: commands to run at startup

IIRC you can also run such commands earlier in the boot process using modprobe.conf.

Offline

#9 2006-07-21 15:10:47

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: commands to run at startup

Since my devices don't get DMA by default, startup is a LOT slower if it waits until rc.local before turning on DMA - that's after starting all the other daemons... I saved this as /etc/rc.d/hdparm and added "hdparm" as number one in the DAEMONS array in /etc/rc.conf - since hdparm is then run before most of the daemons, the daemons will start faster:

#!/bin/bash

# Turn on 32bit I/O, DMA and multiple sector I/O on harddrives
hdparm -qc1 -qd1 -qm16 /dev/hda /dev/hdb

# Turn on 32bit I/O and DMA on ATAPI-devices
hdparm -qc1 -qd1 /dev/hdc /dev/hdd
Gullible Jones wrote:

IIRC you can also run such commands earlier in the boot process using modprobe.conf.

Can you give me a pointer how? This would be even better than my way, as DMA will hopefully speed up loading the uevents...

Offline

#10 2006-07-27 17:06:41

bigbob73
Member
From: Fort Worth, Texas
Registered: 2006-07-19
Posts: 89

Re: commands to run at startup

jaboua wrote:

Since my devices don't get DMA by default, startup is a LOT slower if it waits until rc.local before turning on DMA - that's after starting all the other daemons... I saved this as /etc/rc.d/hdparm and added "hdparm" as number one in the DAEMONS array in /etc/rc.conf - since hdparm is then run before most of the daemons, the daemons will start faster:

#!/bin/bash

# Turn on 32bit I/O, DMA and multiple sector I/O on harddrives
hdparm -qc1 -qd1 -qm16 /dev/hda /dev/hdb

# Turn on 32bit I/O and DMA on ATAPI-devices
hdparm -qc1 -qd1 /dev/hdc /dev/hdd
Gullible Jones wrote:

IIRC you can also run such commands earlier in the boot process using modprobe.conf.

Can you give me a pointer how? This would be even better than my way, as DMA will hopefully speed up loading the uevents...

try putting them in /etc/rc.sysinit and make it the first line

Offline

Board footer

Powered by FluxBB