1 |
James Yonan wrote: |
2 |
> Hi, |
3 |
> |
4 |
> I'm new to Gentoo and I'm trying to convert the RedHat init script for OpenVPN |
5 |
> over to Gentoo's format. Though I'm still learning the Gentoo way of writing |
6 |
> init scripts, I would like to suggest the following additions to runscript.sh: |
7 |
|
8 |
> [....] |
9 |
> (2) Condrestart is a useful init script method, often seen in RH init scripts. |
10 |
> It basically says "restart only if service is already running". It is |
11 |
> commonly used to restart a daemon after a software update. OpenVPN needs it |
12 |
> so that the VPN daemon can be restarted if a network adaptor gets a new IP |
13 |
> address from a DHCP server. In cases like these, you obviously don't want to |
14 |
> restart the daemon unless it is already running. Condrestart becomes |
15 |
> breathtakingly simple if started() above is defined: |
16 |
> |
17 |
> condrestart() { |
18 |
> started || restart |
19 |
> } |
20 |
> |
21 |
> If there are better ways of doing these things in Gentoo, please let me know. |
22 |
> Otherwise, I can send a formal patch of my changes to runscript.sh |
23 |
|
24 |
I don't know the soultion for your problem but I have written a simple |
25 |
script for |
26 |
openvpn, which I use with success on a bunch of machines. It is very |
27 |
"gentooish" |
28 |
because it puts the configuration in /etc/conf.d/openvpn. |
29 |
Take a look at it, maybe it can be useful. |
30 |
|
31 |
marko |