| View previous topic :: View next topic |
| Author |
Message |
V10lator Apprentice


Joined: 11 Jul 2004 Posts: 204
|
Posted: Wed Apr 28, 2010 4:29 pm Post subject: (openrc) initscript won't start |
|
|
Hi there,
I'm trying to write a init script that should set different schedulers for my drives.
This is working fine if I start it with:
/etc/init.d/scheduler-set start
but it won't start automatically at bootup.
Here are some hints:
| Quote: | ls -l /etc/runlevels/boot/
lrwxrwxrwx 1 root root 21 17. Sep 2009 alsasound -> /etc/init.d/alsasound
lrwxrwxrwx 1 root root 20 16. Sep 2009 bootmisc -> /etc/init.d/bootmisc
lrwxrwxrwx 1 root root 23 15. Sep 2009 consolefont -> /etc/init.d/consolefont
lrwxrwxrwx 1 root root 25 15. Sep 2009 device-mapper -> /etc/init.d/device-mapper
lrwxrwxrwx 1 root root 22 17. Sep 2009 fbcondecor -> /etc/init.d/fbcondecor
lrwxrwxrwx 1 root root 16 16. Sep 2009 fsck -> /etc/init.d/fsck
lrwxrwxrwx 1 root root 20 16. Sep 2009 hostname -> /etc/init.d/hostname
lrwxrwxrwx 1 root root 19 16. Sep 2009 hwclock -> /etc/init.d/hwclock
lrwxrwxrwx 1 root root 19 16. Sep 2009 keymaps -> /etc/init.d/keymaps
lrwxrwxrwx 1 root root 22 16. Sep 2009 localmount -> /etc/init.d/localmount
lrwxrwxrwx 1 root root 15 8. Dez 10:08 lvm -> /etc/init.d/lvm
lrwxrwxrwx 1 root root 25 8. Dez 15:43 microcode_ctl -> /etc/init.d/microcode_ctl
lrwxrwxrwx 1 root root 19 16. Sep 2009 modules -> /etc/init.d/modules
lrwxrwxrwx 1 root root 16 16. Sep 2009 mtab -> /etc/init.d/mtab
lrwxrwxrwx 1 root root 18 16. Sep 2009 net.lo -> /etc/init.d/net.lo
lrwxrwxrwx 1 root root 19 24. Dez 17:48 pciparm -> /etc/init.d/pciparm
lrwxrwxrwx 1 root root 18 16. Sep 2009 procfs -> /etc/init.d/procfs
lrwxrwxrwx 1 root root 16 16. Sep 2009 root -> /etc/init.d/root
lrwxrwxrwx 1 root root 25 28. Apr 17:34 scheduler-set -> /etc/init.d/scheduler-set
lrwxrwxrwx 1 root root 16 16. Sep 2009 swap -> /etc/init.d/swap
lrwxrwxrwx 1 root root 18 16. Sep 2009 sysctl -> /etc/init.d/sysctl
lrwxrwxrwx 1 root root 24 16. Sep 2009 termencoding -> /etc/init.d/termencoding
lrwxrwxrwx 1 root root 19 16. Sep 2009 urandom -> /etc/init.d/urandom |
(added with "rc-update add scheduler-set boot")
I changed rc_logger to YES in /etc/rc.conf but there is nothing about the script scheduler-set in the log.
here is the script (I know it's quick & dirty)
| Code: | #!/sbin/runscript
# Copyright 2010 TAXI
# Distributed under the terms of the GNU General Public License v3
# $Header: /etc/init.d/scheduler-set,v 1.0 2010/04/28 17:49:37 vapier Exp $
depend() {
need localmount
need bootmisc
}
start() {
ebegin "Setting schedulers for drives"
/bin/echo cfq > /sys/block/sda/queue/scheduler
/bin/echo deadline > /sys/block/sr0/queue/scheduler
eend $?
}
|
P.S. Sorry for my bad english  |
|
| Back to top |
|
 |
pianosaurus l33t


Joined: 19 Apr 2004 Posts: 944 Location: Bash$
|
Posted: Sun May 02, 2010 11:01 pm Post subject: |
|
|
Is your script set executable? I assume it is required, since all the ones from gentoo are. _________________ PKA Cuber
Please add [SOLVED] to the subject of your original post when you feel that your problem is resolved.
Adopt an unanswered post |
|
| Back to top |
|
 |
V10lator Apprentice


Joined: 11 Jul 2004 Posts: 204
|
Posted: Sun May 02, 2010 11:07 pm Post subject: |
|
|
it is:
| Quote: | ls -l /etc/init.d/scheduler-set
-rwxr-xr-x 1 root root 392 28. Apr 17:53 /etc/init.d/scheduler-set |
//EDIT:
I installed verynice today and the init script shipped with it won't start automatically, too:
| Code: | #!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/verynice/files/verynice,v 1.4 2008/02/01 12:31:24 flameeyes Exp $
depend() {
after checkroot root
}
start() {
ebegin "Starting verynice"
/usr/sbin/verynice -d /var/run/verynice.pid
eend $?
}
stop() {
ebegin "Stopping verynice"
start-stop-daemon --stop --quiet --pidfile=/var/run/verynice.pid
eend $?
}
|
//EDIT²: Got it!
I startet the command "/lib/rc/bin/rc-depend -u" manually and realized that there were a clock skew with the config file of sshd.
The command "find /etc/conf.d -exec touch {} +" fixed the issue  |
|
| Back to top |
|
 |
|