Nuffnang

Monday, April 8, 2013

How to write Redhat cloned distro initialization scripts with Upstart


On Linux systems, initialization (init) scripts manage the state of system services during system startup and shutdown. When the system goes through its runlevels, the System V init system starts and stops services as configured. While this tried-and-true technology has been around since the dawn of Unix, you can now create modern and efficient CentOS 6 init scripts by using Upstart, an event-based replacement for System V init.
Until its latest release, CentOS used the System V init system by default. SysV init scripts are simple and reliable, and guarantee a certain order of starting and stopping.
Starting with version 6, however, CentOS has turned to a new and better init system – Upstart. Upstart is faster than System V init because it starts services simultaneously rather than one by one in a certain order. Upstart is also more flexible and robust, because it is event-based. Upstart generates events at various times, including while going through the system runlevels, similar to the SysV init system. However, Upstart may also generate custom events. For example, with Upstart you can generate an event that requires certain services to be started, regardless of the runlevel. And Upstart not only generates events, it also handles them – so, for example, when it acknowledges the event for starting a service it will do so. This event-based behavior is robust and fast.
Upstart supports SysV init scripts for compatibility reasons; most service init scripts in CentOS 6 continue to be SysV-based. You might someday have to create an init script yourself if you write custom software. If you do, you should write your new init scripts with Upstart in mind so you can benefit from the new init system's faster performance and additional features.

Beginning the Upstart init script

Upstart keeps init scripts in the /etc/init/ directory. A script's name should correspond to the name of the service or job it controls, with a .conf extension. The init script for the Tomcat service, for example, should be named /etc/init/tomcat.conf.
Like SysV init scripts, Upstart init scripts are regular Bash scripts, but extended with some Upstart-specific directives, which are called stanzas in Upstart. In SysV init scripts you commonly see the line . /etc/init.d/functions, which provides access to additional necessary SysV functions. Upstart scripts are more sophisticated and complete; you don't have to include any additional functions or libraries.
Just as in any Bash script, comments in Upstart scripts start with #. Put descriptive comments at the beginning of each script to explain its purpose, and in other places where the code may need explanation. You can use two special stanzas, author and description, for documentation.

Defining when a service starts

Thursday, April 4, 2013

OpenStack 'Grizzly' 2013.1 release.

Roughly six months after the launch of its “Folsom” release last fall, OpenStack on Thursday unveiled version 2013.1 “Grizzly,” the seventh and latest release of the open source software for building public, private and hybrid clouds.
openstack cloud software
More than 500 contributors made 7,620 updates in the OpenStack "Grizzly" release.
More than 500 contributors made 7,620 updates in this new release, which, “more than any before it, was driven by users who have been running OpenStack in production for the past year (or more) and have asked for broader support for the compute, storage and networking technologies they trust and even greater scale and ease of operations,” explained Mark Collier, chief operating officer at the OpenStack Foundation, in a blog post announcing the new software. Best Buy, Bloomberg, NSA, Cisco WebEx, Comcast, CERN, HP, NeCTAR, PayPal, Rackspace and Samsung are among the companies using OpenStack in production.
Developers who contributed to this release came from more than 45 companies, including Red Hat, Rackspace, IBM, HP, Nebula, Intel, eNovance, Canonical, VMware, Cloudscaling, DreamHost and SINA.

'Support for Security Groups'

Seven integrated projects make up OpenStack, each with source code now publicly available: Compute ("Nova"), Object Storage ("Swift"), Image Service ("Glance"), Networking ("Quantum"), Block Storage ("Cinder"), Identity ("Keystone") and Dashboard ("Horizon").      
More than 200 new features are included in this Grizzly release, and some 1,900 bugs were fixed. In anticipation of the launch, Linux.com spoke earlier this week with Thierry Carrez, release manager for the project, to hear about some of the highlights.
“Personally, my favorite key features for this release would be in OpenStack Compute (Nova): introduction of the 'Cells' deployment model for massive scale, and isolation of the compute nodes from the rest of the system for better security ('no-db-compute'),” Carrez began. “I also like how OpenStack Networking introduced support for security groups, as well as a load-balancing-as-a-service feature.”
Meanwhile, “I would also mention how OpenStack Block Storage (Cinder) managed to add a large number of storage drivers from all of the storage industry,” he told Linux.com. Ten new drivers were added, in fact, including Ceph/RBD, Coraid, EMC, Hewlett-Packard, Huawei, IBM, NetApp, Red Hat/Gluster, SolidFire and Zadara.
Finally, “the general drive towards more reuse of code across the various OpenStack projects (through the introduction of the common 'Oslo' libraries) is also worth mentioning,” Carrez said.

Cross-Origin Resource Sharing 

Other highlights of the new release include significant improvements in virtualization management on the Compute side, with full support for ESX, KVM, XEN and Hyper-V. Quotas were added to the Object Storage system, meanwhile, as was cross-origin resource sharing (CORS), enabling browsers to “talk directly to back-end storage environments,” Collier noted.
For Networking, Grizzly aims to achieve greater scale and higher availability by distributing L3/L4 and dynamic host configuration protocol (DHCP) services across multiple servers. New plug-ins were also added from Big Switch, Hyper-V, PlumGrid, Brocade and Midonet.
The Grizzly Dashboard, meanwhile, is backwards-compatible with the Folsom release.