bug fix: full path for add user

This commit is contained in:
Usman Nasir
2021-04-04 13:43:22 +05:00
parent 8c4c99b5bf
commit d3516c0985
2 changed files with 3 additions and 4 deletions

View File

@@ -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)

View File

@@ -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