如何修复 entware 上的“updatedb:找不到组‘mlocate’”?

Pro*_*kup 7 linux group updatedb

我已经mlocate在运行 Padavan 和 Entware-ng 的 Asus RT-N56U 上安装了该软件包,它基于 OpenWrt。这个嵌入式 Linux 发行版启用了 SSH。

我的locate结果已经过时了。当我使用该updatedb命令时出现此错误:

updatedb: can not find group mlocate
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题,最好是用一个衬垫?

Pro*_*kup 8

addgroup软件包是必需的,包含在 padavan 固件的 busybox 中。

以 root 身份执行以下步骤:

grep -s mlocate /etc/group || addgroup mlocate
chgrp mlocate /opt/var/mlocate
chmod g=rx,o= /opt/var/mlocate
chgrp mlocate /opt/bin/locate
chmod g+s,go-w /opt/bin/locate
touch /opt/var/mlocate/mlocate.db
chgrp mlocate /opt/var/mlocate/mlocate.db
Run Code Online (Sandbox Code Playgroud)

这是修复“updatedb:找不到组mlocate”消息的单行(单个复制和粘贴命令):

# grep -s mlocate /etc/group || addgroup mlocate;chgrp mlocate /opt/var/mlocate;chmod g=rx,o= /opt/var/mlocate;chgrp mlocate /opt/bin/locate;chmod g+s,go-w /opt/bin/locate;touch /opt/var/mlocate/mlocate.db;chgrp mlocate /opt/var/mlocate/mlocate.db
Run Code Online (Sandbox Code Playgroud)