服务器重启后1panel无法打开面板,尝试设置服务自启失败

服务器重启后1panel无法打开面板,排查后可能是1panel服务没成功启动,但是ssh终端命令排查1panel服务是正常启动的,但是面板无法打开,排查端口开放正常,ssh终端重启1panel服务后面板可登录,尝试排查1panel服务是否开机自启时,查找命令失败,尝试设置失败。以下是命令输出结果

Authentication is required to start ‘1Panel.service’.
Authenticating as: pyjiang
Password:
==== AUTHENTICATION COMPLETE ===
Failed to start 1Panel.service: Unit 1Panel.service not found.
pyjiang@ubuntu:~$ sudo ufw status
Status: active

To Action From


22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
37945/tcp ALLOW Anywhere
39000:40000/tcp ALLOW Anywhere
31508/tcp ALLOW Anywhere
20/tcp DENY Anywhere
21/tcp DENY Anywhere
888/tcp DENY Anywhere
8080/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
37945/tcp (v6) ALLOW Anywhere (v6)
39000:40000/tcp (v6) ALLOW Anywhere (v6)
31508/tcp (v6) ALLOW Anywhere (v6)
20/tcp (v6) DENY Anywhere (v6)
21/tcp (v6) DENY Anywhere (v6)
888/tcp (v6) DENY Anywhere (v6)
8080/tcp (v6) ALLOW Anywhere (v6)

pyjiang@ubuntu:~$ sudo ufw reload
Firewall reloaded
pyjiang@ubuntu:~$ sudo systemctl status 1Panel
Unit 1Panel.service could not be found.
pyjiang@ubuntu:~$ sudo systemctl start 1Panel
Failed to start 1Panel.service: Unit 1Panel.service not found.
pyjiang@ubuntu:~$ sudo journalctl -u 1Panel
– No entries –
pyjiang@ubuntu:~$ sudo ss -tuln | grep 31508
pyjiang@ubuntu:~$ ls -l /path/to/1Panel
ls: cannot access ‘/path/to/1Panel’: No such file or directory
pyjiang@ubuntu:~$ ls /etc/systemd/system/ | grep 1Panel
pyjiang@ubuntu:~$ sudo ls /etc/systemd/system/ | grep 1Panel
pyjiang@ubuntu:~$ sudo nano /etc/systemd/system/1Panel.service
pyjiang@ubuntu:~$ 1pctl status
● 1panel.service - 1Panel, a modern open source linux panel
Loaded: loaded (/etc/systemd/system/1panel.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2024-04-06 11:20:42 UTC; 3h 57min ago
Main PID: 891 (1panel)
Tasks: 20 (limit: 38170)
Memory: 106.9M
CPU: 2.179s
CGroup: /system.slice/1panel.service
└─891 /usr/bin/1panel

4月 06 11:20:42 ubuntu systemd[1]: Started 1Panel, a modern open source linux panel.
4月 06 11:20:42 ubuntu 1panel[891]: [2024-04-06 11:20:42] [INFO] init logger successfully
4月 06 11:20:42 ubuntu 1panel[891]: [2024-04-06 11:20:42] [INFO] init db successfully
4月 06 11:20:42 ubuntu 1panel[891]: [2024-04-06 11:20:42] [INFO] Migration run successfully
pyjiang@ubuntu:~$ 1pctl restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart ‘1panel.service’.
Authenticating as: pyjiang
Password:
==== AUTHENTICATION COMPLETE ===
● 1panel.service - 1Panel, a modern open source linux panel
Loaded: loaded (/etc/systemd/system/1panel.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2024-04-06 15:19:59 UTC; 9ms ago
Main PID: 19588 (1panel)
Tasks: 5 (limit: 38170)
Memory: 2.7M
CPU: 8ms
CGroup: /system.slice/1panel.service
└─19588 /usr/bin/1panel

4月 06 15:19:59 ubuntu systemd[1]: Started 1Panel, a modern open source linux panel.
pyjiang@ubuntu:~$ sudo systemctl is-enabled 1Panel.service
[sudo] password for pyjiang:
Failed to get unit file state for 1Panel.service: No such file or directory
pyjiang@ubuntu:~$ sudo ls /etc/systemd/system/ | grep 1Panel
pyjiang@ubuntu:~$ sudo systemctl enable 1Panel.service
Failed to enable unit: Unit file 1Panel.service does not exist.

1pctl status 命令查看 1Panel 状态已经是 running 状态。
还有,你是非 root 账号登录的服务器,执行命令需要 sudo 权限,比如:sudo 1pctl restart

你目前先自行排查一下 1Panel 端口是不是通的

上诉有一部分代码没看到,我有sudo代码查看了,端口全开放,最后排查的结果是1panel服务没启动,但是命令查看1panel服务又是开启的,然后还需要用1pctl start命令,然后才能访问,再次重启服务器,然后发现确实是去过问题,然后想排查1panel的开机自启状态,无法查询到这个服务的状态,也无法设置开机自启加sudo或者切换root用户也没用,请教大佬这是我1panel面板安装错误导致吗,还是什么问题,但是用命令查看1panel的状态,显示又是全OK的,另外一个就是halo也无法通过IP+端口访问面板,重装服务也一样,查看IP端口也是全通的,我的主机是在局域网下的,服务器也是

我也是这个问题,开机1panel服务是开启的,但是需要手动输入1pctl start 才能正常访问面板,请问这个问题你解决了吗?