From d3516c09853a02b912e3464afa6007af4fd65700 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 4 Apr 2021 13:43:22 +0500 Subject: [PATCH] bug fix: full path for add user --- plogical/ClusterManager.py | 3 +-- plogical/vhost.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plogical/ClusterManager.py b/plogical/ClusterManager.py index 59fd311da..c8e82652c 100644 --- a/plogical/ClusterManager.py +++ b/plogical/ClusterManager.py @@ -265,15 +265,14 @@ password=%s""" % (rootdbpassword, rootdbpassword) from websiteFunctions.models import Websites, ChildDomains for website in Websites.objects.all(): + confPath = '%s/%s' % (ClusterManager.vhostConfPath, website.domain) if not os.path.exists(confPath): self.PostStatus('Domain %s found in master server, creating on child server now..' % (website.domain)) virtualHostUtilities.createVirtualHost(website.domain, website.adminEmail, website.phpSelection, website.externalApp, 1, 1, 0, website.admin.userName, website.package.packageName, 0, '/home/cyberpanel/temp', 1, 0) self.PostStatus('Domain %s successfully created.' % (website.domain)) - ## Delete cache folders - command = 'rm -rf /usr/local/lsws/cachedata' for childDomain in ChildDomains.objects.all(): confPath = '%s/%s' % (ClusterManager.vhostConfPath, childDomain.domain) diff --git a/plogical/vhost.py b/plogical/vhost.py index dfc2eab82..833cb74de 100755 --- a/plogical/vhost.py +++ b/plogical/vhost.py @@ -45,13 +45,13 @@ class vhost: FNULL = open(os.devnull, 'w') if os.path.exists("/etc/lsb-release"): - command = 'adduser --no-create-home --home ' + path + ' --disabled-login --gecos "" ' + virtualHostUser + command = '/usr/sbin/adduser --no-create-home --home ' + path + ' --disabled-login --gecos "" ' + virtualHostUser else: command = "adduser " + virtualHostUser + " -M -d " + path ProcessUtilities.executioner(command) - command = "groupadd " + virtualHostUser + command = "/usr/sbin/groupadd " + virtualHostUser ProcessUtilities.executioner(command) command = "usermod -a -G " + virtualHostUser + " " + virtualHostUser