systemd generator fails with more than one config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openvpn (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The systemd generator for openvpn (filesystem: /lib/systemd/
When run a second time the symlinks exist and the generator fails on the first config and does not make it through the loop of all configs. This means if a config is added later and glob sorts after the first config it will never be linked. I believe the ln -s invocation should be ln -sf
root@host:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
dir=/tmp/
# First run succeeds:
root@host:~# SYSTEMD_
+ set -eu
+ GENDIR=
+ WANTDIR=
+ SERVICEFILE=
+ AUTOSTART=all
+ CONFIG_
+ mkdir -p /tmp/tmp.
+ test -e /etc/default/
+ . /etc/default/
++ OPTARGS=
++ OMIT_SENDSIGS=0
++ AUTOSTART=all
+ test xall = xnone
+ test xall = xall -o -z all
++ cd /etc/openvpn
++ ls network-one.conf network-two.conf
+ for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`
+ NAME=network-one
+ ln -s /lib/systemd/
+ for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`
+ NAME=network-two
+ ln -s /lib/systemd/
+ exit 0
# Second run fails:
root@host:~# SYSTEMD_
+ set -eu
+ GENDIR=
+ WANTDIR=
+ SERVICEFILE=
+ AUTOSTART=all
+ CONFIG_
+ mkdir -p /tmp/tmp.
+ test -e /etc/default/
+ . /etc/default/
++ OPTARGS=
++ OMIT_SENDSIGS=0
++ AUTOSTART=all
+ test xall = xnone
+ test xall = xall -o -z all
++ cd /etc/openvpn
++ ls network-one.conf network-two.conf
+ for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`
+ NAME=network-one
+ ln -s /lib/systemd/
ln: failed to create symbolic link '/<email address hidden>': File exists