From 0312c5ceb0ba1e9c572e6d2ff59e4d7ccb26e128 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 2 Dec 2024 17:12:29 +0800 Subject: [PATCH] update --- web/admin/setup/init_cmd.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/admin/setup/init_cmd.py b/web/admin/setup/init_cmd.py index 3ec0a8ffb..738bad881 100644 --- a/web/admin/setup/init_cmd.py +++ b/web/admin/setup/init_cmd.py @@ -34,6 +34,8 @@ def init_cmd(): if not mw.isAppleSystem() and not os.path.exists("/etc/init.d"): mw.execShell('mkdir -p /etc/init.d') + sys_name = mw.getOsName() + # initd if os.path.exists('/etc/rc.d/init.d'): initd_bin = '/etc/rc.d/init.d/mw' @@ -45,6 +47,10 @@ def init_cmd(): # 加入自启动 mw.execShell('which chkconfig && chkconfig --add mw') + # if sys_name == 'opensuse': + # mw.execShell('which chkconfig && chkconfig --level 3 mw on') + + if os.path.exists('/etc/init.d'): initd_bin = '/etc/init.d/mw' # if not os.access(initd_bin, os.W_OK): @@ -55,7 +61,7 @@ def init_cmd(): # 加入自启动 mw.execShell('which update-rc.d && update-rc.d -f mw defaults') - # if mw.getOsName() == 'opensuse': + # if sys_name == 'opensuse': # init_cmd_systemd() return True