View previous topic :: View next topic |
Do you see any benefits of re-writing initsrcipts to Python? |
Yes, I see mostly benefits |
|
12% |
[ 7 ] |
No, I see mostly disadvantages |
|
37% |
[ 22 ] |
I see both benefits and disadvantages |
|
24% |
[ 14 ] |
I don't care what language is used in initscripts |
|
13% |
[ 8 ] |
Yes, let's re-write them, but to another language |
|
1% |
[ 1 ] |
Don't touch initscripts, no matter what benefits |
|
10% |
[ 6 ] |
|
Total Votes : 58 |
|
Author |
Message |
axxackall l33t
Joined: 06 Nov 2002 Posts: 651 Location: Toronto, Ontario, 3rd Rock From Sun
|
Posted: Thu May 01, 2003 4:09 am Post subject: Do you want initscripts in Python? |
|
|
Recent GWN pointed to very interesting mail-list discussion of gentoo developers about cons and pros of having initscripts on Python.
While developers pay more attention on development issues, it would be interesting to know the opinion of broader gentoo masses, let's say, of non-ebuilding or not-regularly-ebuilding users |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Thu May 01, 2003 8:15 am Post subject: |
|
|
Okay, supposing you make a mistake or, less likely, portage hoses itself and python. I've done it. Countless others have done it. Remember the whole range of issues when glibc went from 2.2 to 2.3? Those issues all killed python.
If the init scripts were in python, you'd be up sh1t creek without a paddle. Well, not that bad, but you'd certainly have to use a boot disk to recover your system, rather than be able to do it directly. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
duff Guru
Joined: 19 Jun 2002 Posts: 466 Location: Clemson, SC
|
Posted: Thu May 01, 2003 1:46 pm Post subject: |
|
|
I see no point in using Python for init scripts. Thier main function is to spawn new processes (ie.starting daemons), and a bash script is perfect in that case. |
|
Back to top |
|
|
Lovechild Advocate
Joined: 17 May 2002 Posts: 2858 Location: Århus, Denmark
|
Posted: Thu May 01, 2003 1:54 pm Post subject: |
|
|
I can see both good and bad... I mean we could go do a lot cool stuff with the init scripts - I'm thinking it might be possible to do something clever in a few lines to help people like me who switch networks on our laptops between reboots (school and home fx.) - python might makes this easier - and more fun
on the other hand it might create havoc, and we don't want that. |
|
Back to top |
|
|
Jarjar Apprentice
Joined: 21 Jul 2002 Posts: 265 Location: Sweden
|
Posted: Thu May 01, 2003 2:07 pm Post subject: |
|
|
charlieg wrote: | Okay, supposing you make a mistake or, less likely, portage hoses itself and python. I've done it. Countless others have done it. Remember the whole range of issues when glibc went from 2.2 to 2.3? Those issues all killed python.
If the init scripts were in python, you'd be up sh1t creek without a paddle. Well, not that bad, but you'd certainly have to use a boot disk to recover your system, rather than be able to do it directly. |
That is also why I voted no. I sure love python, it's my favorite language almost before C, though I don't think it would be wise to use it here. _________________ [Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7] |
|
Back to top |
|
|
Elay n00b
Joined: 30 Mar 2003 Posts: 25
|
Posted: Thu May 01, 2003 2:40 pm Post subject: |
|
|
it would be good if we lived in a perfect world. But Murphy lives as we all know.
It would break compatibility and habits.
my 2 cents |
|
Back to top |
|
|
panserg Apprentice
Joined: 16 Apr 2003 Posts: 188
|
Posted: Thu May 01, 2003 2:48 pm Post subject: |
|
|
How about OOP of Python? Would it be any good to have classes inheriting from more abstract classes common methds and properties of their behaviour? Honestly, each time I see the mess in /etc I want to re-write it to something more structured.
The only problem stops me (besides availability of free time) is that every daemon and utility wants to have own format of config files. So, at first the configuration facility must be created (aka LDAP), then it's API must be published and standardized. Then we should wait when all (most of) tools will be re-written to use such a configuration facility. Then we can re-write /etc (not only /etc/init.d).
Alternatevly, we can see how it's done with famous linuxconf. That configuration tool has own database and own UI to change it. Once you change something then it will generate actual config file and save it /etc. BTW, linuxconf handles initscripts as well. So, if we talk about porting something like linuxconf into Python and Gentoo than I am in support of it and eager to take a part. |
|
Back to top |
|
|
charlieg Advocate
Joined: 30 Jul 2002 Posts: 2149 Location: Manchester UK
|
Posted: Thu May 01, 2003 2:55 pm Post subject: |
|
|
You have some good points there panserg. Although maybe I'm being influenced by your uber cool avatar.
Anyway...
Yeah, OOP might be nice although I doubt it would be *that* handy since most initscripts vary somewhat and the shared parts are really fairly minor.
Perhaps having it as part of a Gentoo-ised linuxconf would be cool.
I liked Lovechild's point the best:
Lovechild wrote: | I mean we could go do a lot cool stuff with the init scripts - I'm thinking it might be possible to do something clever in a few lines to help people like me who switch networks on our laptops between reboots (school and home fx.) - python might make this easier |
Although the above example is probably possible using bash script. _________________ Want Free games?
Free Gamer - open source games list & commentary
Open source web-enabled rich UI platform: Vexi |
|
Back to top |
|
|
Lovechild Advocate
Joined: 17 May 2002 Posts: 2858 Location: Århus, Denmark
|
Posted: Thu May 01, 2003 3:11 pm Post subject: |
|
|
Well, it was all I had up my hat at the moment, but I think we could get some pretty advanced stuff in our initscripts, and almost for free.. |
|
Back to top |
|
|
panserg Apprentice
Joined: 16 Apr 2003 Posts: 188
|
Posted: Thu May 01, 2003 4:33 pm Post subject: |
|
|
Among "cool" thing requiring Python's "coolness" I would enlist at least:
1. starting daemon concurrently with run-time dependency control: it doesn't actually matter in which order they are started, it does matter that they depend on each other, python threads can work very good here;
2. fine-grained status control, i.e. BIND might be started, but it's still didn't cache its secondary zones, which are needed for some services, same for LDAP (service using local user are ok to start, but services using remotely cached users must wait), same for AFS (don't start apache yet if AFS did not sync FS with the doc root);
3. transactions: some changes in config files must be atomic, to avoid inconsistency (like, create the user and it's group in /etc/hosts and /etc/group at once);
4. version control of configuration values: should we keep dreaming about it or should we do something? Personally, I'd like to rollback changes several steps back. Also I'd like to have mulitple versions of some values - just for testing. |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Thu May 01, 2003 6:43 pm Post subject: |
|
|
You can do this using CVS very easily
panserg wrote: |
4. version control of configuration values: should we keep dreaming about it or should we do something? Personally, I'd like to rollback changes several steps back. Also I'd like to have mulitple versions of some values - just for testing. |
_________________ "I'm just very selective about the reality I choose to accept." -- Calvin |
|
Back to top |
|
|
axxackall l33t
Joined: 06 Nov 2002 Posts: 651 Location: Toronto, Ontario, 3rd Rock From Sun
|
Posted: Thu May 01, 2003 7:38 pm Post subject: |
|
|
Bloody Bastard wrote: | You can do this using CVS very easily |
The problem of CVS is its atomicity. Actually, there is no atomicity in CVS and that's the problem. Subversion has atomicity, but will be certainly an overkill for this task as it has many features, which are not needed for base system scripting. I wouldn't consider Subversion just as it is in very early alpha - not good for a critical part of a stable OS. Besides, Subversion or CVS solves versioning but left a quick search in repository unsolved. Also, both are not designed for object persistency, which we would like to have in Python scrypting.
I may try to recommend to consider standalone ZODB: superfast transactional OODB for Python persistency with versioning. ZODB originally was designed to be embeded, so it should work better for OS needs than conventional RDBMS. It's well designed and have: Support for concurrent threads of execution, Well-defined storage interface with integrated transaction support, Two-phase commit, Integrated versions and sub-transactions. ZODB is based on Python and Berkley-db - both are quite stable enough for this task. ZODB is a stable DB product and used in many high traffic Zope-based web-servers. |
|
Back to top |
|
|
gsfgf Veteran
Joined: 08 May 2002 Posts: 1266
|
Posted: Thu May 01, 2003 10:44 pm Post subject: |
|
|
uh, i see no disadvantages, but initscripts sure seem like what bash was intended for. _________________ Aim:gsfgf0 |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9533 Location: beyond the rim
|
Posted: Thu May 01, 2003 11:54 pm Post subject: |
|
|
Of course init-scripts would be cleaner and (hopefully) easier to understand.
but I think the disadvantages are too important:
- init-scripts are a critical part of the system, errors can be fatal
- a huge amount of work for developers
- python would become a critical component for the base system (currently it's important, but not critical, you can run the system without it)
panserg wrote: | How about OOP of Python? Would it be any good to have classes inheriting from more abstract classes common methds and properties of their behaviour? Honestly, each time I see the mess in /etc I want to re-write it to something more structured. |
Why does everone think that OO is the solution(tm) ? If I look at the current initscripts there are not many similarities that are not already put into runscript.sh or functions.sh. And I definitively don't think of init-scripts as objects (BTW, my favourite programming language is Java, closely followed by C).
Quote: | The only problem stops me (besides availability of free time) is that every daemon and utility wants to have own format of config files. So, at first the configuration facility must be created (aka LDAP), then it's API must be published and standardized. Then we should wait when all (most of) tools will be re-written to use such a configuration facility. Then we can re-write /etc (not only /etc/init.d). |
Reminds me of the Windows registry. The idea of a uniform and structured /etc is appealing in theory, but plain text files are just too damn easy to edit. In terms of overview and correctness the current situation is a mess, but to change this a new OS has to be created (as you described above), and then we can use an OO-based filesystem as well, so we don't need config files anymore.
Quote: | Alternatevly, we can see how it's done with famous linuxconf. That configuration tool has own database and own UI to change it. Once you change something then it will generate actual config file and save it /etc. BTW, linuxconf handles initscripts as well. So, if we talk about porting something like linuxconf into Python and Gentoo than I am in support of it and eager to take a part. |
Past tense is more appropriate here. linuxconf was deprecated by Redhat since 7.x and has been completely dropped in 7.3 I think in favor of many little config tools. The problem with tools like linuxconf or Yast are unexpected changes by the user. Either they are overwritten by the tool or the tool has problems changing something in a user-modified file. I have to admit that recent Yast2-versions (I hate it ) seems to do a good job on that. |
|
Back to top |
|
|
dice Guru
Joined: 21 Apr 2002 Posts: 577
|
Posted: Fri May 02, 2003 12:01 am Post subject: |
|
|
K.I.S.S. |
|
Back to top |
|
|
|