Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aaPanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
aaPanel
Commits
8efb4bb6
Commit
8efb4bb6
authored
Jul 03, 2019
by
jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update public.py
parent
141510f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
public.py
class/public.py
+29
-3
No files found.
class/public.py
View file @
8efb4bb6
...
...
@@ -734,10 +734,10 @@ def checkWebConfig():
if
os
.
path
.
exists
(
f3
):
os
.
remove
(
f3
)
if
get_webserver
()
==
'nginx'
:
result
=
ExecShell
(
"ulimit -n 8192
&&
/www/server/nginx/sbin/nginx -t -c /www/server/nginx/conf/nginx.conf"
);
result
=
ExecShell
(
"ulimit -n 8192
;
/www/server/nginx/sbin/nginx -t -c /www/server/nginx/conf/nginx.conf"
);
searchStr
=
'successful'
else
:
result
=
ExecShell
(
"ulimit -n 8192
&&
/www/server/apache/bin/apachectl -t"
);
result
=
ExecShell
(
"ulimit -n 8192
;
/www/server/apache/bin/apachectl -t"
);
searchStr
=
'Syntax OK'
if
result
[
1
]
.
find
(
searchStr
)
==
-
1
:
...
...
@@ -1227,3 +1227,29 @@ def mod_reload(mode):
imp
.
reload
(
module
)
return
True
except
:
return
False
#设置权限
def
set_mode
(
filename
,
mode
):
if
not
os
.
path
.
exists
(
filename
):
return
False
mode
=
int
(
str
(
mode
),
8
)
os
.
chmod
(
filename
,
mode
)
return
True
#设置用户组
def
set_own
(
filename
,
user
,
group
=
None
):
if
not
os
.
path
.
exists
(
filename
):
return
False
from
pwd
import
getpwnam
try
:
user_info
=
getpwnam
(
user
)
user
=
user_info
.
pw_uid
if
group
:
user_info
=
getpwnam
(
group
)
group
=
user_info
.
pw_gid
except
:
#如果指定用户或组不存在,则使用www
user_info
=
getpwnam
(
'www'
)
user
=
user_info
.
pw_uid
group
=
user_info
.
pw_gid
os
.
chown
(
filename
,
user
,
group
)
return
True
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment