Skip to content
Down Script Not Being Run
Got a problem with Viscosity or need help? Ask here!
I use up/down scripts to setup my routes on openvpn. I have no problem with the UP script running on connect, but the DOWN script doesn't seem to be initiated upon Disconnect from the menubar.
My relevant commands under Advanced tab:
- I've checked the Detail logs, and there is no reference to my viscosity-down3.sh
- Adding echo "test" > itworks.log to the script, confirms that it was never started.
My relevant commands under Advanced tab:
Code: Select all
Can anyone confirm if their own DOWN scripts are being run? Or am I overlooking something obvious (the likely answer) . Thanks!resolv-retry infinite
up viscosity-up3.sh
down viscosity-down3.sh
verb 3
script-security 2
route-nopull
Hi bulljit,
OpenVPN up/down scripts are entirely handled by OpenVPN itself. Try checking the Console log for any warnings or errors regarding your script from OpenVPN.
An OpenVPN down script is run once the tun/tap interface for the connection is closed. It's possible that if your connection is doing a restart (rather than a full disconnect), and the interface is set to persist, it may never get called. You could test using a "down-pre" script instead.
Finally, if you're still stuck, you can use Viscosity's AppleScript support to call your shell script as part of a "Disconnected" script.
Cheers,
James
OpenVPN up/down scripts are entirely handled by OpenVPN itself. Try checking the Console log for any warnings or errors regarding your script from OpenVPN.
An OpenVPN down script is run once the tun/tap interface for the connection is closed. It's possible that if your connection is doing a restart (rather than a full disconnect), and the interface is set to persist, it may never get called. You could test using a "down-pre" script instead.
Finally, if you're still stuck, you can use Viscosity's AppleScript support to call your shell script as part of a "Disconnected" script.
Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Thank you for your suggestions, but down-pre didn't work, and running the command with Applescript had it's own issues concerning route and administrative privileges.
But, I figured out the problem...
When management sends sigterm, it would crash. This is reproducible each time. And of course with the crash, the down script could not be run.
Anyways, my problem is now fixed, simply by "Re-Importing" my Connection files... Thought I would just post this for someone who comes across the same issue in the future.
But, I figured out the problem...
When management sends sigterm, it would crash. This is reproducible each time. And of course with the crash, the down script could not be run.
Code: Select all
What I can't figure out is when I duplicate the server, and connect, it doesn't report any MANAGEMENT: CMD, doesn't crash, and therefore works as expected.7/10/11 3:52:33 PM openvpn[42949] MANAGEMENT: CMD 'signal SIGTERM'
7/10/11 3:52:35 PM com.apple.ReportCrash.Root[42975] 2011-07-10 15:52:35.000 ReportCrash[42975:1407] Saved crash report for openvpn[42949] version ??? (???) to /Library/Logs/DiagnosticReports/openvpn_2011-07-10-155234_localhost.crash
Anyways, my problem is now fixed, simply by "Re-Importing" my Connection files... Thought I would just post this for someone who comes across the same issue in the future.
Hi bulljit,
Glad to hear you found a solution - and thanks for posting it incase it comes up for others.
OpenVPN crashing is quite bizarre - at a guess I'd put it down to a permissions problem with the connection's configuration folder (which may explain why duplicating/reimporting it worked).
Finally, if for some reason you ever need to, it is possible to run AppleScript commands with Admin rights as outlined here (although it isn't pretty).
Cheers,
James
Glad to hear you found a solution - and thanks for posting it incase it comes up for others.
OpenVPN crashing is quite bizarre - at a guess I'd put it down to a permissions problem with the connection's configuration folder (which may explain why duplicating/reimporting it worked).
Finally, if for some reason you ever need to, it is possible to run AppleScript commands with Admin rights as outlined here (although it isn't pretty).
Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
- Posts: 13
- Joined: Wed Apr 14, 2010 9:41 am
I wanted to add my 2 cents to this. In a previous version of Viscosity, I did not have to manually specify the down command to get the dnsdown script to run - didn't Viscosity automatically run 'dnsdown.py' if you exited or disconnected? (provided you enabled DNS?)
So I observed the same problem being reported here, which is that when Viscosity exited (or you disconnect), the down script didn't run. And then I thought of adding the script explicitly with the down command under Advanced, and now it runs.
This seems to be a behavior change. I also upgraded to 10.7 Lion recently but that doesn't seem relevant - but it's another data point.
Thoughts?
So I observed the same problem being reported here, which is that when Viscosity exited (or you disconnect), the down script didn't run. And then I thought of adding the script explicitly with the down command under Advanced, and now it runs.
This seems to be a behavior change. I also upgraded to 10.7 Lion recently but that doesn't seem relevant - but it's another data point.
Thoughts?
Hi MasterYous,
Viscosity stopped using up/down scripts to implement DNS support as of version 1.3.0. DNS support is all handled internally by Viscosity now. The dnsdown.py scripts are only included for users automatically upgrading from version 1.2.3 to 1.3.x (so OpenVPN can still remove DNS settings if the user has an active connection while updating).
To run custom up/down scripts you'll now need to manually specify them using the up/down OpenVPN commands, rather than editing Viscosity's dns support scripts.
Cheers,
James
Viscosity stopped using up/down scripts to implement DNS support as of version 1.3.0. DNS support is all handled internally by Viscosity now. The dnsdown.py scripts are only included for users automatically upgrading from version 1.2.3 to 1.3.x (so OpenVPN can still remove DNS settings if the user has an active connection while updating).
To run custom up/down scripts you'll now need to manually specify them using the up/down OpenVPN commands, rather than editing Viscosity's dns support scripts.
Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
- Posts: 13
- Joined: Wed Apr 14, 2010 9:41 am
James wrote:Hi MasterYous,Thanks for the response - that explains it. Any word on when "Simultaneous DNS" will support using a pure DHCP setup? I remember you mentioning that this was in the works. Once you have that going, I plan to drop using dnsup and dnsdown custom scripts.
Viscosity stopped using up/down scripts to implement DNS support as of version 1.3.0. DNS support is all handled internally by Viscosity now. The dnsdown.py scripts are only included for users automatically upgrading from version 1.2.3 to 1.3.x (so OpenVPN can still remove DNS settings if the user has an active connection while updating).
To run custom up/down scripts you'll now need to manually specify them using the up/down OpenVPN commands, rather than editing Viscosity's dns support scripts.
8 posts
Page 1 of 1