【发布时间】:2013-01-05 02:40:39
【问题描述】:
测试使用 RPM 安装包 shell 脚本。
在 shell 脚本中包含 linux 命令以创建新用户并将 /etc/hosts 的所有权更改为该用户。 Shell脚本内容:
useradd bob
chown bob /etc/hosts
安装后 RPM 应该会导致:
-rw-r--r--. 1 bob root 331 Jan 4 11:13 /etc/hosts
而是在 RPM 安装完成后它仍然存在:
-rw-r--r--. 1 root root 331 Jan 4 11:13 /etc/hosts
【问题讨论】:
-
您以什么用户身份运行脚本?
-
这是一个糟糕透顶的主意。
-
赞赏这不是一个狂热的想法,但我只是在尝试..
标签: linux shell installation rpm