full of … these

hazelcast rpm spec file and init script

Posted: November 9th, 2013 | Author: | Filed under: Uncategorized | No Comments »

Here is how I have built the rpm for hazelcast.

Download and unpack:

wget http://www.hazelcast.com/files/hazelcast-3.1.1.zip

unzip hazelcast-3.1.1.zip

Create a dir for building the rpm:

mkdir -p rpm-build/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

Copy sources and init file to SOURCES dir:

cp -r hazelcast-3.1.1 hazelcats-init rpm-root/SOURCES/

 

hazelcast.spec:

Name:           hazelcast
Version:        3.1.1
Release:        1
Summary:        hazelcast
Group:          hazelcast
License:        GPL
URL:            http://www.hazelcast.com
#Source0:
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:      noarch
#BuildRequires:
#Requires:
%description
hazelcast 3.1.1
%prep
%build
%install
mkdir -p $RPM_BUILD_ROOT/opt/hazelcast/lib
mkdir -p $RPM_BUILD_ROOT/opt/hazelcast/bin
mkdir -p $RPM_BUILD_ROOT/etc/init.d
cp -Rip %{_sourcedir}/hazelcast-3.1.1/{bin,lib} $RPM_BUILD_ROOT/opt/hazelcast/
cp      %{_sourcedir}/hazelcast-init $RPM_BUILD_ROOT/etc/init.d/hazelcast
%clean
rm -rf $RPM_BUILD_ROOT
%files
%dir /opt/hazelcast
/opt/hazelcast/lib
/opt/hazelcast/bin
%attr(0755,root,root) /etc/init.d/hazelcast
%changelog
* Fri Nov 08 2013 - pjurco@localhost

- First version

hazelcast-init:

#!/bin/sh
### BEGIN INIT INFO
# Provides: hazelcast
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop hazelcast
# Description: Start, stop and hazelcast
### END INIT INFO
HAZELCAST_HOME=/opt/hazelcast
PID_FILE=/var/run/hazelcast.pid
if [ "$1" = "start" ]; then
#execute some command in the background here, using
cd $HAZELCAST_HOME/bin && ./server.sh &
#the "&"-sign at the end of the command
PID=`ps -ef | grep -v grep | grep -m 1 "StartServer" | awk '{print $2}'`
echo "$PID" > $PID_FILE
elif [ "$1" = "stop" ]; then
kill -9 `cat $PID_FILE`
rm $PID_FILE
else
echo "Usage: hazelcast start|stop"
exit 1

Build command is:

rpmbuild --define '_topdir '`pwd`/rpm-root -ba hazelcast.spec

useless howtos….

Posted: September 19th, 2007 | Author: | Filed under: Uncategorized | Tags: , , | No Comments »

no posts for a long time… i’m too fscking busy, no TTL…
but because i’mto bored, here are some useful info on how to:

Add extra disks space in freebsd 🙂

buy another pair of 500gb disks
stick them into your server
build a hardware raid1
boot freebsd
mount /dev/ar1s1d on /files/hdd2
edit /etc/fstab
happy users…

Add extra disks space in freebsd (how a bored admin will do it):

buy two big disks for raid1 mirroring
stick them into the fscking old server
boot freebsd
read all article at the following link
read it again (allways helps)
# gmirror list|less
Geom name: gm0
State: COMPLETE
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 1247150714
Providers:
1. Name: mirror/gm0
Mediasize: 250059349504 (233G)
Sectorsize: 512
Mode: r1w1e2
Consumers:
1. Name: ad2
Mediasize: 250059350016 (233G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 376482481
2. Name: ad3
Mediasize: 250059350016 (233G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 985518569

users will never thank you