View previous topic :: View next topic |
Author |
Message |
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Tue Feb 24, 2015 2:25 am Post subject: Help with init script |
|
|
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 |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Feb 24, 2015 2:42 am Post subject: Re: Help with init script |
|
|
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 |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Tue Feb 24, 2015 4:08 pm Post subject: |
|
|
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 |
|
|
|