Re: Python init



On Tue, Aug 21, 2007 at 07:11:57PM -0700, Steve Lamb wrote:

Not that all of the libraries need to be moved into the root partition
for it to function as a stable init platform. Outside of sys (which is
compiled in), os, re, shutil, time and datetime I can't think of anything
that is needed for scripts running at init time. Certainly not many of the
extended Python libraries like a minimal web server, a whole suite for
handling email and MIME, TK/TCL bindings and so on. A very rough check and
I think 2.5Mb would be sufficient to serve as an init platform and natively
cover more than 80-90% of any operation an init script would need. So that
increase of 10-20% at 10Mb is more like 3-5%, if that.

Neat. Anyone have a testbed to try it on? I mean, move the minimal
python stuff to /bin and /lib and remove it from /usr, verify that it
runs, then try replacing some initscripts? I'm all out of spare boxes
right now.

Taken to the nth degree, it could totally change how the initscripts
work. Instead of separate scripts in /etc/init.d run one at a time by
run-parts, they could be individual modules (and hense optimized), run
by a new /etc/init.d/rc python script. This would start off by
importing each module then running its main function. This would
totally do away with the process overhead of the sysVinit system while
maintaining support for run levels.

However, since unixes are in part differentiated in how they handle init
scripts, replacing sysVinit with PythonInit would be a huge deal. At a
minimum, it would require a new update-rc.d command so that packages
would be setup correctly. Update-rc.d would also have to detect if a
package included an sh startup script and setup the PythonInit to
os.system the script instead of loading it as a module.

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Python init
    ... that is needed for scripts running at init time. ... I think 2.5Mb would be sufficient to serve as an init platform and natively ... cover more than 80-90% of any operation an init script would need. ... python stuff to /bin and /lib and remove it from /usr, ...
    (Debian-User)
  • Re: Python init
    ... However that does not prevent Python from utilizing the script and having the possibility of it being compiled later on. ... /bin and /lib would increase the size of the root filesystem by 10%-20% on embedded systems -- where the size of things that must be in flash is a critical resource. ... A very rough check and I think 2.5Mb would be sufficient to serve as an init platform and natively cover more than 80-90% of any operation an init script would need. ...
    (Debian-User)
  • Re: perl to python
    ... sed and perl can let you do all that quick command line stuff. ... into a full blown script. ... scripts, call it from the python interpreter, whatever I need. ... If I stick to the traditional unix approach, ...
    (comp.lang.python)
  • Re: Learning Tkinter
    ... and how the command option is used to call the function callback. ... gui programming to see if the python programs I have written can be made ... search their computer for this file, execute the python code and then ... This is the meaning of the test on __name__: this magical variable is set to the string '__main__' if and only if the current script is the top-most one, i.e the one you ran python on. ...
    (comp.lang.python)
  • Correct way to handle independent interpreters when embedding in a single-threaded C++ app
    ... The Python interpreter is ... interpreter and provides an extension module to expose ... manage each script runs in a new interpreter. ... globals that could cause issues. ...
    (comp.lang.python)