两种方法:
1. 编辑/etc/init.d/example,将example +x权限,rc-update:
1
2
3
|
vim /etc/init .d /example chmod
+x /etc/init .d /example rc-update add example default |
2. 编辑/etc/local.d/example.start,将example +x:
1
2
|
vim /etc/local .d /example .start chmod
+x /etc/local .d /example .start |
方法1将脚本单独设成一个服务,而方法2作为local服务里面的一部分。注意方法2的文件名为*.start。