Results 1 to 19 of 19
  1. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #1  
    Pardon me if this is in the wrong forum, but I didn't know where to post it and it doesn't seem like there is anyone on the predev's IRC channel to ask it of.

    I went through the steps of rooting my Pre yesterday and it appeared as though everything went fine. When I went to do a change of directory to look at the files that are used in the dialer, I got the following message:

    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")"

    Any idea as to where I went wrong along the way? I'm able to log in as the user I created, so I assume that I was okay up to that point.

    Thanks in advance!
  2. #2  
    Quote Originally Posted by jaihawk View Post
    Pardon me if this is in the wrong forum, but I didn't know where to post it and it doesn't seem like there is anyone on the predev's IRC channel to ask it of.

    I went through the steps of rooting my Pre yesterday and it appeared as though everything went fine. When I went to do a change of directory to look at the files that are used in the dialer, I got the following message:

    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")"

    Any idea as to where I went wrong along the way? I'm able to log in as the user I created, so I assume that I was okay up to that point.

    Thanks in advance!
    did you do a "sudo su -l" (without the quotes)?

    Your set up user account doesn't have root access on login, you have to do that sudo command, then type in the password for your user account again to gain root access.
  3. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #3  
    I am logging in, through putty, but putting in my IP address and port 222, choosing SSH as the connection type. When it launches the window, it's automatically asking for a login and then a password, so I don't have the opportunity to do the sudo su -l command initially.

    When I do it after I have logged in, I get the following:

    >>> /opt/etc/sudoers: syntax error near line 32 <<<
    sudo: parse error in /opt/etc/sodoers near line 32
    sudo: no valid sudoers sources found, quitting
  4. #4  
    Quote Originally Posted by jaihawk View Post
    I am logging in, through putty, but putting in my IP address and port 222, choosing SSH as the connection type. When it launches the window, it's automatically asking for a login and then a password, so I don't have the opportunity to do the sudo su -l command initially.

    When I do it after I have logged in, I get the following:

    >>> /opt/etc/sudoers: syntax error near line 32 <<<
    sudo: parse error in /opt/etc/sodoers near line 32
    sudo: no valid sudoers sources found, quitting
    try this one

    sudo -s
  5. moserjj's Avatar
    Posts
    468 Posts
    Global Posts
    470 Global Posts
    #5  
    you could also try "su -" to switch to root control
  6. #6  
    Quote Originally Posted by moserjj View Post
    you could also try "su -" to switch to root control
    If he set up su, sure. If he set up sudo, then thats futile.
  7. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #7  
    Unfortunately still no go... here's the log of me going through the steps. Perhaps you can see something I did wrong?

    /bin/sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    root@castle:/# mddir -p /opt/etc/ipkg
    /bin/sh: mddir: not found
    root@castle:/# rootfs_open -w
    root@castle:/# mkdir /var/opt
    mkdir: cannot create directory '/var/opt': File exists
    root@castle:/# mkdir /opt
    mkdir: cannot create directory '/opt': File exists
    root@castle:/# mount -o bind /var/opt /opt
    root@castle:/# echo '/var/opt /opt bind defaults,bind 0 0' >>/etc/fstab
    root@castle:/# cd /tmp
    root@castle:/tmp# wget http://ipkg.nslu2-linux.org/feeds/op...s08q1armel/cro
    ss/stable/ipkg-opt_0.99.163-10_arm.ipk
    Connecting to ipkg.nslu2-linux.org (140.211.169.169:80)
    ipkg-opt_0.99.163-10 100% |*******************************| 74456 00:00:00 ETA
    root@castle:/tmp# mkdir /tmp/ipkg
    root@castle:/tmp# cd /tmp/ipkg
    root@castle:/tmp/ipkg# tar xvzf ../ipkg-opt_0.99.163-10_arm.ipk
    ./debian-binary
    ./data.tar.gz
    ./control.tar.gz
    root@castle:/tmp/ipkg# cd /
    root@castle:/# tar xvzf /tmp/ipkg/data.tar.gz
    ./
    ./opt/
    ./opt/bin/
    ./opt/bin/ipkg
    ./opt/bin/ipkg-opt
    ./opt/bin/update-alternatives
    ./opt/etc/
    ./opt/etc/ipkg.conf
    ./opt/lib/
    ./opt/lib/libipkg.so
    ./opt/lib/libipkg.so.0
    ./opt/lib/libipkg.so.0.0.0
    ./opt/share/
    ./opt/share/ipkg/
    ./opt/share/ipkg/intercept/
    ./opt/share/ipkg/intercept/depmod
    ./opt/share/ipkg/intercept/ldconfig
    ./opt/share/ipkg/intercept/update-modules
    root@castle:/# rm /tmp/ipkg-opt_0.99.163-10_arm.ipk
    root@castle:/# rm -rf /tmp/ipkg
    root@castle:/# mkdir -p /opt/etc/ipkg
    root@castle:/# cd /opt/etc/ipkg
    root@castle:/opt/etc/ipkg# cd /
    root@castle:/# mkdir -p /opt/etc/ipkg
    root@castle:/# echo "src/gz cross http://ipkg.nslu2-linux.org/feeds/optware/cs08
    q1armel/cross/unstable" > /opt/etc/ipkg/optware.conf
    root@castle:/# echo "src/gz native http://ipkg.nslu2-linux.org/feeds/optware/cs0
    8q1armel/native/unstable" >> /opt/etc/ipkg/optware.conf
    root@castle:/# echo "src/gz kernel Index of /feeds/optware/pre
    /cross/unstable" >> /opt/etc/ipkg/optware.conf
    root@castle:/# expore PATH=/opt/bin:$PATH
    /bin/sh: expore: not found
    root@castle:/# export PATH=/opt/bin:$PATH
    root@castle:/# ipkg-opt update
    Downloading http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Updated list of available packages in /opt/lib/ipkg/lists/cross
    Downloading http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Updated list of available packages in /opt/lib/ipkg/lists/native
    Downloading http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/op...le/Packages.gz
    Updated list of available packages in /opt/lib/ipkg/lists/kernel
    Successfully terminated.
    root@castle:/# mkdir /etc/profile.d/
    mkdir: cannot create directory '/etc/profile.d/': File exists
    root@castle:/# cd /etc/profile.d/
    root@castle:/etc/profile.d# wget bootstrap in WebOS Internals - Gitorious
    blobs/raw/master/etc/profile.d/optware
    Connecting to gitorious.org (87.238.52.168:80)
    wget: can't open 'optware': File exists
    root@castle:/etc/profile.d# export MYUSER=jai #
    root@castle:/etc/profile.d# adduser -h /var/home/$MYUSER $MYUSER #
    Changing password for jai
    New password:
    Bad password: too weak
    Retype password:
    Password for jai changed by root
    root@castle:/etc/profile.d# # install portion
    root@castle:/etc/profile.d# ipkg-opt install sudo
    Package sudo (1.7.0-1) installed in root is up to date.
    Nothing to be done
    Successfully terminated.
    root@castle:/etc/profile.d# ln -s /opt/bin/sudo /usr/local/bin/sudo
    ln: /usr/local/bin/sudo: File exists
    root@castle:/etc/profile.d# ln -s /opt/bin/visudo /usr/local/bin/visudo
    ln: /usr/local/bin/visudo: File exists
    root@castle:/etc/profile.d# # configure portion
    root@castle:/etc/profile.d# chmod 640 /opt/etc/sudoers
    root@castle:/etc/profile.d# echo "$MYUSER ALL=(ALL) ALL" >> /opt/etc/sudoers
    root@castle:/etc/profile.d# chmod 440 /opt/etc/sudoers
    root@castle:/etc/profile.d#
    root@castle:/etc/profile.d#

    This is what I'm getting currently:

    login as: jai
    jai@XXX.XXX.X.XXX's password:
    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    jai@castle:~$ sudo -s
    >>> /opt/etc/sudoers: syntax error near line 32 <<<
    >>> /opt/etc/sudoers: syntax error near line 33 <<<
    sudo: parse error in /opt/etc/sudoers near line 32
    sudo: no valid sudoers sources found, quitting
    jai@castle:~$
  8. #8  
    What command are you running that gives you this error?

    /bin/sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")

    also, type this command

    more /opt/etc/sudoers

    So we can see if your sudoers file is set up right.
  9. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #9  
    Quote Originally Posted by Elysian893 View Post
    What command are you running that gives you this error?

    /bin/sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")

    also, type this command

    more /opt/etc/sudoers

    So we can see if your sudoers file is set up right.
    I was just simply trying to run the command listed above. Here's what I get when I type more /opt/etc/sudoers:

    login as: jaihawk
    jaihawk@xxx.xxx.x.xxx's password:
    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    jaihawk@castle:~$ cd /usr/palm/applications/com.palm.app.phone/images/ls
    -sh: cd: can't cd to /usr/palm/applications/com.palm.app.phone/images/ls
    jaihawk@castle:~$ more /opt/etc/sudoers
    more: /opt/etc/sudoers: Permission denied
    jaihawk@castle:~$

    I do have developer mode turned off on the phone currently, so let me know if that needs to be turned back on. Thank you so very much for your help.
  10. #10  
    Quote Originally Posted by jaihawk View Post
    I was just simply trying to run the command listed above. Here's what I get when I type more /opt/etc/sudoers:

    login as: jaihawk
    jaihawk@xxx.xxx.x.xxx's password:
    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    jaihawk@castle:~$ cd /usr/palm/applications/com.palm.app.phone/images/ls
    -sh: cd: can't cd to /usr/palm/applications/com.palm.app.phone/images/ls
    jaihawk@castle:~$ more /opt/etc/sudoers
    more: /opt/etc/sudoers: Permission denied
    jaihawk@castle:~$

    I do have developer mode turned off on the phone currently, so let me know if that needs to be turned back on. Thank you so very much for your help.
    Why did you turn developer mode off? No wiki says to do that, and theres really no reason to.

    Also, I see you're putting the ls command at the end of your cd command. Don't do that. do it like this

    cd /usr/palm/applications/com.palm.app.phone/images/
    ls
  11. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #11  
    Quote Originally Posted by Elysian893 View Post
    Why did you turn developer mode off? No wiki says to do that, and theres really no reason to.

    Also, I see you're putting the ls command at the end of your cd command. Don't do that. do it like this

    cd /usr/palm/applications/com.palm.app.phone/images/
    ls
    predev wiki states:

    10. Once you are able to ssh in, disable dev mode. Dev Mode enabled opens the firewall up not a safe position to be in. Unless you mess up and NEED to telnet or novacom in again, keep dev mode off.

    That's why I turned it off.

    Taking your advice, I was able to change the directory as stated in the command line and then list what was in it.

    When I tried to copy one of the many files to make a backup using this command:

    cp /usr/palm/applications/com.palm.app.phone/images/dialpad-backspace.png /media/internal/

    I get the message that it cannot create the directory, access is restricted. I assume that means that somehow my user didn't get set up properly with root access. Is that correct?
  12. #12  
    your user does not have root access.
    you have to do sudo cp /user... yada yada
    to have root rights

    You can of course do sudo - or sudo su to get PROMOTED to root, but generall, that's a bad idea. Too dangerous
  13. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #13  
    Quote Originally Posted by rboatright View Post
    your user does not have root access.
    you have to do sudo cp /user... yada yada
    to have root rights

    You can of course do sudo - or sudo su to get PROMOTED to root, but generall, that's a bad idea. Too dangerous
    Thank you for your response. When I try, I get this:

    jai@castle:/usr/palm/applications/com.palm.app.phone/images$ sudo cp /usr/palm/a
    pplications/com.palm.app.phone/images/dialpad-backspace.png /media/internal
    >>> /opt/etc/sudoers: syntax error near line 32 <<<
    >>> /opt/etc/sudoers: syntax error near line 33 <<<
    sudo: parse error in /opt/etc/sudoers near line 32
    sudo: no valid sudoers sources found, quitting
    jai@castle:/usr/palm/applications/com.palm.app.phone/images$

    So I'm guessing that my user is not set up correctly since I'm getting that message?
  14. #14  
    while you were in as root, did you do the ipkg-opt install sudo?
    did you add /opt/bin to your path?

    There are steps that should have taken care of this.
  15. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #15  
    Quote Originally Posted by rboatright View Post
    while you were in as root, did you do the ipkg-opt install sudo?
    did you add /opt/bin to your path?

    There are steps that should have taken care of this.
    I sure did. Here's the log of me trying those steps again.

    /bin/sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    root@castle:/# # install portion
    root@castle:/# ipkg-opt install sudo
    Package sudo (1.7.0-1) installed in root is up to date.
    Nothing to be done
    Successfully terminated.
    root@castle:/# ln -s /opt/bin/sudo /usr/local/bin/sudo
    ln: /usr/local/bin/sudo: File exists
    root@castle:/# ln -s /opt/bin/visudo /usr/local/bin/visudo
    ln: /usr/local/bin/visudo: File exists
    root@castle:/# # configure portion
    root@castle:/# chmod 640 /opt/etc/sudoers
    root@castle:/# echo "$MYUSER ALL=(ALL) ALL" >> /opt/etc/sudoers
    root@castle:/# chmod 440 /opt/etc/sudoers
  16. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #16  
    To add... I additionally get this:

    root@castle:/# sudo
    >>> /opt/etc/sudoers: syntax error near line 32 <<<
    >>> /opt/etc/sudoers: syntax error near line 33 <<<
    >>> /opt/etc/sudoers: syntax error near line 35 <<<
    sudo: parse error in /opt/etc/sudoers near line 32
    sudo: no valid sudoers sources found, quitting
  17. #17  
    I was having the exact same problem. I'm no Linux expert, but I was able to get the issue resolved by removing the sudo package with : "ipkg-opt remove sudo" from root using Novacom

    I again followed the wiki steps for "Enable a method for your new unprivileged user account to gain root privileges."

    Everything worked fine after that, perhaps we entered something incorrect. I used copy/paste the second time. Good luck.
  18. #18  
    I struggled with the exact same problem, and finally ended up fixing the problem by using vi to edit the sudoers file.

    I just added:

    Code:
    $(whatever your user name is) ALL=(ALL) ALL
    to the file right below:

    Code:
    $root ALL=(ALL) ALL
    vi can be a little tricky to use but there are a couple of pointers under Basic Linux Use there at Pre Dev Wiki.
  19. jaihawk's Avatar
    Posts
    66 Posts
    Global Posts
    154 Global Posts
       #19  
    thehustleman and KenCorbettJr:

    Thank you very much for your response. After trying both of your recommendations, I am still stuck with:

    login as: jaihawk
    jaihawk@xxx.xxx.x.xxx's password:
    Access denied
    jaihawk@xxx.xxx.x.xxx's password:
    -sh: /etc/profile.d/sudo: line 1: syntax error: word unexpected (expecting ")")
    jaihawk@castle:~$

    Should I just restore my phone back to how it was prior to rooting and try again? If so, how do I do that?

Posting Permissions