# [SOLVED] openvpn up/down scripts don't get called

## kernelhacker

Hi again!

I am using openvpn-2.1_rc9. Since the initscripts got changed regarding the up- and downscripts i have a problem:

The up.sh script get's called, but the SVCNAME variable seems to be empty, resulting in not calling my /etc/openvpn/openvpn-dummy-up.sh and /etc/openvpn/openvpn-dummy-down.sh scripts.

/etc/init.d/openvpn-dummy is a symlink to /etc/init.d/openvpn and that seems to be fine. When starting the script i get the correct message:

```

 * Starting openvpn-dummy ...

```

Thx for any advice,

Stefan

----------

## snIP3r

hi!

looking in my /etc/openvpn/ i cannot see these dummy-scripts:

```

area52 openvpn # ls -la

total 64

drwxr-xr-x  3 root root 4096 Aug 20 14:58 .

drwxr-xr-x 68 root root 8192 Aug 26 04:23 ..

-rw-r--r--  1 root root    0 Aug 20 14:58 .keep_net-misc_openvpn-0

-rw-r--r--  1 root root 5317 Apr 13 00:46 area52.crt

-rw-------  1 root root 1675 Apr 13 00:46 area52.key

-rw-r--r--  1 root root 1614 Apr 13 00:45 ca.crt

drwxr-xr-x  2 root root    6 Jun 25  2007 chroot

-rw-r--r--  1 root root  245 Apr 13 00:16 dh1024.pem

-rw-r--r--  1 root root  424 Apr 13 00:47 dh2048.pem

-rwxr-xr-x  1 root root  943 Aug 20 14:58 down.sh

-rw-------  1 root root   46 Aug 26 08:53 ipp.txt

-rw-------  1 root root  232 Aug 26 08:55 openvpn-status.log

-rw-r--r--  1 root root  888 Aug 20 07:58 openvpn.conf

-rw-------  1 root root  636 Apr 13 00:46 ta.key

-rwxr-xr-x  1 root root 2560 Aug 20 14:58 up.sh

```

did you do a etc-update after the upgrade?

HTH

snIP3r

----------

## kernelhacker

Hi snIP3r,

Thanks for taking a look!

 *snIP3r wrote:*   

> hi!
> 
> looking in my /etc/openvpn/ i cannot see these dummy-scripts:
> 
> [SNIP]
> ...

 

Well, these dummy-scripts are mine  :Wink: 

/etc/init.d/openvpn calls a script calles up.sh and down.sh. And these two scripts should call the up and down scripts which belong to a single openvpn config. 

So /etc/init.d/openvpn-joe should call up.sh which then should call openvpn-joe-up.sh. But the parameter "openvpn-joe", which should get passed as SVCNAME, seems to get lost somewhere - that's the problem.

Any ideas?

Stefan

----------

## kernelhacker

Bump - bobody with an idea?

----------

## snIP3r

 *kernelhacker wrote:*   

> Bump - bobody with an idea?

 

sorry, none from me  :Sad: 

----------

## Rion

patches from here wfm

https://bugs.gentoo.org/show_bug.cgi?id=234667

----------

## kernelhacker

 *Rion wrote:*   

> patches from here wfm
> 
> https://bugs.gentoo.org/show_bug.cgi?id=234667

 

That worked fine! Thx! Here is the workaround, so it's easier to find:

Modify /etc/init.d/openvpn as follows for the startup part:

```

<               -- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon

${args}

---

>               -- --config "${VPNCONF}" --writepid "${VPNPID}" --setenv SVCNAME "${SVCNAME}" \

>               --setenv PEER_DNS "${PEER_DNS}" --daemon ${args}

```

Thanks again,

Stefan

----------

## UberLord

The shutdown part is not needed. It cannot possibly work  :Smile: 

----------

## kernelhacker

 *UberLord wrote:*   

> The shutdown part is not needed. It cannot possibly work 

 

Well, you are right... I did not care a lot about the shutdown part, as i don't need it  :Wink: 

I'll remove that nonsense!

----------

