Re: [gentoo-user] Running Scripts
Uwe Thiem writes: I am out of ideas - and still a bit puzzled how /usr/bin/env got involved (see original post). According to the od output, the first line is not #!/usr/bin/python, but #!/usr/bin/env python. But that seems to work well for me, too. I'd try to put the script onto several file systems and try out what happens there. emerge starts with #!/usr/bin/python -O, and I guess this is still working. Alex -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On Fri, 27 Jul 2007 13:13:08 -0500 Greg Lindstrom wrote: ..[snip]... I'm not sure what you are asking here. $ ls -l /usr/bin/env lrwxrwxrwx 1 root root 8 May 18 2006 /usr/bin/env - /bin/env $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 May 18 2006 /usr/bin/python - python2.4 This looks suspicious to me. /usr/bin/python is a symlink to python2.4. Where is python2.4? Is it on your path? Can you run it with command python2.4 ??? What do the following commands report: which python which python2.4 HTH. Regards, David -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 As another alternative, you could try re-emerging the coreutils package. Also, check your $PATH. It should include /bin and /usr/bin quite at the beginning. - -- Arturo Buanzo Busleiman - Consultor Independiente en Seguridad Informatica SHOW DE FUTURABANDA - Sabado 18 de Agosto 2007 (Speed King, Capital Federal) Entradas anticipadas a traves de www.futurabanda.com.ar - Punk Rock Melodico -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGrIxkAlpOsGhXcE0RCgX8AJ4xWqAYMFI4IMXEVaWU/FFkgGdEwwCfRlwc mGt3z54ELyCixS8YXONmjIQ= =zIw7 -END PGP SIGNATURE- -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On 29 July 2007, David Relson wrote: On Fri, 27 Jul 2007 13:13:08 -0500 Greg Lindstrom wrote: ..[snip]... I'm not sure what you are asking here. $ ls -l /usr/bin/env lrwxrwxrwx 1 root root 8 May 18 2006 /usr/bin/env - /bin/env $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 May 18 2006 /usr/bin/python - python2.4 This looks suspicious to me. /usr/bin/python is a symlink to python2.4. Where is python2.4? Is it on your path? Nothing suspicious here. /usr/bin/python is a symlink to /usr/bin/puthon2.4 - at least on a gentoo system. And while python2.4 *is* in the path (because /usr/bin is), it doesn't really matter as long as /usr/bin/python is. Uwe -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
Am Freitag, 27. Juli 2007 schrieb Florian Philipp: Please post the output of cat /etc/group | grep $username Or just: id Bye... Dirk signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Running Scripts
On 7/28/07, Greg Lindstrom [EMAIL PROTECTED] wrote: Wow! Thanks for the help. See my comments below pertaining to individual remarks. --greg Alex asked: is is possible that you saved the text file in DOS format, with CR-LF endings instead of LF only? If od -t x2 hello.py shows 0a0d sequences, this is the case. You could use dos2unix to convert. $ od -t x2 hello.py 000 2123 752f 7273 622f 6e69 652f 766e 7020 020 7479 6f68 0a6e 7270 6e69 2074 6827 6c65 040 6f6c 202c 6f77 6c72 2764 000a 053 Nope. That looks good. Boyd Wrote: which env ls -l /usr/bin/env ls -l /usr/bin/python I'm not sure what you are asking here. $ ls -l /usr/bin/env lrwxrwxrwx 1 root root 8 May 18 2006 /usr/bin/env - /bin/env $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 May 18 2006 /usr/bin/python - python2.4 Uwe Thiem [EMAIL PROTECTED] wrote: This leads to the question whether you can start *any* executable from your home directory (assuming you stored your script somewhere under your home directory). If not so, do you mount your /home partition with the noexec option? I have the same problem with Perl scripts; I haven't tried any others. Is there a way to tell how the partition is mounted? I'm sorry to say that I am a lowly user on the system and don't really know much about how it is set up. Thank-you so much for your attention. This is a small problem, as I can run the scripts with python (or perl) then the filename. I'd just like to understand what's happening. --greg try a plain old bash script and see if that works, and try this and see if it works: cat testrun.c #include stdio.h int main(int argc, int* argv) { printf(helloworld); } ( press ctrl+d here ) make testrun ./testrun if that fails to do ./testrun, then i figgure the FS your on isn't execable. sorry. ^^ -- Kent ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x| print enNOSPicAMreil [EMAIL PROTECTED][(2*x)..(2*x+1)]}' -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
Eric Martin: what does ls -l /etc/fstab show? $ ls -l /etc/fstab -rw-r- 1 root root 1434 Nov 29 2006 /etc/fstab Florian Phillip: Please post the output of cat /etc/group | grep $username Returns nothing. When I substitute my username (glindstrom) in it also returns nothing. Arthuro Buanzo: Try sending us the output of the mount command. $ mount /dev/sda2 on / type ext3 (rw,noatime,acl) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) udev on /dev type tmpfs (rw,nosuid) devpts on /dev/pts type devpts (rw) /dev/sda5 on /var type ext3 (rw,nodev,noatime) /dev/sda6 on /usr type ext3 (rw,nodev,noatime,acl) /dev/sda7 on /home type ext3 (rw,nosuid,nodev) /dev/sda8 on /m01 type ext3 (rw,nosuid,nodev,noatime,acl) none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev) none on /tmp type tmpfs (rw,size=32M) usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85) //express/bender_departments on /mnt/depts type smbfs (0) //express/bender_public on /mnt/public type smbfs (0) //express/bender_everyone on /mnt/everyone type smbfs (0) //express/edi_images on /mnt/edi_images type smbfs (0) Dirk Heinrichs: Or just: id $ id uid=10002(glindstrom) gid=1000(people) groups=1000(people),1002(cvs),1005(it),1022(p_it),1027(appdev) Kent Fredric: try a plain old bash script and see if that works, and try this and see if it works: $ ./testrun -bash: ./testrun: Permission denied Sigh. Thanks for all of your help, guys. It looks like I'm not set up to execute sctripts in this manner. I'll continue to put python or perl in front of them Thanks again, --greg
Re: [gentoo-user] Running Scripts
On 28 July 2007, Kent Fredric wrote: try a plain old bash script and see if that works, and try this and see if it works: cat testrun.c #include stdio.h int main(int argc, int* argv) { printf(helloworld); } ( press ctrl+d here ) make testrun Without writing a Makefile, make won't build the program. ;-) You better try this: gcc -o testrun testrun.c Uwe ./testrun if that fails to do ./testrun, then i figgure the FS your on isn't execable. sorry. ^^ -- Kent ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x| print enNOSPicAMreil [EMAIL PROTECTED][(2*x)..(2*x+1)]}' -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On 28 July 2007, Greg Lindstrom wrote: $ mount /dev/sda2 on / type ext3 (rw,noatime,acl) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) udev on /dev type tmpfs (rw,nosuid) devpts on /dev/pts type devpts (rw) /dev/sda5 on /var type ext3 (rw,nodev,noatime) /dev/sda6 on /usr type ext3 (rw,nodev,noatime,acl) /dev/sda7 on /home type ext3 (rw,nosuid,nodev) Hm... sems my idea about /home being mounted with noexec doesn't hold. I am out of ideas - and still a bit puzzled how /usr/bin/env got involved (see original post). Uwe -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On 7/29/07, Uwe Thiem [EMAIL PROTECTED] wrote: On 28 July 2007, Kent Fredric wrote: try a plain old bash script and see if that works, and try this and see if it works: cat testrun.c #include stdio.h int main(int argc, int* argv) { printf(helloworld); } ( press ctrl+d here ) make testrun Without writing a Makefile, make won't build the program. ;-) funny, it did for me :P just make testrun does ok,.. testrun = target, what makes testrun?.. *looks around* ah... heres a testrun.c, that aught to do it :D $ls -l testrun.c Makefile ls: cannot access Makefile: No such file or directory -rw-r--r-- 1 devious users 77 2007-07-29 00:24 testrun.c $make testrun cc testrun.c -o testrun $ ./testrun helloworld You better try this: gcc -o testrun testrun.c Uwe ./testrun if that fails to do ./testrun, then i figgure the FS your on isn't execable. sorry. ^^ -- Kent ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x| print enNOSPicAMreil [EMAIL PROTECTED][(2*x)..(2*x+1)]}' -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list -- Kent ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x| print enNOSPicAMreil [EMAIL PROTECTED][(2*x)..(2*x+1)]}' -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On Saturday 28 July 2007, Kent Fredric [EMAIL PROTECTED] wrote about 'Re: [gentoo-user] Running Scripts': On 7/29/07, Uwe Thiem [EMAIL PROTECTED] wrote: On 28 July 2007, Kent Fredric wrote: try a plain old bash script and see if that works, and try this and see if it works: cat testrun.c #include stdio.h int main(int argc, int* argv) { printf(helloworld); } ( press ctrl+d here ) make testrun Without writing a Makefile, make won't build the program. ;-) funny, it did for me :P $ls -l testrun.c Makefile ls: cannot access Makefile: No such file or directory -rw-r--r-- 1 devious users 77 2007-07-29 00:24 testrun.c $make testrun cc testrun.c -o testrun That cool, but don't count on it to work on all makes. I'm fairly sure an empty Makefile is valid, since there already suffix rules required by the standard -- there's just no default target. I guess GNU make takes that to the logical conclusion and lets you run entirely without a Makefile as long as you specify a target. -- Boyd Stephen Smith Jr. ,= ,-_-. =. [EMAIL PROTECTED] ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.org/ \_/ signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Running Scripts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Uwe Thiem wrote: Without writing a Makefile, make won't build the program. ;-) Actually, yes. If you have a file called something.c you can simply run: make something and it will compile something.c, link something.o and produce a binary named something. - -- Arturo Buanzo Busleiman - Consultor Independiente en Seguridad Informatica SHOW DE FUTURABANDA - Sabado 18 de Agosto 2007 (Speed King, Capital Federal) Entradas anticipadas a traves de www.futurabanda.com.ar - Punk Rock Melodico -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGq4R0AlpOsGhXcE0RCrIzAJ0UoX3FRWZzMvOEeA5LVkYg/uQVnQCfTh43 7jCMqXQ39/miaaBy3FwdoWg= =EPsg -END PGP SIGNATURE- -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Uwe Thiem wrote: I am out of ideas - and still a bit puzzled how /usr/bin/env got involved (see original post). Heh, if we had enough trust, I'd remote login to the server and see what's wrong by myself :) - -- Arturo Buanzo Busleiman - Consultor Independiente en Seguridad Informatica SHOW DE FUTURABANDA - Sabado 18 de Agosto 2007 (Speed King, Capital Federal) Entradas anticipadas a traves de www.futurabanda.com.ar - Punk Rock Melodico -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGq4TnAlpOsGhXcE0RCq4WAJ9w9zvOkfTXFyBCm5fpiygGJ1cUXACeLSn4 gYHmRwIuIzQcZZW/7mSpxSQ= =4O8N -END PGP SIGNATURE- -- [EMAIL PROTECTED] mailing list
[gentoo-user] Running Scripts
Hello- I am programming Python (2.4.1) scripts to run on our Gentoo boxes and am having a bit of trouble I was hoping you could help me with. My file, hello.py looks like this: #!/usr/bin/python print 'hello, python' I add execute permission to the file and try to run it as follows: myprompt $ ./hello.py and get -bash: ./hello.py: /usr/bin/env: bad interpreter: Permission denied running /usr/bin/python brings up the python shell, so that's in place. What am I missing to run these files (they run fine with I type in 'python' before the filename). BTW, I have the same issue running Perl scripts which is why I'm asking the question here. Thanks for your help, --greg
Re: [gentoo-user] Running Scripts
On Friday 27 July 2007, Greg Lindstrom [EMAIL PROTECTED] wrote about '[gentoo-user] Running Scripts': -bash: ./hello.py: /usr/bin/env: bad interpreter: Permission denied running /usr/bin/python brings up the python shell, so that's in place. which env ls -l /usr/bin/env ls -l /usr/bin/python -- Boyd Stephen Smith Jr. ,= ,-_-. =. [EMAIL PROTECTED] ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.org/ \_/ signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Running Scripts
Greg Lindstrom writes: I am programming Python (2.4.1) scripts to run on our Gentoo boxes and am having a bit of trouble I was hoping you could help me with. My file, hello.py looks like this: #!/usr/bin/python print 'hello, python' I add execute permission to the file and try to run it as follows: myprompt $ ./hello.py and get -bash: ./hello.py: /usr/bin/env: bad interpreter: Permission denied is is possible that you saved the text file in DOS format, with CR-LF endings instead of LF only? If od -t x2 hello.py shows 0a0d sequences, this is the case. You could use dos2unix to convert. Just guessing, but I sometimes got similar errors in such cases. Alex -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On 27 July 2007, Greg Lindstrom wrote: Hello- I am programming Python (2.4.1) scripts to run on our Gentoo boxes and am having a bit of trouble I was hoping you could help me with. My file, hello.py looks like this: #!/usr/bin/python print 'hello, python' I add execute permission to the file and try to run it as follows: myprompt $ ./hello.py and get -bash: ./hello.py: /usr/bin/env: bad interpreter: Permission denied running /usr/bin/python brings up the python shell, so that's in place. So the symlink from /usr/bin/python to the real binary is correct and the real binary has the right permissions. If your line starting with #!/ weren't the first line in your script, you would get a different error message. Same if the # weren't the first character in that line. This leads to the question whether you can start *any* executable from your home directory (assuming you stored your script somewhere under your home directory). If not so, do you mount your /home partition with the noexec option? Uwe -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
Wow! Thanks for the help. See my comments below pertaining to individual remarks. --greg Alex asked: is is possible that you saved the text file in DOS format, with CR-LF endings instead of LF only? If od -t x2 hello.py shows 0a0d sequences, this is the case. You could use dos2unix to convert. $ od -t x2 hello.py 000 2123 752f 7273 622f 6e69 652f 766e 7020 020 7479 6f68 0a6e 7270 6e69 2074 6827 6c65 040 6f6c 202c 6f77 6c72 2764 000a 053 Nope. That looks good. Boyd Wrote: which env ls -l /usr/bin/env ls -l /usr/bin/python I'm not sure what you are asking here. $ ls -l /usr/bin/env lrwxrwxrwx 1 root root 8 May 18 2006 /usr/bin/env - /bin/env $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 May 18 2006 /usr/bin/python - python2.4 Uwe Thiem [EMAIL PROTECTED] wrote: This leads to the question whether you can start *any* executable from your home directory (assuming you stored your script somewhere under your home directory). If not so, do you mount your /home partition with the noexec option? I have the same problem with Perl scripts; I haven't tried any others. Is there a way to tell how the partition is mounted? I'm sorry to say that I am a lowly user on the system and don't really know much about how it is set up. Thank-you so much for your attention. This is a small problem, as I can run the scripts with python (or perl) then the filename. I'd just like to understand what's happening. --greg
Re: [gentoo-user] Running Scripts
On 27 July 2007, Greg Lindstrom wrote: Uwe Thiem [EMAIL PROTECTED] wrote: This leads to the question whether you can start *any* executable from your home directory (assuming you stored your script somewhere under your home directory). If not so, do you mount your /home partition with the noexec option? I have the same problem with Perl scripts; I haven't tried any others. Is there a way to tell how the partition is mounted? I'm sorry to say that I am a lowly user on the system and don't really know much about how it is set up. Post the content of your /etc/fstab. You should be able to do that as a normal user. Kinda funny: Writing this while listening to Queen's Another One Bites The Dust. ;-) Uwe -- Jethro Tull: Maybe, I am not done yet! -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Running Scripts
On 7/27/07, Uwe Thiem [EMAIL PROTECTED] wrote: Post the content of your /etc/fstab. You should be able to do that as a normal user. Nope. I am denied access to /etc/fstab. Could this be (part of) the problem? --greg
Re: [gentoo-user] Running Scripts
what does ls -l /etc/fstab show? On 7/27/07, Greg Lindstrom [EMAIL PROTECTED] wrote: On 7/27/07, Uwe Thiem [EMAIL PROTECTED] wrote: Post the content of your /etc/fstab. You should be able to do that as a normal user. Nope. I am denied access to /etc/fstab. Could this be (part of) the problem? --greg
Re: [gentoo-user] Running Scripts
Am Freitag 27 Juli 2007 21:04 schrieb Greg Lindstrom: On 7/27/07, Uwe Thiem [EMAIL PROTECTED] wrote: Post the content of your /etc/fstab. You should be able to do that as a normal user. Nope. I am denied access to /etc/fstab. Could this be (part of) the problem? --greg Please post the output of cat /etc/group | grep $username pgpKn0aCnqkB5.pgp Description: PGP signature
Re: [gentoo-user] Running Scripts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Greg Lindstrom wrote: Nope. I am denied access to /etc/fstab. Could this be (part of) the problem? Try sending us the output of the mount command. - -- Arturo Buanzo Busleiman - Consultor Independiente en Seguridad Informatica SHOW DE FUTURABANDA - Sabado 18 de Agosto 2007 (Speed King, Capital Federal) Entradas anticipadas a traves de www.futurabanda.com.ar - Punk Rock Melodico -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGqleqAlpOsGhXcE0RCiefAJ9eiZgbRs04kJT0nf8y5ygDstD6HwCfYbLo rrTgSnosMUavlvXP+ljyXZU= =HgEt -END PGP SIGNATURE- -- [EMAIL PROTECTED] mailing list