public inbox for gentoo-amd64@lists.gentoo.org
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: gentoo-amd64@lists.gentoo.org
Subject: [gentoo-amd64] Re: Kernel-3.10 Nvidia Emerge Failure And Other Stuff
Date: Wed, 3 Jul 2013 02:10:58 +0000 (UTC)	[thread overview]
Message-ID: <pan$a4724$48b18bea$923b7d46$ee4064e3@cox.net> (raw)
In-Reply-To: 20130702125454.161f55f908460aedaabf030a@comcast.net

Frank Peters posted on Tue, 02 Jul 2013 12:54:54 -0400 as excerpted:

(Thanks for the insight into your more direct boot scripts.  I've done 
that with some things here, including with my own custom suspend/
hibernate scripts, but not with my bootscripts.)

> So what does the "#!" option accomplish?  Does it allow the kernel to
> effect redirection based on "#!?"

Yes.

> This should only be necessary if bash
> itself is not invoked, but in boot-up based on init and inittab, bash, I
> believe, is automatically invoked for all scripts.  But yet the agetty
> program, after boot-up is essentially complete, fails to execute the
> bash script in its parameter list.  At this point is it agetty, or the
> kernel, that is responsible for executing the autologin script?

Given your customized setup I don't know for sure, but I can make an 
educated guess that at the point that breaks in that setup, the already 
running bootscript invokes a second script directly by name, as if it 
were a binary.  With the kernel shebang option, that works as long as 
that second script is set executable.  But without the kernel shebang 
option, it fails.

The alternative that WOULD work, would be to call that second script 
using an indirect invocation with bash as the command executed directly 
by the kernel and the second script as a parameter to it, like so:

bash (bash options) /path/to/script (script arguments)

By doing it that way, the kernel invokes bash, which knows how to handle 
it, and can (I believe) in fact handle #!/bin/perl and other foreign 
interpreter shebangs as well, instead of the kernel attempting to execute 
the script directly, and failing if the kernel doesn't have shebang 
support loaded.

(Altho it'll be obvious to some, it's also worth mentioning that with 
indirect script invocation via direct invocation of the interpreter, 
feeding it the script by commandline, the script itself no longer needs 
to have executable permissions, since bash is perfectly happy to execute 
any file it is fed on the commandline as long as it can read it, while 
the kernel refuses to execute files without the executable bit set.)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman



  reply	other threads:[~2013-07-03  2:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01 19:35 [gentoo-amd64] Kernel-3.10 Nvidia Emerge Failure And Other Stuff Frank Peters
2013-07-01 19:51 ` Mark Knecht
2013-07-01 20:04   ` Dale
2013-07-02  0:57     ` B Vance
2013-07-02  0:38       ` Frank Peters
2013-07-01 20:30   ` Mark Knecht
2013-07-01 20:51     ` Rich Freeman
2013-07-04 23:57     ` Mark Knecht
2013-07-05  1:08       ` Frank Peters
2013-07-01 21:06   ` Frank Peters
2013-07-02 11:29 ` [gentoo-amd64] " Duncan
2013-07-02 16:54   ` Frank Peters
2013-07-03  2:10     ` Duncan [this message]
2013-07-04 23:48 ` Sven Köhler
2013-07-05  1:28   ` Frank Peters
2013-07-05 16:41     ` Sven Köhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='pan$a4724$48b18bea$923b7d46$ee4064e3@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=gentoo-amd64@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox