Reason Exec Format Error
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 222 Star 6,668 Fork 637 fish-shell/fish-shell Code Issues 559 Pull requests 6 Projects 1 Wiki Pulse Graphs New issue Failed exec format error python to execute process:startx #1281 Closed vgbsd opened this Issue Feb 3, 2014 ·
Cannot Execute Binary File Exec Format Error
4 comments Labels question Milestone No milestone Assignees No one assigned 3 participants vgbsd commented Feb 3,
Fish Shell
2014 FreeBSD 10 fish, version 2.1.0 Failed to execute process '/usr/local/bin/startx'. Reason: exec: Exec format error The file '/usr/local/bin/startx' is marked as an executable but could not be run by the operating system. The user-friendly shell member zanchey commented Feb 4, 2014 Could you tell us the output of file /usr/local/bin/startx and of uname -a? Thanks! vgbsd commented Feb 4, 2014 usr/local/bin/startx #!/bin/sh # # This is just a sample implementation of a slightly less primitive # interface than xinit. It looks for user .xinitrc and .xserverrc # files, then system xinitrc and xserverrc files, else lets xinit choose # its default. The system xinitrc should probably do things like check # for .Xresources files and merge them in, start up a window manager, # and pop a clock and several xterms. # # Site administrators are STRONGLY urged to write nicer versions. # unset DBUS_SESSION_BUS_ADDRESS unset SESSION_MANAGER userclientrc=$HOME/.xinitrc sysclientrc=/usr/local/etc/X11/xinit/xinitrc userserverrc=$HOME/.xserverrc sysserverrc=/usr/local/etc/X11/xinit/xserverrc defaultclient=xterm defaultserver=/usr/local/bin/X defaultclientargs="" defaultserverargs="" defaultdisplay=":0" clientargs="" serverargs="" enable_xauth=1 # Automatically determine an unused $DISPLAY d=0 while true ; do [ -e /tmp/.X$d-lock ] || break d=$(($d + 1)) done defaultdisplay=":$d" unset d whoseargs="client" while [ x"$1" != x ]; do case "$1" in # '' required to prevent cpp from treating "/*" as a C comment. /''*|\./''*) if [ "$whoseargs" = "client" ]; then if [ x"$client" = x ] && [ x"$clientargs" = x ]; then client="$1" else clientargs="$clientargs $1" fi else if [ x"$server" = x ] && [ x"$serverargs" = x ]; then server="$1" else serverargs="$serverargs $1" fi fi ;; --) whoseargs="server" ;; *) if [ "$whoseargs" = "client" ]; then clientargs="$clientargs $1" else # display must be the FIRST server argument if [ x"$serverargs" = x ] && \ expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then display="$1" else serve
run in the proper shell. And I run fish as my normal user and have run it as the root shell in the past. That being said not all scripts are properly written. In particular scripts with a #!/bin/sh have been known to contain bash specific syntax as most linux systems use bash in bourne compatability mode for /bin/sh (I think debian uses dash, and the BSDs still have bourne shell) If someone is truely paranoid about a critical script being run they should of course run the default shell. But these methods seem hackish ways to keep the default shell and use fish. Why not go the old root/toor route and have two users with the same uid/gid different names and different shells. I actually https://github.com/fish-shell/fish-shell/issues/1281 run all of my root accounts like this with bash as root and fish as toor just in case something is broken and expecting bash. To get a toor account that uses fish run: # useradd -ou 0 -g 0 toor # passwd toor # chsh -s /usr/bin/fish toor And then instead of su call su toor and everything else is the same as root (even the prompts say root) you just have a different shell. I imagine that https://wiki.archlinux.org/index.php/Talk:Fish the same could be done with a regular user say 'johndoe' and a user 'johndoefish' that has a different default shell. Not publishing this on the page without comment since toor has been superceeded for it's intended use purposes (it was used for recovering root but now we have single user mode and bin isn't seperate anymore). However, the concept seems transferable to the question at hand as the desire is to have one user with two shells and that is one thing toor was used for. Michorn (talk) 05:57, 6 November 2014 (UTC) 1. A #!/bin/sh script will still be run under /bin/sh, whatever that may be, not fish. 2. All scripts must have a shebang line, or be invoked via an argument to a predefined shell (e.g. bash script). ./script with no shebang line would cause something like: Failed to execute process './script'. Reason: exec: Exec format error The file './script' is marked as an executable but could not be run by the operating system. 3. "Bash in bourne compatibility mode" isn't really bourne compatible then, is it? All I can say is that developers really should know what language they're writing in. 4. The mentioned "pseudo-default shell" methods, if you will, do seem kind of hacky, but kind of not. I'm not sure how I feel about them. Personally, I just changed my default shell for my own user account, a
HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Linux Forums > Linux - General chroot: cannot execute /bin/sh: Exec format error User Name Remember Me? Password http://www.linuxquestions.org/questions/linux-general-1/chroot-cannot-execute-bin-sh-exec-format-error-674683/ Linux - General This Linux forum is for general Linux questions and discussion. If it is Linux Related and doesn't seem to fit in any other forum then this is the place. Notices Welcome http://apple.stackexchange.com/questions/244846/exec-format-error-ifconfig to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced exec format search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account exec format error login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 10-06-2008, 06:36 PM #1 jnojr Member Registered: Sep 2007 Location: San Diego, CA Posts: 202 Rep: chroot: cannot execute /bin/sh: Exec format error I took a dd image of a machine, restored it to a similar machine (the first was a Dell SC1425, the s
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Different Questions Tags Users Badges Unanswered Ask Question _ Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top exec format error: ifconfig up vote 0 down vote favorite I tried to execute $ ifconfig zsh: exec format error: ifconfig After looking for the binary file: $ whereis ifconfig /sbin/ifconfig At this moment, I read that this error can occur when binary does not have permission to execute, I went check it: $ ll /sbin (...) -r-xr-xr-x@ 1 root wheel 0B Sep 19 2014 ifconfig (...) I have execute permissions for everyone, I even tried to execute as root and still does not work. And then I looked that file as a size of 0 (zero) bytes. This must be related to my problem. I does not know what can be the reason for this. I have used the command a lot of times in the past. The only things that occurs me, is that in recent days I have upgraded Docker from Homebrew (boot2docker to native beta) and then executed brew upgraded. I'm wondering if anyone knows how to reinstall or recover ifconfig binary?file? yosemite command-line zsh share|improve this question asked Jul 5 at 17:49 Paulo Oliveira 1558 I wouldn't expect to see extended attributes on a command line tool. I'm guessing that there may be and issue with hfs compression. Can you post the results of this command- xattr -l /sbin/ifconfig? Also, I would make a current back up and check the file system. –fd0 Jul 5 at 19:33 With xattr /sbin/ifconfig I have com.apple.ResourceFork and com.apple.decmpfs. As you said, I did not expected either I have cleaned both and nothing changes unless date column. How do you suggest to check de file system? DiskUtil maybe? This is the disk encryption fault (file vault)? –Paulo Oliveira Jul 5 at 19:44 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By