Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created August 4, 2011 14:21
Show Gist options
  • Save terrancesnyder/1125261 to your computer and use it in GitHub Desktop.
Save terrancesnyder/1125261 to your computer and use it in GitHub Desktop.
rpm removal and listing
# list all installed packages
rpm -qa
# remove a package
rpm -ev YOURRPM
@terrancesnyder
Copy link
Author

chown tomcat:users /etc/init.d/haproxy
chown tomcat:users /usr/sbin/haproxy
chown tomcat:users /etc/haproxy/haproxy.cfg

current users [tomcat, pentaho, clip_app]

@terrancesnyder
Copy link
Author

#! /bin/sh
### BEGIN INIT INFO
# Provides: portfoward
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: PortForward
# Description: HAProxy Port Forwarding
#
### END INIT INFO

case $1 in
start)
        iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 80 -j REDIRECT --to-port 7011
        iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 7011
        iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 7011
        iptables -t nat -I OUTPUT --source 0/0 --destination 0/0 -p tcp --dport 80 -j REDIRECT --to-ports 7011
        ;;
stop)
        # nothing to do
        ;;
restart)
        ;;
esac
exit 0

@terrancesnyder
Copy link
Author

chmod 744 /etc/init.d/portforward
chmod 744 /etc/init.d/haproxy
ln -s /etc/init.d/haproxy /sbin/rchaproxy
ln -s /etc/init.d/portforward /sbin/portforward 
/sbin/insserv /etc/init.d/haproxy
/sbin/insserv /etc/init.d/portforward

@terrancesnyder
Copy link
Author

HAPROXY_PID="/opt/tomcat/haproxy.pid"

Changed /etc/init.d/haproxy to support pid in tomcat folder

@terrancesnyder
Copy link
Author

       /sbin/startproc -u tomcat $HAPROXY_BIN -D -f $HAPROXY_CONF -p $HAPROXY_PID

Modify /etc/init.d/haproxy to contain running under tomcat user

@terrancesnyder
Copy link
Author

rpm -ev tomcat5-5.0.30-27.26

@terrancesnyder
Copy link
Author

pentaho and tomcat added to init.d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment