Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with init script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Silent-Hunter
Apprentice
Apprentice


Joined: 07 Jul 2013
Posts: 166

PostPosted: Tue Feb 24, 2015 2:25 am    Post subject: Help with init script Reply with quote

I don't understand why my script isn't working. I can run it fine by doing "/etc/init.d/msi-klm start" but if I add it to my default runlevel, it doesn't even attempt to start on boot.

Script is here:
Code:
#!/sbin/runscript

start() {
  ebegin "Starting Keyboard Light Manager"
  start-stop-daemon --start --exec /home/silent/klm.sh left red high 0 middle green high 0 right purple high 0
  eend $?
}
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Feb 24, 2015 2:42 am    Post subject: Re: Help with init script Reply with quote

Silent-Hunter wrote:
Code:
#!/sbin/runscript

Silent-Hunter ... that should probably be '/sbin/openrc-run' (assuming you have openrc-0.13.11)

Silent-Hunter wrote:
Code:
start() {
  ebegin "Starting Keyboard Light Manager"
  start-stop-daemon --start --exec /home/silent/klm.sh left red high 0 middle green high 0 right purple high 0
  eend $?
}

you should probably add a depend() ... so

Code:
depend() {
   need localmount
   use logger
}

My guess is this is probably the reason for it failing ... your klm.sh probably depends on x11 started to function, if this is the case then there should be a dependency for xdm/slim or what-have-you (assuming your using such things).

Also, having the script in /home/silent is probably not a good idea, move it to /usr/local/bin

best ... khay
Back to top
View user's profile Send private message
Silent-Hunter
Apprentice
Apprentice


Joined: 07 Jul 2013
Posts: 166

PostPosted: Tue Feb 24, 2015 4:08 pm    Post subject: Reply with quote

Thank you! runscript was fine, that's what all the other services use, and it doesn't need X11, it just uses commandline to colour my keyboard backlight.

My guess is it was the depend. Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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