# For SELinux we need to use ‘runuser‘ not ‘su‘
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser -s /bin/sh"
else
SU="/bin/su -s /bin/sh"
fi
如果想要切换用户并且执行一些组件的shell应该使用以下的命令
/bin/su - hive -s /bin/sh /usr/local/sbin/hhggk_device/work_devstatetime.sh