LIFEBOOK4Life Ultra Test Flight adventure starts

Fujitsu’s LIFEBOOK4Life is here again with “Ultra Test Flight” and new challenges for Insiders. This year it’s about Ultrabooks and the Autumn will be full of interesting tasks to fulfill. In the end if successful the Insiders can keep their Ultrabooks, be it U772 or U572. Last year I took part in Fujitsu’s “LIFEBOOK4Life: Accept no boundaries” campaign and tested LIFEBOOK S761 laptop. It was very interesting couple of months. This year is not going to be any different and looks like it will be even more exciting.

LIFEBOOK4Life: Ultra Test Flight challenges 40 independent IT- and lifestyle-bloggers (called Insiders) from all over the world to a quest through virtual airport passing all stations from check-in to the gate. Each station contains a solo and a group task in which the Insiders unveil the features of Fujitsu’s Ultrabooks (U772 and U572) in aspects of mobility, reliability, elegance, connectivity and security. In the end if an Insider solves at least seven test tasks he or she can keep the Ultrabook. There is also extra bonuses with a change to go to Fujitsu Forum 2012 in Munich, which I went last year, and the Top 10. will get a flight voucher.

There are total of 10 test tasks and couple of extra tasks for the enthusiasts. Last year there was overall of 15 tasks but unfortunately the project site is not available anymore. It was and will be quite brain teasing and interesting to solve those with travel themed and somewhat tongue-in-cheek like articles. For example “mobility” contains a task to pack a lightweight luggage with the five items and “security” is about discussing and showing which security feature is your favorite. “Elegance” is for thin-telligence and design & style as “connectivity” is for 3G/UMTS and 4G/LTE. And the fifth theme “reliability” is about features which combine German engineering with Japanese quality.

Fujitsu LIFEBOOK U772 unboxed

LIFEBOOK4Life: Ultra Test Flight started last Friday which was convenient as the same day I got my package from the local post office. As usual, everything starts with unboxing and as a special Silver Insider (last year went the extra mile and expressed extraordinary commitment) my package contained a red LIFEBOOK U772. In short: Intel Core i5-3427U (2.8 GHz, 3 MB), 4 GB RAM, 128GB SSD, Intel HD Graphics 4000, 14″ 1366 x 768 LED backlight and Anti-glare screen, 802.11 a/b/g/n, Bluetooth 4, 3G/UMTS, 4G/LTE, (WxDxH): 327 x 225 x 15.6 mm and 1.4 kg. I will later write a short review about it.

The project has also something for everyone. You who can take part in a raffle and win a flight. To improve your chances of winning you can earn badges which gives you an extra raffle ticket. Just comment on 10 different blog articles, “Like” 10 different blog articles, share 3 articles with your friends on Facebook and log in on 6 different days.

You can follow my quest at the LIFEBOOK4Life site from my profile or follow me in Twitter.

Fujitsu Stylistic M532 review

Tablets have become more and more common in recent years and I have thought about getting one but haven’t quite got myself to buying one. Too many choices and didn’t know if I really needed one. When Fujitsu suggested to test their new Stylistic M532 Android tablet in part of their Lifebook4Life project i gladly took the opportunity. Couple of days later the postman brought their brand new 10″ Android tablet which is powered by quad-core Nvidia Tegra 3 processor and has 1280×800 resolution screen, 1 GB memory, 32 GB flash and weights 560 grams. In Finland it costs about 612 euros.

Fujitsu Stylistic M532

In short Fujitsu Stylistic M532 is a 10″ business grade Android tablet powered by quad core Nvidia Tegra 3 processor, 1 GB memory, 32 GB flash and has 1280×800 resolution Gorilla Glass protected LED backlighted and glossy screen. By 8.6 mm thickness and 560 grams it’s a bit slimmer and lighter than Apple’s new iPad (660g, 9,4mm). It runs vanilla Android 4.0 Ice Cream Sandwich and has 8 Mpix and 2 Mpix cameras. The black bezel has no physical buttons, is rounded by a red metal trim and the back is covered by rubber like material which gives you a good grip. Physically and visually it stands out from the crowd of Android tablets. In positive sense. The connectivity is enabled with Bluetooth, WiFi and 3G and you can extend storage with microSD card. Charging is handled by proprietary dock-connector at the bottom. There’s also microUSB connector (can’t be used for charging) and 3,5mm audio plugin.

The tablet’s performance is great and test results are in line with other Tegra 3 powered tablets (see results below). Movies and games ran without problems and with 32 GB storage plus microSD extension it would be a great traveling companion. But the most surprising thing is that the tablet has only 3,170 mAh battery as almost any other manufacture has over double the power. New iPad has 11,560 mAh and Samsung Galaxy Tab 2 has 7000 mAh. And as the charging is done only by docking connector you always have to carry it around on longer trips. And depending on what you want to do with your tablet the camera isn’t so good. In general tablets are lousy devices for taking pictures and although M532 has an 8 Mpix camera I would use any other available camera (test picture), eg. my HTC Sensation. You need a steady hand and good light to take decent pictures. I take the 2 Mpix front camera is fine for video conferences.

In overall, during my couple of weeks use of the Stylistic M532 tablet I found it convincing with visual appearance, physical structure, feel of robustness and performance and although it stands out of the crowd it isn’t really something to be excited about. Just like you could imagine a business grade tablet to be. And after work you can take it home with you for entertainment use. It’s light enough to hold easily and was pleasing to use for reading ebooks, news and seeing lecture videos. Also the games ran fast. Battery life is moderate compared to competition but I didn’t find it as a problem in my use but the glossy screen was sometimes annoying. The preinstalled apps are good extra for corporate users.

For more detailed review with videos you can check Aba Müller’s review in Lifebook4Life blog and read TechRadar’s verdict.

Technical details

  • Processor: Nvidia Tegra 3 T30S, Quad-Core ARM Cortex A9, 1.4 GHz
  • Memory: 1 GB
  • Storage: 32 GB Flash
  • Interfaces: SIM card slot, MicroSD (SDHC) slot, Audio, Micro USB, Dock connector
  • Display: 10.1″ (25.7cm), TFT, 1280 x 800 (WXGA), Gorilla Glass
  • Camera: 8 Mpix with flash, 2 Mpix front
  • Battery: 3,170mAh, video playback 8.4 h, charging 2.7 h
  • Muuta: 2x speakers, built-in microphone
  • Antennas: 2x dual band WLAN, 3G (UMTS), GPS, Bluetooth 3.0
  • WLAN: AzureWave AW-AH663 802.11 a/b/g/n
  • 3G: Integrated Huawei MU739 module, HSPA+ (downlink 21 MBit/s, uplink 5.76 MBit/s)
  • Sensors: 3-axis Accelerometer, Gyroscope, Magnetic Field Sensor, Ambient Light Sensor
  • Weight: 560 g
  • Dimensions (W x D x H): 262.6 x 175.4 x 8.6 mm

The tablet can be equipped with accessories like a dock with 2 USB ports and HDMI and the travel dock provides 1 USB port and HDMI. Also the tablet sleeve functions as a stand.

Performance

I quickly tested tablet’s performance with Quadrant, Vellamo, Rightware Taiji, GLBenchmark 2.5, Antutu 2.9, SunSpider 0.9.1 and Peacekeeper. Considering raw performance the Stylistic M532 is in line with other Tegra 3 based tablets.

Results

  • Quadrant: 4463
  • Vellamo: 1405
  • Rightware Taiji: 19,65
  • GLBenchmark 2.5 Egypt Classic C16Z16: 5818 frames, 51 fps
  • GLBenchmark 2.5 Egypt Classic C16Z16 Offscreen: 3306 frames, 29 fps
  • Antutu 2.9: 11157 (cpu 6627, gpu 1449, ram 2575, i/o 506)
  • SunSpider 0.9.1: 1708,5ms (1,3%)
  • Peacekeeper: Chrome 18, 417; Safari, 350; Firefox 15, 325

Preinstalled software

Fujitsu markets the tablet for businesses and as a Bring-your-own-device tablet and thus provides it with some preinstalled software for work related tasks. Otherwise it is just like any other Android tablet and isn’t equipped with manufacturer’s user interface customizations like Samsung and HTC tends to do.

For office documents the tablet is equipped with ThinkFree Office which provides MS Office 2007 (OOXML) compatible document, spreadsheet and presentation editing. Remote access to business applications can be done with Citrix Receiver, VMWare View Client and iTap Mobile RDP apps which are Virtual Desktop Interface (VDI) applications. Nitrodesk TouchDown keeps you email, contacts and calendar in sync with Exchange ActiveSync.

Norton Tablet Security with one year subscription keeps the tablet free of malware and viruses and combined with Norton Anti-Theft you can keep track of it in case of theft. Also with Absolute Computrace Mobile you can track the device and secure the data on the tablet.

Other preinstalled apps are ES File explorer for browsing and managing the files in the tablet and you can also access files from servers like Fujitsu Q700 NAS server. And for multimedia center there’s CyberLink’s PowerDVD.

One essential application for tablets is splittable keyboard which doesn’t come with Android 4.0 or preinstalled. The default on-screen keyboard is way too wide to use comfortable and by splitting it by half you get separate numpad and arrow keys. One possible free app for this is Open Split Keyboard.

Summary

Fujitsu Stylistic M532 is business grade Android tablet which also works for home and entertainment use. It convinces with good performance, build quality, feel of robustness and visual appearance. It stands out of the crowd but isn’t really something to be excited about. Which is a good quality for a business grade device. Battery life is moderate compared to competition and glossy screen is sometimes annoying. The preinstalled apps are good extra for corporate users but most of them can be bought from Google Play. Both WiFi and 3G connectivity enables you to connect easily where you want and microSD slot provides more storage if needed. It lefts little to be wanted and is a sleek and accomplished device.

Pros:

  • Performance
  • Robust and build quality
  • Connectivity: 3G, WiFi, Bluetooth
  • microSD slot

Cons:

  • Moderate battery life
  • Glossy screen

Fujitsu Stylistic M532 is a robust 10″ Android tablet and it would be interesting to compare the Stylistic M532 against the competition from eg. Samsung and Asus. Samsung’s Galaxy Note 10.1 tested by The Verge sounds on paper very interesting with pen functionality and all but at least The Verge said it was “Disappointing although S Pen works well”. Mostly the issues were with TouchWiz and build quality but the better drawing ability would make a big difference with prototyping applications and stuff. Other interesting devices are Asus’ Transformer Pad hybrid tablets like TF300 and TF700T which are more or less comparable in specifications, performance and price with Stylistic M532. And some people would compare Apples to oranges but as iOS provides features you can’t get with Android tablets and likewise the comparison isn’t meaningful.

Running FishEye & Crucible as a service in Linux

Atlassian’s tools for supporting software development are great but they aren’t really admin friendly to start with. For example FishEye & Crucible doesn’t ship with scripts to start it at system boot time but with the help of Atlassian’s Wiki, sysadmin tasks and scripts you can run it as a normal service. First we create a dedicated user for crucible and second we add a new service for it. I have done this on CentOS 5.7 x86_64.

Setting up the service account

As the root user, create a separate “FishEye & Crucible” service account at root shell:

# useradd -c "FishEye & Crucible service account" -d /home/crucible -m crucible

To make it easier for this to work also after FishEye & Crucible upgrades we create a symbolic link to the latest version (modify “/opt/fecru” to match your deployment).

# ln -s /opt/fecru/fecru-2.7.15 /opt/fecru/latest

Then, ensure that this user is the filesystem owner of the FishEye & Crucible instance (modify “/opt/fecru” to match your deployment).

# chown -R crucible:crucible /opt/fecru

Running Crucible as a crucible user

Save the following script to /etc/init.d/crucible. Be sure to edit the FISHEYE_HOME value to the location where your FishEye/Crucible instance resides:

#!/bin/bash
# RUN_AS: The user to run fisheye & crucible as. Its recommended that you create a separate user account for security reasons
RUN_AS=crucible
 
# FISHEYE_HOME: The path to the FishEye & Crucible installation. Its recommended to create a symbolic link to the latest version so the process will still work after upgrades.
FISHEYE_HOME="/opt/fecru/latest"
# FISHEYE_INST: The path where the data itself will be stored.
export FISHEYE_INST="/opt/fecru/fecru-data"

fisheyectl() {
        if [ "x$USER" != "x$RUN_AS" ]; then
                # If running without FISHEYE_INST
                # su - "$RUN_AS" -c "$FISHEYE_HOME/bin/fisheyectl.sh $1"
                su - "$RUN_AS" -c "FISHEYE_INST=$FISHEYE_INST $FISHEYE_HOME/bin/fisheyectl.sh $1"
        else
                "$FISHEYE_HOME/bin/fisheyectl.sh $1"
        fi
} 

case "$1" in
        start)
                fisheyectl start
                ;;
        stop)
                fisheyectl stop
                ;;
        restart)
                fisheyectl stop
                sleep 10
                fisheyectl start
                ;;
        *)
                echo "Usage: $0 {start|stop|restart}"
esac
 
exit 0

After saving the script, modify it’s permissions so that it can be executed:

# chmod 755 /etc/init.d/crucible

Running Crucible as a service

Now that we have an init script we can add it as a service and be able to configure the system to run the script on startup (more precisely, ensure that Crucible runs in runlevels 3, 4 and 5):

chkconfig --add crucible
chkconfig crucible on

Verify that the script has been installed correctly:

# chkconfig --list crucible

After this has been done you can manually start or stop the service by using these commands:

service crucible stop
service crucible start

And you’re done.

JSF 1.2 and getting selected value from dropdown

JSF 1.2 has some weird features which you just have to know if you haven’t read the documents. One example is getting a value from h:selectOneMenu dropdown after onchange event. The first what comes to mind is to use binding attribute with RichFaces’ a4j:support for rerendering elements after the event but it doesn’t work like you thought it would. In some cases using the binding attribute works just fine but as the binding attribute should refer to a request scoped bean property, not a session scoped one, you might get “Duplicate id error” when switching pages back and forth.

Fortunately there is valueChangeListener in h:SelectOneMenu which you can trick to do almost the same. It is executed during Validations phase, before the “Update Model Values” phase and is intended to get a handle of both the old and new value so that you can do some business stuff based on the real change. However, you can use it to invoke actions on a dropdown change only by combining it with onchange="submit()" and immediate="true" and the selected value is to be obtained by ValueChangeEvent#getNewValue(). (StackOverflow, BalusC)

For example:

Jspx:
<h:selectOneMenu value="#{fooBean.object.value}" 
	valueChangeListener="#{fooBean.statusChanged}" 
	onchange="submit()" immediate="true">
	<f:selectItem itemLabel="" itemValue=""/>
	<f:selectItems value="#{fooBean.selectValuesList}"/>
</h:selectOneMenu>
 
Java:
public void statusChanged(ValueChangeEvent event) {
	if (event.getNewValue() != null && 
		StringUtils.hasText((String) event.getNewValue())) {
		// ... Do something with the new value
	}
}

The negative side of using onchange="submit()" is that the form is submitted, validated and you don’t get the same dynamic feeling like with a4j:support.

In JSF 2 things are easier as you don’t need the valueChangeListener and you can use the listener attribute of instead.

Exclude JQuery libraries from Eclipse’s JavaScript Validation

Eclipse likes to validate JavaScript when doing Dynamic Web Modules and thus may give you false positive validation errors on 3rd party JavaScript libraries like JQuery. Although you can turn off the validation altogether but better solution is to configure it to exclude files as Alexander shows us at Stackoverflow.

Eclipse Indigo (3.7) has the option to selectively remove some JavaScript sources from validation. The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope file.

  1. Right click your project
  2. Select Properties → JavaScript → Include Path
  3. Select Source tab
  4. Expand JavaScript source folder
  5. Highlight Excluded pattern
  6. Click Edit button
  7. Click Add button next to Exclusion patterns box
  8. You may use wildcard pattern, or click Browse button to add the source by name.
    • Exclude all JQuery files with pattern like: js/jquery-*

The configuration with JQuery files excluded from validation looks like this:

eclipse_exclude-javascript

Eclipse and Maven Console

Eclipse 3.7 Indigo has integrated Maven m2e plugin but is missing some expected functionality which was previously present in Sonatype releases by default. If you want your Maven Console to show something you must also install the optional “m2e – slf4j over logback logging” plugin.

When installing the m2e plugin there is an optional feature “m2e – slf4j over logback logging” which is needed for the Maven Console to work. Without it the plugin produces no output to Eclipse’s Maven Console view so that it is impossible to track plugin’s activity (background maven builds, source and javadoc downloads, etc).

There is a bug filed about it but it is resolved with comment “As a tool, m2e is not in the position to impose any specific slf4j logging backend on the host Eclipse installation.” That seems kinda strange as without the optional component the plugin is missing useful parts.

Just “Install new sofware > Indigo > Collaboration > “m2e – slf4j over logback logging (Optional)” and your Maven Console is back in business.

Using CAcert.org signed certificates for TLS

Setting up Transport Layer Security (TLS), or as previously known as Secure Sockets Layer (SSL), for Apache, Postfix and IMAP like Dovecot is fairly easy. You just need some digital certificates and configuration. If you don’t want to pay for certificates from trusted sources like Thawte or you just don’t need that kind of trust (for development purposes), you can always produce your own certificates. But there is also a middle way: using CAcert.org signed certificates.

Background
Wikipedia tells us that CAcert.org is a community-driven certificate authority that issues free public key certificates. CAcert automatically signs certificates for email addresses controlled by the requester and for domains for which certain addresses (such as “hostmaster@example.com”) are controlled by the requester. Thus it operates as a robot certificate authority. CAcert certificates can be used like any other SSL certificates although they are considered weak because CAcert does not emit any information in the certificates other than the domain name or email address. To create higher-trust certificates, users can participate in a web of trust system whereby users physically meet and verify each other’s identities. They are also not as useful in web browsers as certificates issued by commercial CAs such as VeriSign, because most installed web browsers do not distribute CAcert’s root certificate. Thus, for most web users, a certificate signed by CAcert behaves like a self-signed certificate.

Generating Certificates
The procedure to sign your certificate at CAcert is rather simple. This guide assumes that the certificates are in /etc/ssl/cacert/ and you are as root.

0. Join CAcert.org and fill in your details. After email verification and login, add domain and service will try to verify that you can read mail on one of following accounts: root, hostmaster, postmaster, admin, webmaster or email addresses that can be found on whois data of domain that you provided.

1. Generate a private key that is not file encrypted:

openssl genrsa -out domainname.key 1024
chown root:root domainname.key
chmod 0400 domainname.key

Private keys should belong to “root” and be readable only by root.

You could also create a private key that is encrypted: openssl genrsa -des3 -out domainname.key 1024

2. Create a CSR with the RSA private key (output will be PEM format). Do not enter extra attributes at the prompt and leave the challenge password blank (press enter):

openssl req -new -key domainname.key -out domainname.csr

3. Verify the contents of the CSR or private key:

openssl req -noout -text -in domainname.csr
openssl rsa -noout -text -in domainname.key

4. Send your public key to be signed by and request new server certificate from CAcert.org web site (Class 1 certificate). When you are asked for CSR paste content of domainname.csr. It should look like this:

-----BEGIN CERTIFICATE REQUEST-----
MIIB3TCCAUYCAQAwgZwxCzAJBgNVBAYTAkZJMRAwDgYDVQQIEwdVdXNpbWFhMQ8w
...clip...
MQ==
-----END CERTIFICATE REQUEST-----

You can verify the content of request before sending it

openssl req -in domainname.csr -text -verify -noout

5. Copy the Server Certificate from the CAcert.org webpage and put it in domainname.crt file and add permissions.

chmod a=r domainname.crt

Check at least the contents of Validity and Subject fields:

openssl x509 -in domainname.crt -text -noout

6. Get CAcert.org root certificate

wget -nv https://www.cacert.org/certs/root.crt -O cacert-org.crt
chmod a=r cacert-org.crt

Check the contents:

openssl x509 -in cacert-org.crt -text -noout

After that you’re ready to configure your services like Apache, Postfix and Dovecot to use the new certificate. Read about it later.

For year 2012

The year 2011 has been pretty quiet in this blog as I managed to write just one post. In the backlog I have had for some time a couple of articles almost done and several topics to write about but as it sometimes happens, the time runs out.

For the coming year 2012 I have made a promise to myself to research technology related issues and also write about them to this blog and to my Finnish blog. Now I have just done the former and kept the new information to myself :) Including the articles in the backlog I also have some new topics to write. So subscribe to the RSS feed and stay tuned.

Happy New Year!

WordPress mod_rewrite rules taking over mod_status and mod_info

After moving Rule of Tech to a new server and setting up monitoring I noticed that server-status and server-info Apache modules weren’t working as expected. As usual a little bit of Googling solved this problem.

The problem was that the .htaccess rules in WordPress were taking over non-existing server-info and server-status urls given in Apache’s config and were returning a page not found error. The rewrite rules by WordPress were setup to handle all the permalinks on the site and for any non-existing file send it to index.php. It really wasn’t a WordPress problem and should happen with any application that uses the same type of catch-all rewrite rules to handle all the urls inside the application.

The solution was to specifically add a rewrite rule to not have the server-status and server-info urls processed by adding a rule like: RewriteCond %{REQUEST_URI} !=/server-status. The other way is to stop the rewriting process when the urls are found by adding a rule like: RewriteRule ^(server-info|server-status) - [L].

The WordPress rewrite rules should look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# server info and status
RewriteRule ^(server-info|server-status) - [L]
# RewriteCond %{REQUEST_URI} !=/server-status
# /server info and status
RewriteCond %{REQUEST_FILENAME} -f 
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . index.php [L]
</IfModule>
# END WordPress

Installing Apache Tomcat 6 on CentOS

CentOS is great substitute for Red Hat Enterprise Linux but is missing some useful packages like Apache Tomcat 6. Installing Apache Tomcat 6 on CentOS 5 from gzip-package is fairly easy. The following guide is at least for CentOS 5.4.

Pre-Requirements
First you need to install Sun JDK and you can follow the instructions given in Installing Sun JDK 1.6 on CentOS

After Java is on place it’s time to get ready for Tomcat.

Download Apache Ant and Tomcat

  1. Download apache-ant and apache-tomcat -packages.
  2. Extract those packages to /opt/
    • #[root@srv ~]# cd /opt
      # tar -xzf apache-tomcat-6.0.26.tar.gz
      # tar -xzf apache-ant-1.7.1-bin.tar.gz
      
  3. Create a symbolic link for Ant
    • # ln -s /opt/apache-ant-1.7.1/bin/ant /usr/bin/
      

Create start script

  1. Create a tomcat user so that we don’t need root privileges for Tomcat
    • # useradd -d /opt/apache-tomcat-6.0.26/ tomcat
      
  2. Create start script to /etc/init.d for starting and stopping Tomcat
    • #  vim /etc/init.d/tomcat
      
  3. The script is (via Build a safe cage for Tomcat)
    • 1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      
      #!/bin/bash
      #
      # tomcat       Starts Tomcat Java server.
      #
      #
      # chkconfig: 345 88 12
      # description: Tomcat is the server for 
      # Java servlet applications.
      ### BEGIN INIT INFO
      # Provides: $tomcat
      ### END INIT INFO
       
      JAVA_HOME=/usr/java/jdk1.6.0_18
      export JAVA_HOME
      TOMCAT_HOME=/opt/apache-tomcat-6.0.26/bin
      START_TOMCAT=/opt/apache-tomcat-6.0.26/bin/startup.sh
      STOP_TOMCAT=/opt/apache-tomcat-6.0.26/bin/shutdown.sh
       
      # Source function library.
      . /etc/init.d/functions
       
      [ -f $START_TOMCAT ] || exit 0
      [ -f $STOP_TOMCAT ] || exit 0
       
      RETVAL=0
       
      umask 077
       
      start() {
              echo -n $"Starting Tomcat Java server: "
              daemon su -c $START_TOMCAT tomcat
              echo
              return $RETVAL
      }
      stop() {
              echo -n $"Shutting down Tomcat Java server: "
              daemon su -c $STOP_TOMCAT tomcat
              echo
              return $RETVAL
      }
      restart() {
              stop
              start
      }
      case "$1" in
        start)
              start
              ;;
        stop)
              stop
              ;;
        restart|reload)
              restart
              ;;
        *)
              echo $"Usage: $0 {start|stop|restart}"
              exit 1
      esac
       
      exit $?
  4. Give executable rights for that script
    • # chmod 755 /etc/init.d/tomcat
      
  5. Add the script to CentOS services
    • # chkconfig --add tomcat
      
  6. Check the changes
    • # chkconfig --level 234 tomcat on
      # chkconfig --list tomcat
      
      tomcat 0:off 1:off 2:on 3:on 4:on 5:off 6:off
      
  7. You should see that the service uses levels 2, 3 and 4
  8. Test that the script is working and it gives no errors
    • # service tomcat start
      # service tomcat stop
      
  9. Everythings ready