Adding a custom service to rc-service
-
- Offline
- 2 years 8 months ago
- 2013-09-19
Hi!
I've installed alpine linux 3.2.2 on a raspberry pi 2.
What I want to do is getting my executable (located in /root/csys/acs2/actc) being executed on startup.
How should I do that?
On other distributions I could change /etc/inittab to launch my program (or my startup script) instead of the login executable.
On alpine linux, I think I should add a service, and configure it to be launched at "default" runlevel with rc-service, is it correct?
To configure that, I tried creating a file in "/etc/runlevels/default" named "actc", with the following:
#!/sbin/openrc-run depend() { after sshd } start() { /root/csys/acs2/actc } stop() { killall actc }
That is pretty minimal, but is that supposed to work?
Am I missing something more?
If I try "rc-service actc" it says "service actc does not exist", then I guess I AM definitively missing something :)
Any suggestions? Any docs?
Thanks!
Davide
Move the actc openrc-script to /etc/init.d and check permissions.
To add it to the default runlevel, use "rc-update add actc".
You could also try