()
| 2991 | |
| 2992 | |
| 2993 | def start_scripts_service(): |
| 2994 | check_panel_ssl = _Script( |
| 2995 | name="面板SSL证书监控", |
| 2996 | cmd='nohup {} {}/script/panel_ssl_task.py > /dev/null 2>&1 &'.format(PY_BIN, PANEL_PATH), |
| 2997 | interval=3600) |
| 2998 | |
| 2999 | # 2026/1/30 该告警发送任务已经不再使用 |
| 3000 | # send_mail_time = _Script( |
| 3001 | # name="邮件发送任务", |
| 3002 | # cmd='nohup {} {}/script/mail_task.py > /dev/null 2>&1 &'.format( |
| 3003 | # PY_BIN, PANEL_PATH |
| 3004 | # ), |
| 3005 | # interval=3600) |
| 3006 | |
| 3007 | class ProjectDemons(_Script): |
| 3008 | def __init__(self, ): |
| 3009 | super().__init__("项目守护进程", '', 120) |
| 3010 | self.cmd = 'nohup {} {}/script/project_daemon.py > /dev/null 2>&1 &'.format( |
| 3011 | PY_BIN, PANEL_PATH |
| 3012 | ) |
| 3013 | |
| 3014 | def get_next_time(self) -> int: |
| 3015 | daemon_time_file ='{}/data/daemon_time.pl'.format(PANEL_PATH) |
| 3016 | if os.path.exists(daemon_time_file): |
| 3017 | time_out = int(read_file(daemon_time_file)) |
| 3018 | if time_out < 10: |
| 3019 | time_out = 10 |
| 3020 | if time_out > 30 * 60: |
| 3021 | time_out = 30 * 60 |
| 3022 | else: |
| 3023 | time_out = 120 |
| 3024 | |
| 3025 | return int(time.time() + time_out) |
| 3026 | |
| 3027 | project_demons = ProjectDemons() |
| 3028 | |
| 3029 | task_ssh_error_count=_Script( |
| 3030 | name="SSH错误次数", |
| 3031 | cmd='nohup {} {}/script/task_script_extension.py {} > /dev/null 2>&1 &'.format( |
| 3032 | PY_BIN, PANEL_PATH, 'task_ssh_error_count' |
| 3033 | ), |
| 3034 | interval=3600) |
| 3035 | |
| 3036 | # 2026/1/30 该任务无需存在,移除 |
| 3037 | # check_panel_msg = _Script( |
| 3038 | # name="面板消息提醒", |
| 3039 | # cmd='nohup {py_bin} {panel_path}/script/check_msg.py > /dev/null 2>&1 &'.format( |
| 3040 | # py_bin=PY_BIN, panel_path=PANEL_PATH |
| 3041 | # ), |
| 3042 | # interval=3600) |
| 3043 | |
| 3044 | push_task_config_file = "{}/data/mod_push_data/task.json".format(PANEL_PATH) |
| 3045 | push_msg = _Script( |
| 3046 | name="消息推送", |
| 3047 | cmd='nohup {py_bin} {panel_path}/script/push_msg.py > /dev/null 2>&1 &'.format( |
| 3048 | py_bin=PY_BIN, panel_path=PANEL_PATH |
| 3049 | ), |
| 3050 | interval=60, |
nothing calls this directly
no test coverage detected