joehakimrahme / agros Goto Github PK
View Code? Open in Web Editor NEWAgros is an implementation in C of the limited shell (lshell)
Agros is an implementation in C of the limited shell (lshell)
AGROS should be able to send signals to running jobs, as well as to catch signals itself (it should not exit on ^C!).
Problem is, I still don't know how to do it. I'll focus on parsing the conf file first.
help: displaying config according to arguments
setenv/getenv (instead of plain env).
I changed "help" into "hep" and it appeared in the tab-completion suggestions.
Why does Readline treat "help" differently? Are there any special functions for help, we could take advantage of?
[AGROS]rahmu:/home/rahmu/code/AGROS$
? cd env exit hep
If not and it's just a bug, we should correct that. In any case, we cannot have one missing builtin in the list
Q1. Is Agros' intended to be a "real" terminal shell (i.e. like csh, ksh, bash, zsh, etc...) or is it meant to be a program run within another classic shell (i.e. you launch a terminal running bash for example, then you run Agros)?
Q2. I've noticed you can exit Agros using C-c => bash still has control over processes running in the terminal. Isn't that a bit dangerous for an lshell? I guess the answer on how to solve this is largely dependent on Q1.
Q3. Does Agros have a plan? Do some features have priority over others? If so, which?
Q4. What are the real advantages of a limited shell? Can't we do the same thing using sudo, for example?
Finally, a minor low-priority technical issue: I tried running Agros from another laptop at home. It wouldn't compile (this deserves a separate post with more details on the error, but I won't burden you with that for now)
This time, try to get rid of redundant checks.
And redundant lines of code.
SMAGS is an attempt at getting rid of GLib as a parsing library.
I have decided to use iniparser instead.
Auto completion is only on allowed commands, and in path names.
Restricting auto completion on paths.
I'm sure Readline can do that. The ultimate goal being implementing a config_t->forbidden_directories
Does readline has a conf file? Do we keep it separate from "agros.conf"?
Can some filtering (allowed/forbidden) can be done inside readline?
[AGROS]rahmu:/home/rahmu/Projects/Agros$ cd ..
[AGROS]rahmu:/home/rahmu/Projects$ cd Agros/
[AGROS]rahmu:/home/rahmu/Projects/Agros$ cd ionSegmentation fault
I could try disabling auto-completion for a while.
Turn the following code into a function that launches different functions simultaneously.
#include <stdio.h> #include <stdlib.h> int main (int argc, char** argv){ int pid=0; int fork_number=NUMBER while (pid == 0 && number > 0){ pid = fork(); number--; } while (1); /* Every process is entering that loop. */ return EXIT_SUCCESS; }
I don't like the way the log system is managed.
Although it relies on syslog(3) and I do wish it remains that way, I wish we could give the user a better flexibility in taking advantage of the syslog system.
One of the things to think about. It should be easy and ergonomic, yet powerful and complete.
# Use ";" as separator, no spaces allowed
# Use the '\' character to escape ';'
Keep it updated with smags
Issues:
Recommendations:
Otherwise, it works! Pretty cool for a project in its infancy
In order to prepare for user-based configurations, it would be better to review the whole parse_config process. The header should be something like this:
config_t parse_config (char* user, char* group);
Where config_t is a C structure containing all the info we need. The header could vary (maybe it will return a pointer. Maybe we don't need to give the group as an argument, since it is a little redundant).
Welcome to AGROS!
[AGROS]rahmu:/home/rahmu/code/AGROS$ ls &
[AGROS]rahmu:/home/rahmu/code/AGROS$ ls: cannot access : No such file or directory[AGROS]rahmu:/home/rahmu/code/AGROS$
[AGROS]rahmu:/home/rahmu/code/AGROS$
[AGROS]rahmu:/home/rahmu/code/AGROS$
[AGROS]rahmu:/home/rahmu/code/AGROS$ ls
[AGROS]rahmu:/home/rahmu/code/AGROS$ agros agros.conf docs include lib Makefile README src[AGROS]rahmu:/home/rahmu/code/AGROS$
I would like to create a logging system for AGROS, relying on standard Syslog utility. First attempts have shown positive results. Some issues still need taking care of thoug.
The idea would be to have three levels of logging, defined in the conf file:
0- No logging whatsoever
1- Only logs attempts at forbidden commands.
2- Logs every command that did not return success
3- Logs everything.
It is not necessary to have them in order to publish first version. But if AGROS ever wants to be taken seriously, it needs good job control.
Some issues:
To be used as a login shell, you'd need a way to parse your env variables.
The title says it all.
Do I want every user to have access to setenv/getenv?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.