bab9bb6b69
Create new directories: ceph config config-files filesystem kernel kernel/kernel-modules ldap logging strorage-drivers tools utilities virt Retire directories: connectivity core devtools support extended Delete two packages: tgt irqbalance Relocated packages: base/ dhcp initscripts libevent lighttpd linuxptp memcached net-snmp novnc ntp openssh pam procps sanlock shadow sudo systemd util-linux vim watchdog ceph/ python-cephclient config/ facter puppet-4.8.2 puppet-modules filesystem/ e2fsprogs nfs-utils nfscheck kernel/ kernel-std kernel-rt kernel/kernel-modules/ mlnx-ofa_kernel ldap/ nss-pam-ldapd openldap logging/ syslog-ng logrotate networking/ lldpd iproute mellanox python-ryu mlx4-config python/ python-2.7.5 python-django python-gunicorn python-setuptools python-smartpm python-voluptuous security/ shim-signed shim-unsigned tboot strorage-drivers/ python-3parclient python-lefthandclient virt/ cloud-init libvirt libvirt-python qemu tools/ storage-topology vm-topology utilities/ tis-extensions namespace-utils nova-utils update-motd Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
125 lines
2.5 KiB
Bash
Executable File
125 lines
2.5 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: Web Server
|
|
# Required-Start: networking
|
|
# Required-Stop: networking
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Lighttpd Web Server
|
|
# Description: Web service to serve static files and proxy
|
|
### END INIT INFO
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
DAEMON=/usr/sbin/lighttpd
|
|
NAME=lighttpd
|
|
DESC="Lighttpd Web Server"
|
|
OPTS="-f /etc/lighttpd/lighttpd.conf"
|
|
PIDFILE="/var/run/$NAME.pid"
|
|
PORT="80"
|
|
|
|
start()
|
|
{
|
|
|
|
if lsof -t -i:${PORT} 1> /dev/null 2>&1; then
|
|
kill $(lsof -t -i:${PORT}) > /dev/null 2>&1
|
|
fi
|
|
|
|
if [ -e $PIDFILE ]; then
|
|
PIDDIR=/proc/$(cat $PIDFILE)
|
|
if [ -d ${PIDDIR} ]; then
|
|
echo "$DESC already running."
|
|
return
|
|
else
|
|
echo "Removing stale PID file $PIDFILE"
|
|
rm -f $PIDFILE
|
|
fi
|
|
fi
|
|
|
|
echo -n "Checking scratch filesystem..."
|
|
let -i COUNT=0
|
|
while [ ! -e /scratch ]
|
|
do
|
|
if [ $COUNT -ge 15 ]
|
|
then
|
|
echo "failed to find /scratch."
|
|
exit -1
|
|
fi
|
|
let COUNT=COUNT+1
|
|
sleep 1
|
|
done
|
|
|
|
echo -n "Mounting scratch filesystem to chroot tmp..."
|
|
umount /www/tmp >& /dev/null
|
|
rm -r /scratch/lighttpd >& /dev/null
|
|
mkdir -p /scratch/lighttpd
|
|
mount --bind /scratch/lighttpd /www/tmp/
|
|
chown www /www/tmp/
|
|
|
|
echo -n "Starting $DESC..."
|
|
|
|
start-stop-daemon --start --pidfile ${PIDFILE} -x "$DAEMON" -- $OPTS
|
|
RETVAL=$?
|
|
if [ $RETVAL -eq 0 ]; then
|
|
echo "done."
|
|
else
|
|
echo "failed."
|
|
fi
|
|
}
|
|
|
|
stop()
|
|
{
|
|
if [ ! -e $PIDFILE ]; then return; fi
|
|
|
|
echo -n "Stopping $DESC..."
|
|
|
|
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} -x "$DAEMON"
|
|
RETVAL=$?
|
|
if [ $RETVAL -eq 0 ]; then
|
|
echo "done."
|
|
else
|
|
echo "failed."
|
|
fi
|
|
rm -f $PIDFILE
|
|
echo -n "Unmounting scratch filesystem from chroot tmp..."
|
|
umount /www/tmp
|
|
}
|
|
|
|
status()
|
|
{
|
|
pid=`cat $PIDFILE 2>/dev/null`
|
|
if [ -n "$pid" ]; then
|
|
if ps -p $pid &>/dev/null ; then
|
|
echo "$DESC is running"
|
|
RETVAL=0
|
|
return
|
|
else
|
|
RETVAL=1
|
|
fi
|
|
fi
|
|
echo "$DESC is not running"
|
|
RETVAL=3
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|force-reload|reload)
|
|
stop
|
|
start
|
|
;;
|
|
status)
|
|
status
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|force-reload|restart|reload|status}"
|
|
RETVAL=1
|
|
;;
|
|
esac
|
|
|
|
exit $RETVAL
|