From cb9ea6fb5a27f06f8afc7f77e7b8090395313f15 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Fri, 3 Aug 2018 09:49:54 +0800 Subject: [PATCH] Add dbus session auto setup --- package/base-files/files/etc/profile | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 68efc2563..bb403e08d 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -10,6 +10,7 @@ export PATH="%PATH%" export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) export HOME=${HOME:-/root} export PS1='\u@\h:\w\$ ' +export GOROOT="/usr/share/golang/" [ -x /bin/more ] || alias more=less [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi @@ -26,3 +27,35 @@ export PS1='\u@\h:\w\$ ' unset FILE } [ -x /bin/ll ] || alias ll='ls -al' + +ulimit -c unlimited + +DBUS_SESSION_FILE=/tmp/dbus-session.env + +#if [ ! -f $DBUS_SESSION_FILE ]; then +# echo "Setup Session" >> /tmp/sh.log +# dbus-daemon --session --print-address >> $DBUS_SESSION_FILE & +# sync +#fi + +#if [ -f $DBUS_SESSION_FILE ]; then +# echo "Setup Session Env" >> /tmp/sh.log +# DBUS_SESSION_ENV=`cat $DBUS_SESSION_FILE` +# export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_ENV +#else +# echo "Don't find Session" >> /tmp/sh.log +#fi + +# add by huangxin +if [ -x /tmp/dbus_env.sh ] +then + source /tmp/dbus_env.sh +else + if [ -x /usr/bin/dbus-launch ]; then + export $(dbus-launch) + echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh + echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh + + chmod +x /tmp/dbus_env.sh + fi +fi