Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 php 脚本中,我使用这样的行来执行一些脚本:
exec('sudo -u USERNAME ./script.sh', $result)
该脚本由用户 USERNAME 正确执行,但如果我停止 apache 或它崩溃,该脚本也会被杀死。如何以用户 USERNAME 的身份执行该脚本并在不杀死脚本的情况下关闭 apache?