小编Soh*_*ani的帖子

即使在执行 sudo su 时,如何为所有用户设置环境变量?

x.sh在目录中创建了一个文件,/etc/profile.d/以便所有用户都可以访问它。我期望当我使用 command 在终端(登录用户)中更改当前用户时sudo su other_user,我在x.sh文件中设置的那些变量应该可以访问,但它们不是。如何根据需要设置可访问的变量?

bash environment-variables su

3
推荐指数
1
解决办法
6912
查看次数

如何在 Ubuntu 服务器 16.04 中以特定用户启动后启动 Zookeeper 守护进程

我想在 Ubuntu 服务器 16.04 启动后(而不是登录后)在名为Zookeeper的用户下启动 Zookeeper 守护进程。所以我改变了文件/etc/rc.local如下:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo 'never'; defrag_file_pathname

su -c '$ZOOKEEPER_HOME/bin/zkServer.sh start' zookeeper & …
Run Code Online (Sandbox Code Playgroud)

server startup command-line bash

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×2

command-line ×1

environment-variables ×1

server ×1

startup ×1

su ×1