WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Error in .profile?  (Read 1959 times)

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Error in .profile?
« on: December 17, 2015, 07:34:44 AM »
I believe that I have found an error in '~/.profile'. The lines at the very end read
Code: [Select]
TERMTYPE=`/bb/tty`
[ ${TERMTYPE:5:3} == "tty" ] && (
[ -f /etc/sysconfig/text ] ||
[ -e /tmp/.X11-unix/X0 ] ||
[ -f /usr/bin/Xorg ] ||
[ -f /usr/local/bin/Xvesa ] &&
startx
)
As far as I understand, ''startx'' should only be called if
  • '~/.profile' is called from a TTY
  • '/etc/sysconfig/text' does not exist
  • '/tmp/.X11-unix/X0' does not (yet) exist as an empty file
  • either '/usr/bin/Xorg' or /usr/local/bin/Xves' do exist
Maybe I am wrong in the details here but nevertheless my test shows that a graphical desktop is started even if '/etc/sysconfig/text' does exist (created through specifying the boot-option "text"). This clearly is not the expected behavior if "text" should boot into text-only mode.
As far as I understand, the following could work (notice the moved opening parenthesis):
Code: [Select]
TERMTYPE=`/bb/tty`
[ ${TERMTYPE:5:3} == "tty" ] &&
[ -f /etc/sysconfig/text ] ||
[ -e /tmp/.X11-unix/X0 ] ||
( [ -f /usr/bin/Xorg ] ||
[ -f /usr/local/bin/Xvesa ] &&
startx
)
Again, I am not sure if I am right here so maybe somebody will have to correct me. (For instance, in the course of trying to understand the logic I found out that logical operators in the shell do not have any algebraic precedence but are evaluated left to right.  :o)
« Last Edit: December 17, 2015, 07:42:28 AM by sm8ps »

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Error in .profile?
« Reply #1 on: December 17, 2015, 02:02:11 PM »
You are right.  Tested it, works like a charm!

Thanks, I will upload a new release candidate today.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Error in .profile?
« Reply #2 on: December 17, 2015, 04:20:33 PM »
Fixed in the latest release candidate.

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: Error in .profile?
« Reply #3 on: December 17, 2015, 05:36:24 PM »
Proud happy noob me!  ;D
Gonna test it soon but almost certainly only after the holidays.
Early season's greetings to everybody involved in this nifty project!
sm