[MacPorts] #52525: openvpn2 startup script not working
#52525: openvpn2 startup script not working --------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 2.3.4 Keywords: openvpn2 launchctl | Port: openvpn2 --------------------------------+-------------------------------- Hi, I tested the openvpn2 port and I have major issues with the startup script org.macports.openvpn2.plist. I can run the daemon manually and the tunnel is established but I can not get it running automatically via launchctl for following reasons: 1. bin -> sbin: the script uses the wrong location for openvpn2, instead of /opt/local/bin/openvpn2 it should be /opt/local/sbin/openvpn2 2. daemondo: I can run the whole daemondo call from the command line, but if I run the script via launchctl it only logs that the service did run for 0 seconds only. I can not find any further ouptut showing me what might be wrong with the script. 3. debug: launchtl is giving a warning: The Debug key is no longer respected. Please remove it. 4. inefficient: launchtl is giving a warning: This service is defined to be constantly running and is inherently inefficient. In the end it is not starting and I don't know where to look else, my only source of logging is /var/log/system.log. My system is Sierra 10.12. This is how I can establish the tunnel: daemondo --label=openvpn2 --start-cmd /opt/local/sbin/openvpn2 --cd /opt/local/etc/openvpn2 --config /opt/local/etc/openvpn2/my.conf \; The script currently looks like this: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" > <plist version='1.0'> <dict> <key>Label</key><string>org.macports.openvpn2</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=openvpn2</string> <string>--start-cmd</string> <string>/opt/local/sbin/openvpn2 --config /opt/local/etc/openvpn2/my.conf</string> <string>;</string> <string>--pid=exec</string> </array> <key>Debug</key><false/> <key>Disabled</key><false/> <key>KeepAlive</key><true/> </dict> </plist> -- Ticket URL: <https://trac.macports.org/ticket/52525> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: openvpn2 launchctl Port: openvpn2 | -------------------------------+-------------------------------- Changes (by mf2k@…): * priority: High => Normal Comment: The Priority field is for use by Macports team members only. -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:2> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Changes (by mf2k@…): * cc: thomas.hartwig@… (removed) * keywords: openvpn2 launchctl => Comment: In the future, please use WikiFormatting. As reporter, you do not need to Cc yourself. -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:3> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Description changed by mf2k@…: Old description:
Hi, I tested the openvpn2 port and I have major issues with the startup script org.macports.openvpn2.plist. I can run the daemon manually and the tunnel is established but I can not get it running automatically via launchctl for following reasons:
1. bin -> sbin: the script uses the wrong location for openvpn2, instead of /opt/local/bin/openvpn2 it should be /opt/local/sbin/openvpn2 2. daemondo: I can run the whole daemondo call from the command line, but if I run the script via launchctl it only logs that the service did run for 0 seconds only. I can not find any further ouptut showing me what might be wrong with the script. 3. debug: launchtl is giving a warning: The Debug key is no longer respected. Please remove it. 4. inefficient: launchtl is giving a warning: This service is defined to be constantly running and is inherently inefficient.
In the end it is not starting and I don't know where to look else, my only source of logging is /var/log/system.log.
My system is Sierra 10.12.
This is how I can establish the tunnel:
daemondo --label=openvpn2 --start-cmd /opt/local/sbin/openvpn2 --cd /opt/local/etc/openvpn2 --config /opt/local/etc/openvpn2/my.conf \;
The script currently looks like this:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" > <plist version='1.0'> <dict> <key>Label</key><string>org.macports.openvpn2</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=openvpn2</string> <string>--start-cmd</string> <string>/opt/local/sbin/openvpn2 --config /opt/local/etc/openvpn2/my.conf</string> <string>;</string> <string>--pid=exec</string> </array> <key>Debug</key><false/> <key>Disabled</key><false/> <key>KeepAlive</key><true/> </dict> </plist>
New description: Hi, I tested the openvpn2 port and I have major issues with the startup script org.macports.openvpn2.plist. I can run the daemon manually and the tunnel is established but I can not get it running automatically via launchctl for following reasons: 1. bin -> sbin: the script uses the wrong location for openvpn2, instead of /opt/local/bin/openvpn2 it should be /opt/local/sbin/openvpn2 2. daemondo: I can run the whole daemondo call from the command line, but if I run the script via launchctl it only logs that the service did run for 0 seconds only. I can not find any further ouptut showing me what might be wrong with the script. 3. debug: launchtl is giving a warning: The Debug key is no longer respected. Please remove it. 4. inefficient: launchtl is giving a warning: This service is defined to be constantly running and is inherently inefficient. In the end it is not starting and I don't know where to look else, my only source of logging is /var/log/system.log. My system is Sierra 10.12. This is how I can establish the tunnel: {{{ daemondo --label=openvpn2 --start-cmd /opt/local/sbin/openvpn2 --cd /opt/local/etc/openvpn2 --config /opt/local/etc/openvpn2/my.conf \; }}} The script currently looks like this: {{{ <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" > <plist version='1.0'> <dict> <key>Label</key><string>org.macports.openvpn2</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=openvpn2</string> <string>--start-cmd</string> <string>/opt/local/sbin/openvpn2 --config /opt/local/etc/openvpn2/my.conf</string> <string>;</string> <string>--pid=exec</string> </array> <key>Debug</key><false/> <key>Disabled</key><false/> <key>KeepAlive</key><true/> </dict> </plist> }}} -- -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:4> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Comment (by mf2k@…): I fixed the sbin issue with the startup item in r153641. Also made a correction in the notes. It still is not working for me. I'm not sure how to correct the other issues you mention. Can you look in the [https://guide.macports.org/#reference.startupitems guide] and possibly submit a Portfile patch to fix the remaining issues? -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:5> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Comment (by thomas.hartwig@…): I have checked the plist file further and it turns out that you have to specify the startup command in a single attribute. Further it looks like all other parameters are not forwarded to the command itself. So I ended up writing a wrapper script which contained all the parameters for starting up openvpn correctly. So the final test script looks like below. I created a openvpn2.sh which makes the call finally. I have also activated some kind of debug to see what happens. However I do not know how you usually realize startup things. IMHO there is a problem with deamondo not forwarding the parameters correctly. But I am not an expert in this. {{{ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" > <plist version='1.0'> <dict> <key>Label</key><string>org.macports.openvpn2</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=openvpn2</string> <string>--start-cmd</string> <string>/opt/local/sbin/openvpn2.sh</string> <string>;</string> <string>--pid=exec</string> </array> <key>Debug</key><false/> <key>Disabled</key><false/> <key>KeepAlive</key><true/> <key>StandardOutPath</key> <string>/tmp/logfile.log</string> <key>StandardErrorPath</key> <string>/tmp/error.log</string> </dict> </plist> }}} -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:6> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Comment (by ctreleaven@…): Untested, but I think the problem is the double quotes around the startupitem.executable: {{{ startupitem.executable "${prefix}/bin/openvpn2 --config ${prefix}/etc/${name}/server.conf" }}} Should be {{{ startupitem.executable ${prefix}/bin/openvpn2 --config ${prefix}/etc/${name}/server.conf }}} But I could be completely wrong. -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:7> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Comment (by mf2k@…): I tested it locally without quotes and the startupitem looks like this: {{{ <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd" > <plist version='1.0'> <dict> <key>Label</key><string>org.macports.openvpn2</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=openvpn2</string> <string>--start-cmd</string> <string>/opt/local/sbin/openvpn2</string> <string>--config</string> <string>/opt/local/etc/openvpn2/server.conf</string> <string>;</string> <string>--pid=exec</string> </array> <key>Debug</key><false/> <key>Disabled</key><true/> <key>KeepAlive</key><true/> </dict> </plist> }}} -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:8> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Changes (by mf2k@…): * cc: kolbcp@… (added) Comment: Has duplicate #50655. -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:9> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#52525: openvpn2 startup script not working -------------------------------+-------------------------------- Reporter: thomas.hartwig@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: openvpn2 | -------------------------------+-------------------------------- Comment (by mf2k@…): Committed in r153653. Based on the guide, this is more correct. But it still is not launching for me. -- Ticket URL: <https://trac.macports.org/ticket/52525#comment:10> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
participants (1)
-
MacPorts