[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHClient Exit Scripts



In <[🔎] 84960162-4435-43B2-A07B-3361F8BDA0BA@halblog.com>, Hal Vaughan wrote:
>2) It will only run bash scripts.  I tried putting a Perl script in that
>directory and it wouldn't work, so I had to put a bash script in that
>directory to run my Perl script.

This seems wrong.  Did your perl script have the correct "she-bang" line as 
the first line of the file: #!/usr/bin/perl ?  Did it have execute 
permissions?

Like many parts of Debian, I'd expect this to be using run-parts or 
equivalent, which simply makes a C/system call to "exec()".  On Linux, exec() 
handles ELF executables with the +x bit and text files with a "she-bang" line 
and the +x bit.

(POSIX/SUS Note: a "she-bang" line inhibits any expectation of standard 
behavior; it makes the entire interpretation of the script system-dependent.  
On the other hand, exec() is not required to handle scripts at all; a 
compliant shell must handle the exec() failure and interpret the script 
itself, but exec() isn't just called by shells.)
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: