1 |
Mike Frysinger wrote: |
2 |
> On Sunday 20 August 2006 08:01, paul kölle wrote: |
3 |
>> How do I get the name of the called script in /etc/init.d? Better ideas? |
4 |
> |
5 |
> use $SVCNAME |
6 |
> |
7 |
> see the sshd init.d script for some examples |
8 |
thanks mike, you got me started ;) |
9 |
|
10 |
actually there is plenty of choice here: |
11 |
|
12 |
gentoo ~ # cat /etc/init.d/dummy |
13 |
#!/sbin/runscript |
14 |
|
15 |
|
16 |
start() { |
17 |
einfo "$(set)" |
18 |
} |
19 |
|
20 |
leads to: |
21 |
gentoo ~ # ls -l /etc/init.d/ |
22 |
. |
23 |
-rwxr-x--- 1 root root 267 Aug 20 17:10 dummy2 |
24 |
lrwxrwxrwx 1 root root 18 Aug 20 17:12 dummy2.v1 -> /etc/init.d/dummy2 |
25 |
. |
26 |
|
27 |
gentoo ~ # /etc/init.d/dummy2.v1 start |
28 |
* rc_name is: dummy2.v1 |
29 |
* myservice is: dummy2.v1 |
30 |
* myscript is: /etc/init.d/dummy2.v1 |
31 |
* SVCNAME is: dummy2.v1 |
32 |
* BASH_ARGV[1]: /etc/init.d/dummy2.v1 |
33 |
* BASH_SOURCE[0]: /etc/init.d/dummy2.v1 |
34 |
|
35 |
I'll stick with SVCNAME for now ;) |
36 |
|
37 |
thanks again, |
38 |
Paul |
39 |
|
40 |
-- |
41 |
gentoo-dev@g.o mailing list |