summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py11
1 files changed, 6 insertions, 5 deletions
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