Thursday, April 10, 2014

SELinux and CentOS 6 with Special Guest: BackupPC

I was trying to tighten things back up on the BackupPC after getting it running.  SELinux is a pain - but I like to have it running on all systems.  I had two BackupPC installs - one on a CentOS 5 server and one a CentOS 6 server.  You would think the latter would be the easiest - but not so!  

For the most part, I just used this blog article BackupPC on CentOS 5 (selinux fix) but I had a few issues between the two servers so I'm documenting that.


CentOS 5 didn't have the semodule command.  So...

# yum install selinux*

And then create a source policy module...

# grep httpd /var/log/audit/audit.log | audit2allow -m backuppc > backuppc.te

And then build the policy module...

# grep httpd /var/log/audit/audit.log | audit2allow -M backuppc

And finally, install the module...

# semodule -i backuppc.pp

After that, I turned on SELinux=enforcing at the command line and edited the /etc/selinux/conf to default to enforcing.

# setenforce 1
# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        targeted

CentOS 6

CentOS 6 also needed to have all of the SELinux tools installed (I think).  However, when I tried the exact same things as above, the semodule command gave an error:

     Tried to link in a non-MLS module with an MLS base

After some searching I found that I needed to run system-config-selinux which is a GUI (no system-config-selinux-tui I could find).

# system-config-selinux

Here, I was expecting to see MLS instead of targeted.  Not sure why, but it was already toggled to the correct setting.  (So why does it think it's MLS?)  So, I checked the box to "Relabel on next reboot" and rebooted.  I was a little afraid of this because it said it could take a long time if you had a large filesystem and this had already used about 23% of 3TB.  It was probably done well under 20 minutes (by the time I tried it again) and it worked!


Tuesday, February 11, 2014

iSCSI LVM Red Hat/CEntOS/Oracle Linux

Today I learned a couple of important things about LVMs on iSCSI.  First, a silly one - pvcreate against a slice (or partition - sorry, my Sun Solaris is showing) - NOT against a disk.  That is, /dev/sda1 NOT /dev/sda.  I coulda swore you could use the disk and LVM would take care of the details.  Again, probably thinking of ZFS and Sun Solaris.

The other really important things is you MUST use _netdev in place of defaults in the /etc/fstab.  For example:

   /dev/mapper/vg_oracle-lv_u01 /u01 ext4 _netdev  0 0

This is a serious gotcha!  If you don't do this, the device disappears from /dev/mapper.  Pretty unnerving!  

The other cool thing I picked up was, if you lose the /dev/mapper device, you can get it back (assuming you tinkered with iscsi restarts a bit) simply by issuing the command "vgchange -ay".  That was a neat trick and prompted this blog post.

That is all.

Friday, April 26, 2013

Slackware 14 under Xen

I have tried (halfway) to get Slackware to run under Xen (which I run on 32 bit CentOS 5.x).  It never seems to have a working network.  This time, I took a (very) little amount of time to fix this.  Googling resulting only in running Xen on Slackware.  I couldn't find anything on this problem.  I love to load each new distro that comes out but I really enjoy just using Slackware (SLS was my first distro).  So, when Slackware would repeatedly come up without a network interface, I was disappointed and a bit surprised.  If you're having this issue - here one possible fix:   Use a virtual Ethernet and do NOT use the default hypervisor network interface.  Instead, use "ne2k_pci".  I intend to try to get the shared physical interface to work with a real outside address and even test the other options under the virtual Ethernet.  But, this solved my problem.  If anyone else tries these, I'd love the hear the results.

Sunday, December 4, 2011

Powershell, pretty cool afterall

I am really enjoying Powershell.  The ISE is much more useful than I thought and flipping from the shell to notepad is really slick (although I still had to install gVim).  The cmdlets are slicker than I originally gave them credit for.  The default is to list all of the parameters/attributes of the cmdlet I've been experimenting and you can almost always leave them off when there's just one or two parameters.  e.g.

PS > Get-History | Foreach-Object { $_.CommandLine } > c:\temp\
For the exact same results - try the much easier to remember...

PS > get-history > history.txt 
The above works just like you would expect.

I found quite a few other examples that were obviously simplified.  It's a pretty interesting scripting language.  By adding the .Net accessibility, it is as if you have blended Bash and Ruby and some special Windows references thrown in to boot.  I like it.  It looks to be very powerful and handy.  One of the main reasons I didn't like administering Windows is the lack of good sysadmin scripting tools and a poor command line shell.  Powershell fixes that.  Much is familiar too since it uses many Bash commands.

So, I've spent the day patching and armoring my Windows 7 running under OpenBox.  I really like Windows 7 (which is probably why they are coming out with a Windows 8 so soon.)  

With the vastly improved Windows 7, Windows 2008 R2 and Powershell - all in 64 bit - looks like it's going to be a less painful transition that I had thought.  I'm actually really looking forward to it now.

Saturday, August 27, 2011

Honey Harvest

Finally had time to harvest honey.  A bit disappointing.  Milano never did completely fill all 8 medium frames.  I took only 4 fully capped (front and back) frames from that colony.  The 5th was only fully capped on one side.  I decided not to spin it.  I thought once that Milano's activity had drastically dropped off.  I wonder if I lost some productivity to a swarm?

I had added a 2nd hive body to Venice - a deep.  I took one beautiful full frame of capped honey from Venice.  I was going to take a second but they have a begun putting brood in the two next closest full frames.  I was surprised how heavy a deep frame full of honey was.  I was also pleasantly surprised that my little extractor DID accommodate a deep frame - although two would've been nice for the balance.

No more mason jars!  They are too messy.  I bought these 3lbs jugs.  This years harvest - 16 lbs.  It tastes EXACTLY like previous years (unique and completely different from store bought).  We have Persimmon trees, scores of acres of Tulip Populars, a nearby peach orchard, tons of blackberries and, thanks to the dairy down the road,  40 acres of alfalfa (which they tell me they cut 5 times right after it blooms).  It seems thicker than previous years too.  Good stuff!  Should last a while and I'm pretty sure I left them plenty.

I didn't take any from my new split: Sicily.  That colony has completely packed a medium 10 frame.  I have been meaning to add another hive body - now I wonder if that would be a good idea.  I really hope they'll winter.  I am considering adding a lower medium and feeding them all really well before winter.  I'd be bummed if my first split didn't over-winter.  It's come a long way and overcome my mistakes.

Sunday, July 24, 2011

More bee blogging

As there seems to be a dearth of nectar at the moment, I decided to feed the colonies.  The 1st year colony I call Venice looks like it slowed down a bit. right after I added the 2nd super.  I admit, I am a bit worried Milano will get into that capped honey in the super I am taking.  Conflict: If they take it -  it means they need it and I probably shouldn't take it....  I figure I'll take it and feed the rest of the season.

My pride and joy - the colony I call Sicily - is doing well despite my many mistakes.  I moved two frames of brood with queen cells into a new hive.  It was VERY, VERY slow going.  With only nurse bees and no foragers as well as un-emerged queens, it took a long time for this to get going - but it's going fine now.  I fed them pollen patties and sugar water.  Being weak as long as it was created my first ever look at hive beetles.  Yuck!  I dispatched a few and cleaned out my top feeder and fed them  They are now 5 full frames plus two other half frames - and, finally, show a defense when I inspect (I used to be able to inspect them without any gear).  If they winter, I am going to try to get them in place to harvest the peach orchard nectar and fill a Ross Rounds super.  Specialty comb honey!  Can't wait.

Monday, July 4, 2011

I need a bee blog

This was a catch-all blog but lately it seems like it's jut s a bee blog.  I'm excited to report my first ever split finally seems to be showing progress.  They are too weak to defend  against Milano or Venice so I haven't been feeding (I don't want Milano storing sugar with the honey since I will harvest from there soon - they are filling out the last 3 top super frames.  The first five are already full and capped).  Good thing I checked on [what did I name this hive?] - they are out of food.  They are drawing comb and the population is way up!  It looks like a new package install after about a week now.  They have brood and at least four full frames of packed workers (I only moved over two!).  Lots of pollen bearing workers are entering and there's good traffic flow.  Wow!  I really didn't expect this to make it.  I will feed them the rest to the summer to see if I can get them to a density to winter.

My new vented, gabled copper roof came for Venice.  So now I have a bottom board and a top.  All I need is a hive body and a top cover and I have a hive ready for the next split.  I think I'll order that, some more medium supers (standardizing on mediums now), two or three hive stands and another slated bottom for [what did I name that new hive?] - they will need all the help they can get.