Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 829949 - net-vpn/openvpn: arguments should be provided when stop openvpn daemon using start-stop-daemon
Summary: net-vpn/openvpn: arguments should be provided when stop openvpn daemon using ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-12-25 08:22 UTC by Zhixu Liu
Modified: 2023-03-11 16:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhixu Liu 2021-12-25 08:22:07 UTC
in /etc/init.d/openvpn, stop have no arguments appended, so when no pid file exist, start-stop-daemon will stop processes matched by exec, then all other openvpn instances will be killed. So

        start-stop-daemon --stop --quiet \
                --exec /usr/sbin/openvpn --pidfile "${VPNPID}"

should be:

        start-stop-daemon --stop --quiet \
                --exec /usr/sbin/openvpn --pidfile "${VPNPID}" -- --config "${VPNCONF}"
 

Reproducible: Always
Comment 1 Azamat H. Hackimov 2023-02-20 14:46:40 UTC
Please resolve this bug. Also hitting on it:

/etc/init.d/openvpn.01 restart -v
 * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/openvpn.01 stop                                                                                                                                                
 * Stopping openvpn.01 ...                                                                                                                                                                                                                 
 * start-stop-daemon: fopen `/run/openvpn.01.pid': No such file or directory                                                                                                                                                               
 * Will stop /usr/sbin/openvpn                                                                                                                                                                                                              
 * Will stop processes of `/usr/sbin/openvpn'                                                                                                                                                                                               
 * Sending signal 15 to PID 323798 ...  [ ok ]
 * Sending signal 15 to PID 322843 ...  [ ok ]
 * Sending signal 15 to PID 286374 ...  [ ok ]
 * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/openvpn.atv start                                                                                                                                               
 * Starting openvpn.atv ...                                                                                                                                                                                                                 
 * start-stop-daemon: fopen `/run/openvpn.01.pid': No such file or directory                                                                                                                                                               
 * Detaching to start `/usr/sbin/openvpn' ...                                                                                                                                                                                         [ ok ]
 * WARNING: openvpn.atv has started, but is inactive

There should no multiple "Sending signal 15 to PID".
Comment 2 Azamat H. Hackimov 2023-02-20 14:48:33 UTC
Suggested fix from Zhixu Liu (thanks!) applied in-place on /etc/init.d/openvpn solved problem.

I've created PR https://github.com/gentoo/gentoo/pull/29685, please apply it.
Comment 3 Larry the Git Cow gentoo-dev 2023-03-11 16:26:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da23c443933f51b4a9fd9ff98175f804dc52af37

commit da23c443933f51b4a9fd9ff98175f804dc52af37
Author:     Azamat H. Hackimov <azamat.hackimov@gmail.com>
AuthorDate: 2023-02-20 14:35:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-11 16:25:50 +0000

    net-vpn/openvpn: fix crushing multiple instances
    
    In environment with multiple openvpn's instances if one of them get
    crushed, trying to restart it will result to stoping ALL of other
    openvpn instances. Introduced `--config "${VPNCONF}"` option to prevent
    it as suggested by Zhixu Liu.
    
    Closes: https://bugs.gentoo.org/829949
    Suggested-by: Zhixu Liu <zhixu.liu@gmail.com>
    Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/29685
    Signed-off-by: Sam James <sam@gentoo.org>

 net-vpn/openvpn/files/openvpn-2.1.init                               | 5 +++--
 net-vpn/openvpn/{openvpn-2.5.2-r2.ebuild => openvpn-2.5.2-r3.ebuild} | 0
 net-vpn/openvpn/{openvpn-2.5.6.ebuild => openvpn-2.5.6-r1.ebuild}    | 0
 net-vpn/openvpn/{openvpn-2.5.7.ebuild => openvpn-2.5.7-r1.ebuild}    | 0
 4 files changed, 3 insertions(+), 2 deletions(-)