Commit 85045501 authored by Julien Muchembled's avatar Julien Muchembled

Fix missing GEOIP2_MMDB environment variable if the DB is in /etc/re6stnet

In commit d7a4d73f,
this was done only for the init.d script.
parent 73314e4d
......@@ -21,6 +21,9 @@ if action in ("up", "vpn-up"):
raise
sys.stderr.write("daemon already started\n")
sys.exit()
mmdb = "GeoLite2-Country.mmdb"
if os.path.isfile(mmdb):
os.environ["GEOIP2_MMDB"] = os.path.join(CONFDIR, mmdb)
if not os.fork():
os.setsid()
os.execlp(DAEMON, DAEMON, "@re6stnet.conf")
......
......@@ -5,7 +5,7 @@ ConditionPathExists=/etc/re6stnet/re6stnet.conf
[Service]
WorkingDirectory=/etc/re6stnet
# systemd plans to "introduce ExecCondition= in services" (cf its TODO file)
ExecStart=/bin/sh -c 'set re6stnet @re6stnet.conf; "$@" --test main_interface==\"lo\" || exec "$@"'
ExecStart=/bin/sh -c 'set re6stnet @re6stnet.conf; GEOIP2_MMDB=/etc/re6stnet/GeoLite2-Country.mmdb; [ -r $GEOIP2_MMDB ] && export GEOIP2_MMDB; "$@" --test main_interface==\"lo\" || exec "$@"'
Restart=on-failure
StandardOutput=null
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment