From 7291397ad9b0919982806b848cccca550fa9dfc3 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 25 Feb 2020 12:37:54 +0100 Subject: pppoe: T2055: verify logfile really exists --- src/conf_mode/interfaces-pppoe.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py index 02d3cf3ce..6acb45d5e 100755 --- a/src/conf_mode/interfaces-pppoe.py +++ b/src/conf_mode/interfaces-pppoe.py @@ -250,15 +250,16 @@ def apply(pppoe): return None if not pppoe['disable']: - # make logfile owned by root / vyattacfg - uid = getpwnam('root').pw_uid - gid = getgrnam('vyattacfg').gr_gid - os.chown(pppoe['logfile'], uid, gid) - # dial PPPoE connection cmd = 'systemctl start ppp@{}.service'.format(pppoe['intf']) subprocess_cmd(cmd) + # make logfile owned by root / vyattacfg + if os.path.isfile(pppoe['logfile']): + uid = getpwnam('root').pw_uid + gid = getgrnam('vyattacfg').gr_gid + os.chown(pppoe['logfile'], uid, gid) + # better late then sorry ... but we can only set interface alias after # pppd has been launched and created the interface cnt = 0 -- cgit v1.2.3