Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(openrc) initscript won't start
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 204

PostPosted: Wed Apr 28, 2010 4:29 pm    Post subject: (openrc) initscript won't start Reply with quote

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
View user's profile Send private message
pianosaurus
l33t
l33t


Joined: 19 Apr 2004
Posts: 944
Location: Bash$

PostPosted: Sun May 02, 2010 11:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 204

PostPosted: Sun May 02, 2010 11:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum