Compare commits

...

2 Commits

Author SHA1 Message Date
mofeng-git
7116da2511 添加 otg 文件夹创建判断,避免文件夹存在导致程序退出 2025-03-11 12:52:19 +00:00
mofeng-git
a59fe84e26 修改 supervisord 配置文件为默认路径 2025-03-11 12:50:10 +00:00
3 changed files with 8 additions and 6 deletions

View File

@@ -212,6 +212,7 @@ instal_one-kvm() {
&& mv /usr/local/bin/kvmd* /usr/bin \
&& cp /One-KVM/configs/os/services/* /etc/systemd/system/ \
&& cp /One-KVM/configs/os/tmpfiles.conf /usr/lib/tmpfiles.d/ \
&& mv /etc/kvmd/supervisord.conf /etc/supervisord.conf \
&& chmod +x /etc/update-motd.d/* \
&& echo 'kvmd ALL=(ALL) NOPASSWD: /etc/kvmd/custom_atx/gpio.sh' >> /etc/sudoers \
&& echo 'kvmd ALL=(ALL) NOPASSWD: /etc/kvmd/custom_atx/usbrelay_hid.sh' >> /etc/sudoers \

View File

@@ -109,7 +109,7 @@ if [ ! -f /etc/kvmd/.init_flag ]; then
log_info "已禁用 WebTerm 功能"
rm -r /usr/share/kvmd/extras/webterm
else
cat >> /etc/kvmd/supervisord.conf << EOF
cat >> /etc/supervisord.conf << EOF
[program:kvmd-webterm]
command=/usr/local/bin/ttyd --interface=/run/kvmd/ttyd.sock --port=0 --writable /bin/bash -c '/etc/kvmd/armbain-motd; bash'
@@ -125,14 +125,14 @@ EOF
fi
if [ "$NOWEBTERMWRITE" == "1" ]; then
sed -i "s/--writable//g" /etc/kvmd/supervisord.conf
sed -i "s/--writable//g" /etc/supervisord.conf
fi
if [ "$NOVNC" == "1" ]; then
log_info "已禁用 VNC 功能"
rm -r /usr/share/kvmd/extras/vnc
else
cat >> /etc/kvmd/supervisord.conf << EOF
cat >> /etc/supervisord.conf << EOF
[program:kvmd-vnc]
command=python -m kvmd.apps.vnc --run
@@ -151,7 +151,7 @@ EOF
log_info "已禁用IPMI功能"
rm -r /usr/share/kvmd/extras/ipmi
else
cat >> /etc/kvmd/supervisord.conf << EOF
cat >> /etc/supervisord.conf << EOF
[program:kvmd-ipmi]
command=python -m kvmd.apps.ipmi --run
@@ -241,4 +241,4 @@ if [ "$OTG" == "1" ]; then
fi
log_info "One-KVM 配置文件准备完成,正在启动服务..."
exec supervisord -c /etc/kvmd/supervisord.conf
exec supervisord -c /etc/supervisord.conf

View File

@@ -48,7 +48,8 @@ from .hid.mouse import make_mouse_hid
# =====
def _mkdir(path: str) -> None:
get_logger().info("MKDIR --- %s", path)
os.mkdir(path)
if not os.path.isdir(path):
os.makedirs(path, exist_ok=True)
def _chown(path: str, user: str, optional: bool=False) -> None: