Find the answer to your Linux question:
Results 1 to 4 of 4
Ok, Why isnt this working. I have a FedoraCore 6 PC with Fluxbox running. I use fbdesk for Icons and that is were the Mayhem begins. They dont go to ...
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422

    Chroot + Bash Scripting

    Ok, Why isnt this working.
    I have a FedoraCore 6 PC with Fluxbox running.
    I use fbdesk for Icons and that is were the Mayhem begins. They dont go to the place that I've put them when I closed the system the last time.
    Ok but I have linked the Icons to a Script.
    Eg Firefox.
    When somebody clicks the Firefox button the following script is executed.:
    Code:
    #!/bin/bash
    #if [ sh `~/etc/chkmount` ] (This doesnt work either but I dont really care about that now)
    #{
     sh ~/.buildchroot 
    #}
    sudo /usr/sbin/chroot ~ /bin/bash
    perl upd_firefox.pl
    firefox
    perl upd_firefox.pl
    I get some troubles with that. Since he Chroots and then stops with the script.
    Is there a way to Chroot and then continue with the script?

    As you see this script also starts .buildchroot
    That code is:
    Code:
    sudo /bin/mount -r -o bind /lib /home/gentoo/lib
    sudo /bin/mount -r -o bind /dev /home/gentoo/dev
    sudo /bin/mount -r -o bind /bin /home/gentoo/bin
    sudo /bin/mount -r -o bind /usr /home/gentoo/usr
    sudo /bin/mount    -o bind /var /home/gentoo/var
    sudo /bin/mount -r -o bind /sys /home/gentoo/sys
    sudo /bin/mount -r -o bind /sbin /home/gentoo/sbin
    sudo /bin/mount -r -o bind /etc /home/gentoo/etc
    Ok and when I run the entire script from Bash Myself without going to the Button first
    And I am in the Chroot.
    When I enter firefox he doesnt start it..

    Does anyone have any idea were I am making a Mistake..

    Thanks alot.

    Cheers,
    Robin


    Edit:
    I thought I had to say this:
    THIS IS ON THE USER ACCOUNT THAT IS NAMED GENTOO
    New Users, please read this..
    Google first, then ask..

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    I changed one code now.
    But it still doesnt work..
    Code:
    #!/bin/bash
    #if [ sh `~/etc/chkmount` ] (This doesnt work either but I dont really care about that now)
    #{
     sh ~/.buildchroot 
    #}
    sudo /usr/sbin/chroot ~ /bin/bash
    perl upd_firefox.pl
    firefox
    perl upd_firefox.pl
    is
    Code:
    #!/bin/bash
    #if [ sh `~/etc/chkmount` ] (This doesnt work either but I dont really care about that now)
    #{
     sh ~/.buildchroot 
    #}
    sudo /usr/sbin/chroot ~ /bin/bash
    perl /.src/upd_firefox.pl
    firefox
    perl /.src/upd_firefox.pl
    I even tryed to put && behind the ChrootPart..
    Why doesnt Firefox start in Chrootmode?

    Well, anywho wants to help me
    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Bouce.
    I hope my Topic is on the Top again and that there is anyone who might be able to help me

    Cheers,
    Robin

    Edit: I think I fixed it.
    But I cant test since my sudo isnt corrent...
    but I am really a idiot.
    I forgot that the syntax was:
    chroot {DEST} {COMMAND TO RUN}
    Thanks alot.. anywh.
    New Users, please read this..
    Google first, then ask..

  4. #4
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    I figured something else out.
    When I do that.
    It works...
    But then the entire system breaks down. :S
    Anyone knows why:
    perl /.src/upd_firefox.pl
    sudo /usr/sbin/chroot ~ /usr/bin/firefox
    perl /.src/upd_firefox.pl

    Makes the user entire chroot.?
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...