forked from aaPanel/BaoTa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ def control_init(): | |
clean_session() | ||
#set_crond() | ||
clean_max_log('/www/server/panel/plugin/rsync/lsyncd.log') | ||
remove_tty1() | ||
|
||
|
||
#清理大日志 | ||
|
@@ -76,6 +77,17 @@ def clean_max_log(log_file,max_size = 104857600,old_line = 100): | |
public.writeFile(log_file,old_body) | ||
except:pass | ||
|
||
#删除tty1 | ||
def remove_tty1(): | ||
file_path = '/etc/systemd/system/[email protected]' | ||
if not os.path.exists(file_path): return False | ||
if not os.path.islink(file_path): return False | ||
if os.readlink(file_path) != '/dev/null': return False | ||
try: | ||
os.remove(file_path) | ||
except:pass | ||
|
||
|
||
#默认禁用指定PHP函数 | ||
def disable_putenv(fun_name): | ||
try: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters