Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
I am writing a small program in C++ to help handle day to day maintenance in Gentoo because I don't always like to type the long commands out, and because ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541

    Gentoo Maintenance Program


    I am writing a small program in C++ to help handle day to day maintenance in Gentoo because I don't always like to type the long commands out, and because it is good practice for me.

    For now, this program is only for Gentoo, but as time permits and if I get good feedback, then I will expand this for other distros. That is a while down the road though, and for now it is a crude console menu driven program to do some things that you should already know how to do.

    So, for anyone using gentoo, please download and try it, and let me know what you think. That way I know whether to just scrap the idea or continue working on it. You can consider this alpha software, because I am a beginner and because I am constantly adding new things and changing the menu around.

    If you do want to try it out, I have included a tarball with the program and source code. If you want to make changes and compile it yourself, that is fine, all I ask is that you share your changes back so I can add to the program. It probably isn't the most efficient program, but hey, I am learning.
    Code:
    g++ -o gentoo-maint.bin gentoo_maint.cpp
    This program must be run as root or sudo to be able to perform the tasks. It works fine as a user, but it won't actually change anything as a user.

    *This program should work with any gentoo based distro, but I really don't know enough about them to say for sure. It is just a frontend for some basic portage commands and linux commands*

    *Updated and uploaded on 04/07/2013*

    Screenshots:
    gentoo-maint-01.jpg
    Attached Files Attached Files
    Last edited by gruven; 04-07-2013 at 04:50 PM.

    Linux User #376741
    Code is Poetry

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    It sounds really interesting. I'd love to give this a run around the block Gruven, but my Gentoo box is currently gathering dust in my office. I think the PSU is toast. Might be a few weeks before I get that beast back online.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    Quote Originally Posted by gruven View Post
    I am writing a small program in C++ to help handle day to day maintenance in Gentoo because I don't always like to type the long commands out, and because it is good practice for me.

    ...

    This program must be run as root or sudo to be able to perform the tasks. It works fine as a user, but it won't actually change anything as a user.
    Hi gruven - good luck with the programing ... but run as root ! I do that with gparted but not much else ...
    IMHO this is really script stuff ... but it might be as well to generate a script which gets run by the user after they have had chance to review it

  4. #4
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    Quote Originally Posted by Jonathan183 View Post
    Hi gruven - good luck with the programing ... but run as root ! I do that with gparted but not much else ...
    IMHO this is really script stuff ... but it might be as well to generate a script which gets run by the user after they have had chance to review it
    I am in the process of working with C++ in school and this was just for practice, and mostly for my own use. I included the code so it can be evaluated before ran. Also, I am intending this to be used on more than one configuration, so I made it an actual compiled program, not depending on any outside libraries so that it can be ran no matter the interpreter (or version) installed. You can run this with without bash even installed, so it will be truly portable (only on Gentoo atm, but looking into Arch soon).

    Using Gentoo, you have to run a lot of maintenance stuff as root to keep the system up, and this program just takes those commands and puts them in a menu. Easier for me to just type a number than a whole command.

    Anyway, I plan on updating this with another distro in mind, so you can choose between distros. In my experience, it is extremely hard to do system maintenance without being the root user, so this will still have the stipulation of having to be run by root to be able to make changes. You are welcome to run as a user, but it won't change anything. Maybe when I get time I will implement some of the sudo libraries (maybe, because I don't like external libs for this project), but this is a crude program, and I am just learning with this prog.

    It is really meant for admin maintenance anyway.

    Linux User #376741
    Code is Poetry

  5. #5
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    As programing experience - great, but really I'd aim at minimum rights possible. I compile kernel as a regular user and only run as root to install modules and copy kernel image. Some admin tasks are root only, but not all ... my point ...
    complete all operations with minimum rights possible, it maybe more challenging but it's the best way of working.

    As for reviewing source code before allowing something to execute ... if it was 2 lines of code I could probably work out most logical combinations and convince myself it's OK in just about all instances. I doubt you only have two lines of code, so working out if all logical combinations are OK is much more of a challenge. That's why I suggested an output of a script the user can review before running ... particularly for root stuff.

    it's only my view of things ... it's not meant to be an attack on your approach

  6. #6
    Linux Guru rokytnji's Avatar
    Join Date
    Jul 2008
    Location
    Desert
    Posts
    4,125
    Sounds almost like smxi for Gentoo to me. I run it outside of X as root user for maintenance in AntiX.

    Code:
    $ locate smxi
    /usr/sbin/smxi
    /usr/share/antiX/FAQ/smxi.html
    /usr/share/doc/smxi-inxi-antix
    /usr/share/doc/smxi-inxi-antix/changelog.gz
    /usr/share/doc/smxi-inxi-antix/copyright
    /var/cache/apt/archives/smxi-inxi-antix_0.1.5.1_all.deb
    /var/cache/apt/archives/smxi-inxi-antix_0.1.5_all.deb
    /var/cache/apt/archives/smxi-inxi-antix_0.1.6_all.deb
    /var/cache/apt/archives/smxi-inxi-antix_0.1.7_all.deb
    /var/lib/dpkg/info/smxi-inxi-antix.list
    /var/lib/dpkg/info/smxi-inxi-antix.md5sums
    Key thing for me is a internet connection outside of gui. I guess yours will run inside of Desktop/Window manager though which sounds neato. @Jonathan183, I need to be root for kernel and package installs but I use binary packages so I know you guys build your own which is different.
    Kinda apples vs oranges.

    Good luck with it gruven
    Linux Registered User # 475019
    Lead,Follow, or get the heck out of the way. I Have a Masters in Raising Hell
    Tech Books
    Free Linux Books
    Newbie Guide
    Courses at Home

  7. #7
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    The program is kind of like that, but not really. I plan on expanding it later on when time permits, but for now it is just for making my life easier.

    It runs in a console, xterm, whatever, is completely system independent (except it uses system calls to portage for package management so it is essentially gentoo only for now), and relies on no outside libraries to compile and run.

    Scripts have their place, but most of the time I prefer an actual program simply for portability. Scripts sometime require certain versions of libs, but this program shouldn't. That is my goal.

    I have plans for internet connection setup (even wireless to a certain extent) and possibly a multi distro expansion. That will be down the road though.

    Linux User #376741
    Code is Poetry

  8. #8
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    Wow, I wish I could edit this post with an update. I will just put it on sourceforge I guess.

    Linux User #376741
    Code is Poetry

  9. #9
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Quote Originally Posted by gruven View Post
    Wow, I wish I could edit this post with an update. I will just put it on sourceforge I guess.
    Ask any one on the admin team, it shoulsnt be a problem to change. It's always better yo have an updated thread.

    Sent from my SPH-D710VMUB using Tapatalk 2
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  10. #10
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    I have moved the project to sourceforge, because it is easier to update and they have a git repo to update to.

    I have also named the project Upkeep.
    Upkeep / Wiki / Home

    I wouldn't mind keeping the thread updated here as my development continues, but without being able to edit the main post at will, it really wouldn't work for me at all.

    Linux User #376741
    Code is Poetry

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •