tag:blogger.com,1999:blog-48842322261118096832017-09-22T16:03:36.454-07:00The Trials of a Linux GeekThe Daily Stuff That Happens to a Lone UNIX Admin/Developer.Gary Greenenoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-4884232226111809683.post-52434149213201503472011-07-14T21:38:00.000-07:002011-07-14T22:58:58.975-07:00Vixie Cron How I Loath Thee.....As some know, I work as the senior systems administrator for a company in the southeast SF Bay Area. Recently, we had to move to a new security system, after having been broken into four times in the last _four_ years.<br /><br />One of the features of this new system is that it ties into our phone system to alert the building that the alarm is about to be armed. To do this, a dial out to a special phone number needs to occur at the desired hour and then voila! Instant Alert throughout our suite! So, we've setup an email to fax service that we can easily trigger by a simple email.<br /><br />So I wrote a REALLY simple shell script shown below (with the fax and email addresses elided):<br /><br /><pre><br />#!/bin/bash<br /><br />set -e<br /><br />echo "Sending Security Page NOW!"<br /><br />/usr/sbin/sendmail -t &lt;&lt;EOF<br />FROM: SOMERANDOMSMUCK@minervanetworks.com<br />TO: 1234567890@fax.com<br />CC: SOMERANDOMSMUCK@minervanetworks.com<br />SUBJECT: Alarm Set<br /><br />Set.<br /><br />EOF<br /><br />RET=$?<br />if [ $? -eq 0 ]; then<br /> echo "SUCCESS"<br />fi<br /><br /></pre><br /><br />As I said, simple.<br /><br />From there I setup my crontab on one of the Linux box in my cube to have it go off at the apropriote time, 7:55PM Monday through Friday:<br /><br /><pre><br />MAILTO=SOMERANDOMSMUCK@minervanetworks.com<br /><br />50 19 * * 1-5 /usr/bin/securityfax.sh<br /></pre><br /><br />Tested out the script, thinking that "Hey, I'm all done". <b>Wrong.</b><br /><br />I come to find out that Vixie Cron <i>can't seem to tell time!</i> I get the alert emails at 8:31PM from the system!<br /><br />At this point, looks like I'll be replacing Vixie Cron on my workstation (CentOS 5). Can anyone advise a good Cron Daemon replacement that has enough similarities to vixie cron that I won't have to relearn <i>too</i> much and can actually interpret time settings in the crontab as more than mere suggestions?Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com10tag:blogger.com,1999:blog-4884232226111809683.post-33727897986219903482011-02-11T20:53:00.000-08:002011-02-11T21:23:13.115-08:00Qt, Nokia, and the Internet Rambling.....So, most of you who read my blog know about Nokia's deal with Microsoft. To re-iterate the best image posting I've seen on planetkde via John Layt's blog: Keep Calm and Carry On.<br /><br />Yes, Microsoft has been a major negative force on computing, especially with regards to the freedoms of end users. This however does not warrant the extreme and in many ways self-defeating knee-jerk reactions that have been permeating the Interwebs oft lately on the F/OSS blogs.<br /><br />Lets rather, take a wait and see approach to this. There really isn't enough information on the ground at this point in the game to know what is or is not going to occur in the immediate or even long-term for Qt Development Frameworks at Nokia. Lets trust in our friends at Nokia to gather up the information that the community is craving to know and get it ready for public consumption.<br /><br />Until then, Nothing to See Here, Move Along.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com9tag:blogger.com,1999:blog-4884232226111809683.post-39952543856675483022009-10-13T00:29:00.000-07:002009-10-13T00:41:15.068-07:00What I've Been Doing Lately... Or Better Said, Coding Lately.Lately I've been doing research to get an Exchange resource working and usable for KDE. During this time, I've had to have a working trunk build since OpenSuSE's Build Service tends to have custom patches for their build of KDE that make some things not behave or look how the default KDE trunk tree acts/looks (that's not a comment that that's bad, just not my want for when I do development, but I digress...)<br /><br />To facilitate this, I'd been using the shell scripts that KDE has on Techbase and on the OpenSuSE wiki to build trunk. I've found however, that my time would be better spent working on code, instead of waiting on code to compile when at home. Since I wanted something that would even fully track Qt's Git tree and email me when builds ran or error-ed out, kdesvn-build was not going to meet my needs. What came out of it was a hacky little Perl script called KDEBuilder that was fairly fragile and frankly not designed at all.<br /><br />While thinking over the mess that was KDEBuilder, I realized that what I *really* wanted was something that was flexible, feature rich, and wasn't an overblown ported shell script on steroids. Out of this came the design for Direktor, a continuous build system written in a clean Perl code style (heavily influenced by the Google Perl Style guide....) To better describe Direktor, I've pasted the ReadMe.txt from the source tree below:<br /><br /><hr><br /><span style="font-weight:bold;">DOCUMENTATION FOR DIRECTOR:</span><br /><br />Direktor is a continuous build system primarily meant for use by the KDE open source project. The goal was to create a system that built KDE and it's various dependencies efficiently and allowed the user to be notified and to monitor the progress of the builds.<br /><br />To achieve these goals, Direktor can be configured to e-mail out the build announcements and build failures. This is augmented by the HTML data that is generated to create a dashboard for the build.<br /><br /><span style="font-weight:bold;">DESIGN:</span><br />Originally, Direktor was only a simple Perl script that would naively build KDE trunk and announce simple e-mailed snippets to an email address. This became fairly ungainly as time went on with the need to add in Qt4 to the build. This is when it became obvious that the build methods needed to be more abstracted away to allow any software (including KDE's base dependencies if so desired) to be built with this system.<br /><br />To facilitate this, Direktor was re-factored to use description files to detail various aspects about the build and source control system per module or project. These description files are nothing more than INI files with required entries to make the system work.<br /><br />A typical description file follows:<br /><br /><span style="font-style:italic;">fig. 1: qt4.direktor</span><br /><hr><br /><code><br /># Direktor 1.0<br />name = qt<br />repository_type = git<br />in_source_build = TRUE<br />source_repository = git://gitorious.org/+kde-developers/qt/kde-qt.git<br />source_directory = \$HOME/sources/qt-kde<br />prefix = \$HOME/installs/qt-kde<br />configuration_flags = -qt-gif -debug -fast -no-separate-debug-info -system-libpng -system-libjpeg -system-zlib -dbus -webkit -plugin-sql-mysql -nomake examples -nomake demos -prefix \$QTDIR<br />environment = QTDIR=$HOME/installs/qt-kde \<br /> PATH=$QTDIR/bin:$PATH \<br /> QT_PLUGIN_PATH=$HOME/installs/trunk/lib/KDE4/plugins:$QTDIR/plugins \<br /> PKG_CONFIG_DIR=$QTDIR/lib/pkgconfig:$PKG_CONFIG_DIR \<br /> LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH \<br /> QTEST_COLORED=1<br />configuration_command = configure<br />build_command = make<br />build_flags = -j2<br />install_command = make install<br /></code><br /><hr><br /><br />As can be seen, this allows the system to be very versatile with builds allowing one to build any package. The configuration_command, build_command, and install_command options allow can be any conceivable valid Linux command, even<br />scripts.<br /><br />The fields in a direktor file are required. Lets review the fields and their format:<br /><br /><b># Direktor 1.0</b><br />This is the description and format version of a description file as used by this application.<br /><br /><b>name:</b><br />This is an arbitrary string value. It is mainly used to present information about the module to the user.<br /><br /><b>repository_type:</b><br />This is a string value that takes one of the following values: svn, git, file, cvs, or p4. This tells Direktor which type of repository the module lives in. The file option tells Direktor that the source is not in a revision control system, but rather is a release tar.bz2, tar.gz, tgz, or zip archive.<br /><br /><b>in_source_build:</b><br />This attribute takes either a TRUE or FALSE. This boolean value tells Direktor to build the binaries from within or outside the source directory. Increasingly, many of the open source applications are built outside the source directory.<br /><br /><b>source_repository:</b><br />This is the location of the source repository or the full path location of the archive that contains the sources of the project to build.<br /><br /><b>source_directory:</b><br />This is the location where the unpacked or checked out files will be placed on the local hard disk.<br /><br /><b>prefix:</b><br />This is the prefix where the resultant binaries will be installed to.<br /><br /><b>configuration_flags:</b><br />These are the flags to pass to the script or application called to configure the source tree for compilation.<br /><br /><b>environment:</b><br />This describes the environment variables and values that must be set to allow the build of the source code to complete correctly. These are placed one per line with the continuation character being the forward slash.<br /><br /><b>configuration_command:</b><br />This tells Direktor what command or script to run in the source directory to configure the source code for compilation.<br /><br /><b>build_command:</b><br />This tells Direktor what command or script to run from the build directory to compile the source code into binary object and executable code.<br /><br /><b>build_flags:</b><br />This instructs Direktor to use the requested flags with the command to build the source tree. In many cases, this is to instruct the compiler to use non-standard library or header locations, or to do the build in parallel allowing the job to complete faster.<br /><br /><b>install_command:</b><br />This instructs Direktor what command or script to run from the build directory to install the resultant binaries produced in to the prefix earlier specified.<br /><br />Note that any time an environment variable is requested that has a dollar sign in it must be escaped to properly be interpolated by the shell that is invoked by Direktor.<br /><br /><span style="font-weight:bold;">REGISTERING MODULES:</span><br />To register the modules, simply add the module direktor file names without the .direktor extension to the .direktor.modules_registry located in the build user's home directory. The header line declares the major series of Direktor that can read this format. An example .direktor.modules_registry follows:<br /><br /><span style="font-style:italic;">fig. 2: .direktor.modules_registry:</span><br /><hr><br /><code><br /># Direktor 1.0<br />qt4<br />kdesupport<br />kdelibs<br />kdepimlibs<br />kdebase<br />kdepim<br />kdemultimedia<br /></code><br /><hr><br /><br />WORK FLOW:<br />When Direktor starts, it clears the current environment and then sets up the global parameters defined in it's configuration stored in the home directory of the user running the build. This file is called $HOME/.direktor.cfg, and is in an extended INI format.<br /><br /><span style="font-style:italic;">fig. 3: .direktor.cfg</span><br /><hr><br /><code><br /># Direktor 1.0<br />[GENERAL]<br />user = somebody<br />group = users<br />registry = $HOME/.direktor.modules_registry<br />announce_start_via_email = 1<br />announce_builds_via_email = 1<br />announce_errors_via_email = 1<br />announce_completion_via_email = 1<br />use_dashboard = 1<br />; these next two are mutually exclusive!<br />use_watcher_to_dispatch_builds = 0<br />use_scheduler_to_dispatch_builds = 1<br />; needed for any non-generic initial repo setup that you will need. Remember,<br />; this gets run if the lock file $HOME/.direktor.firstrun does not exist.<br />first_time_startup_script = firsttimesetup.sh<br /><br />[EMAIL]<br />from_address = someone@somewhere.net<br />to_address = somelist@somewhere.net<br />cc_addresses = bob@somewhere.net,bugs@somewhere.net<br />subject_prefix = MY BUILDER<br /><br />[DASHBOARD]<br />html_upload_path = somehost.somewhere.net:/home/builder/public_html/<br />upload_user = someone<br />upload_cioher = arcfour<br /><br />[WATCHER]<br />email_inbox = scm-monitor@somewhere.net<br />action_to_take = queue_all<br /><br />[SCHEDULER]<br />queue_file = \$HOME/.direktor.schedulerrc<br />action_to_take = fullbuild<br /></code><br /><hr><br /><br />Once the global configuration is loaded, Direktor checks whether it was started in interactive or daemon mode. Once the execution mode is determined and acted on, Direktor scans the modules_registry to see which modules it needs to retrieve and build.<br /><br />After it knows which targets to build, it loads the .direktor file for the given target in. Then it announces the start of the first target to the pre-defined E-Mail address and acts on the required options accordingly by setting up the additional environment needed for the compilation of the sources in this target, checking out or downloading the sources to the local disk and unpacking it if needs be to the source directory, configuring the sources, running the build command for the source target, and then installing it into a predefined prefix. Along the way, if any of the steps fail, an E-Mail announcement is sent out to notify the user building the code that the build has failed.<br /><br />While this is all going on, Direktor will generate HTML pages to display the current status of the builds, including whether a build is running, the target's build completion status (success or failure), and when the build is done, what warnings were output during the compilation.<br /><br />If the compile fails, the compilation log is displayed back to the last successful portion of the configuration, build, or installation.<br /><br /><span style="font-weight:bold;">CONTINUOUS BUILDS:</span><br />The most significant feature of Direktor is it's ability to run automatic and prescheduled builds with user specified actions. The two modes of this allow it to be used for continuous build assurance allowing projects to assure that all commits to a branch that is monitored to always build.<br /><br />The first method, using the watcher system, requires that a post-commit action be set on your source control system to notify Direktor when a check-in has occurred which is delivered to a selected address configured for retrieval by a fetchmail-alike and then processed by procmail, or similar application. During the processing by procmail, the message is piped to our watcher script which then asks the scheduler to start a build as soon as the current server is idle and sends an email notification to a selected e-mail address that a commit to one of the modules has caused a new build to be queued. This very literally will on very active repositories cause the build to always be queued, so be sure that is truly the desired outcome.<br /><br />The second method kicks off builds at predetermined clock times. The schedule is re-read every 15 minutes to add newly desired times that may have been added to the specified configuration file. Note that no two builds can run at the same time, so be sure that the schedule is long enough to accommodate the completion of all builds.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com3tag:blogger.com,1999:blog-4884232226111809683.post-28833286765274274152009-10-02T19:00:00.000-07:002009-10-02T19:28:01.188-07:00Sprint-A-Thon!What has two homes on either side of the planet, attracts geeks by the storm, and the letter Q?<br /><br />No, not a rabid Qbert collector, rather Qt Dev Days!<br /><br />This year, to start things out right we've managed to acquire through the clandestine (ok, maybe not so much....) work of the Nokia Qt Development Frameworks division (formerly known as Trolltech) F/OSS Community Manager, Knut Yrvin, a small stash of passes for KDE developers to the event. We thought what better way to draw in interested KDE developers than to hold a pre-Qt Dev Days Sprint?!<br /><br />What will the sprint cover, you might ask? Well, we're interested in hearing (hopefully sooner than later) what YOU, the KDE hacker wants to work on/brainstorm on at this sprint! To better get an idea of whom will or will not be coming, please stop by our Facebook event page and RSVP. If you choose not to use FB to let us know, feel free to leave a blurb on my blog. Thanks :D<br /><br /><span style="font-weight:bold;">UPDATE:</span> Hmmm, it would seem I for got to post the LINK to said FB event..... Here you go: <a href="http://www.facebook.com/home.php?ref=logo#/event.php?eid=293775555108&ref=nf">Facebook Dev Days Sprint</a>.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com0tag:blogger.com,1999:blog-4884232226111809683.post-55812855127649960612009-08-21T23:58:00.000-07:002009-08-22T00:01:53.002-07:00Update....Thanks to Brad Hards' quick intervention, I have a tarball of a recent SVN snapshot for OpenChange. I'll build the code and start working on reviewing the API tomorrow.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com1tag:blogger.com,1999:blog-4884232226111809683.post-83845164733206716652009-08-21T23:25:00.000-07:002009-08-21T23:30:12.034-07:00Stuck....This is a special request:<br /><br />The last couple days, the OpenChange project's website has fallen off the 'Net. As one of the steps in getting my development environment up is installing libmapi++ (which no distribution seems to have packaged at all), I'm stuck. If anyone knows the folks maintaining the OpenChange project's website, please find out what is going on. Also, if anyone has a current check-out of the libmapi++ tree, please let me know so I can get it from you. Thanks.<br /><br />You may now return to your regular blogging enjoyment.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com5tag:blogger.com,1999:blog-4884232226111809683.post-71019376122644662132009-08-20T00:46:00.000-07:002009-08-20T00:53:34.905-07:00Trudging Through Another Build....After spending an evening getting my development environment updated to trunk, I think I've come to a few conclusions: 1) I need to learn more about CMake, 2) learn how to deal with missing headers better (thank you ervin) 3. don't resort to sledgehammer methodology as quickly to fix a problem, 4) work on my my patience level more.<br /><br />After committing the fix from being the guinea pig for the fix, I'm onto building kdepim, and then I'll start working on getting the code fixed for the openchange resource so it compiles.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com1tag:blogger.com,1999:blog-4884232226111809683.post-36650060712767769932009-08-18T10:44:00.000-07:002009-08-18T10:48:21.684-07:00Answering Questions.Just so those that are curious know, I'll repost my response to the over a dozen comments to my posting last night......<br /><br /><i><br />Just a small fyi for those that have been commenting:<br /><br />Yes, my aim is for 100% parity with Outlook's capabilities with MAPI. This means that Mail, Contacts, Calendar, Notes, Journal, Public Folders, Tasks, and Projects are on my TODO list.<br /><br />Whether this will use openchange for all of that functionality has yet to be decided based off of testig and feature completion.<br /><br />Also, I think I should make it clear: the code I'll be working on was started in development around 2007 by Brad Hards and continued by Alan Alvares for his 2008 GSoC project. This WILL be an akonadi resource that talks Extended MAPI/RPC to the Exchange server and DBUS back to the Akonadi session daemon. Where necessary, I might call things in the various libraries from the Samba4 project to mimic an Active Directory backed Exchange client to make my work easier, we'll see if I have to do that or if I can rely on some things from LDAP..... Onwards and Upwards :)<br /></i><br /><br />With this, I need to stress that it won't be instant progress on this, so please all, be patient :)Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com2tag:blogger.com,1999:blog-4884232226111809683.post-76927201103210474172009-08-17T20:59:00.001-07:002009-08-17T21:06:43.648-07:00Hello planetkde!This is my first posting on the planet (I hope... the aggregator doesn't seem to be showing my feed.... Here goes crossing fingers....)<br /><br />Some people in the community may know me as the guy that likes Perl, Qt, KDE, and does a hell of a lot of IT administration at a very un-KDE job. I've helped out at a few F/OSS related events around the San Francisco Bay Area, including hosting lodging for three of the people that helped at the O'Reilly OSCON event earlier this month.<br /><br />A large portion of the stuff you'll read about from my feed will be related to my (mis) adventures with getting KDE integrated with Exchange 2003 and later. I'll get into that a little more in the next post.Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com0tag:blogger.com,1999:blog-4884232226111809683.post-13271531930634087482009-08-17T20:36:00.000-07:002009-08-17T20:46:25.063-07:00KDE, PIM, and MAPIEnough acronyms for you? I thought so.... For those that might not have heard, I'll be taking on the challenge of getting KDE PIM fully Exchange capable. This comes from my desire to kill Outlook and Entourage from my life and not force me to use a tool not integrated very well into my desktop of choice (Evolution).<br /><br />So what is MAPI, you might ask? Well, MAPI stands for Messaging Application Programming Interface, which is the tier one option if you want a mail client to talk to Microsoft's Exchange server. This interface has gone through a number of changes over the years and thus far has been an elusive target for F/OSS projects. Lately a project called Openchange has been working on a library that much of my work on kdepim will be focused around integrating into KDE. This library covers all of the mess of having to write our own library to get access to these servers. As some know, this library is already used in a native MAPI method in Evolution that was released recently in the routine releases of GNOME. I'll just leverage that work and make KDE just as accessible to Enterprise users stuck in an MS powered shop.<br /><br />I'll try to cover all the things I do to make this a reality, so stay tuned, Fun stuff ahead :)Gary Greenehttps://plus.google.com/112018728789370905472noreply@blogger.com21