LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2005, 12:54 PM   #1
rozz
LQ Newbie
 
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18

Rep: Reputation: 0
Imagining a different Linux


Take for example sendmail. If you want to configure and run a customized sendmail you'll have to learn the sendmail configuration language. Same thing for apache, etc...

These linux services are complex and each has ist own configuration language. And if you need further nonstandard customization, you'll nedd to modify the source code and recompile, which is very time consuming.
How can we fix that?
I was imagining that every "service" (like sendmail, apache, etc) would provide "data structures" and default behaviour.
Here's an example to understand.
Say you install sendmail and kapersky antivirus. Now both run in default configurations. Say you want kapersky antivirus to scan all your incoming mail. Imagin that all you have to do is write this "script":
===============================
Code:
function scan_mail($mail) {
	$scan_result = v1.services.antivirus.kapersky_av.mail_scanner.scan_mail($mail);
	if $scan_result.is_infected {
		$return_text = "
			This mail could not be delivered because it was determined to contain a virus.\n
			These are the viruses found in the email:\n";
		for each $scan_result.found_viruses as $virus{
			$return_text += "Virus name: " + $virus.name + "\n";
			$return_text += "Virus description: " + $virus.description + "\n";
		}
		$return_text +=  "The original mail is provided as attachement\n";
		$return_mail = v1.classes.mail.blank;
		$return_mail.to = $mail.sender;
		$return_mail.subject = "Returned mail";
		$return_mail.text = $return_text;
		$return_mail.attach ($mail.raw_source() );
		v1.services.mail.postfix.send_mail($return_mail);
	}
	else {
		return default;
	}
}

v1.bind(v1.services.mail.postfix.smtp_server.mail_received, scan_mail);
===============================

Now let me explain some stuff: This:
v1.services.mail.postfix.smtp_server.mail_received
Is what I called previously a "data structure". that should be provided by sendmail. The v1 is for "version 1", as they may be diferent versions.
The last line in the "script" binds the event "mail_received" with the preceding function (scan_mail).
The "return default" in the function means "continue processing the mail normally".

Now all we'll have left to do is issue some command that would, err, "enable" our customization.

Now all this is great, but can in become real, without too much work?

My "ideas" might be stupid, but I'll never know if I dont share them.
And thanks for reading to the end.

Last edited by rozz; 02-02-2005 at 06:06 PM.
 
Old 01-19-2005, 09:35 PM   #2
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
I didn't read your code (hint... try the [ code ] [ / code ] without spaces next time), but your idea has some elements of OO programming in it which you may or may not know about. Your basically stating that developers should provide a specific interface in which their applications would communicate over. While it sounds nice in theory it takes lots of detailed planning to occur, and it just may not be realistic for many applications, although I agree that programmers should try harder to strive for "plug 'n play" type interfaces between systems.
 
Old 01-20-2005, 07:44 AM   #3
rozz
LQ Newbie
 
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18

Original Poster
Rep: Reputation: 0
I'm glad you answered my post!
The idea behind this is:
1- To provide a unified configurations laguage for differend services on linux
2- And even more important, to reach levels of flexibility that are impossible with classical configuration files, even config files with thousands of lines. That is I want to enable the regular user to rewrite the application logic.

I am unfortunately not a C/C++ programmer, so I do not know how and if it is reasonably possible to implement this.
Thanks lowpro2k3 for your answer.
 
Old 01-20-2005, 11:47 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Linux has nothing to do with sendmail and apache softwares, Linux relates to kernel only.
Sendmail and Apache are designed to run not only in Linux based system but in Unix too

What you want is some service interfaces customised to suit your tastes, there are interfaces
like webmin, phpmyadmin etc that work well (more at freshmeat.com)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration