]> git.pld-linux.org Git - packages/airvideo.git/blame - airvideo.init
- drop obsolete and outdated manual inclusion of rpm macros
[packages/airvideo.git] / airvideo.init
CommitLineData
246fbce2
ER
1#!/bin/sh
2#
3# airvideo Air-Video Video Streaming Server
4#
5# chkconfig: 345 20 80
6#
7# description: Air-Video Video Streaming Server
8#
9# processname: airvideo
10# config: /etc/airvideo.properties
11# pidfile: /var/run/airvideo.pid
12#
13# $Id$
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18# Get network config
19. /etc/sysconfig/network
20
21# Check that networking is up.
22if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "Air-Video Server"
25 exit 1
26 fi
27else
28 exit 0
29fi
30
31# Get service config - may override defaults
32[ -f /etc/sysconfig/airvideo ] && . /etc/sysconfig/airvideo
33
34start() {
35 # Check if the service is already running?
36 if [ -f /var/lock/subsys/airvideo ]; then
37 msg_already_running "Air-Video Server"
38 return
39 fi
40
41 msg_starting "Air-Video Server"
39b7c45e 42 daemon --fork --chdir /var/lib/airvideo --pidfile /var/run/airvideo.pid --user nobody /usr/bin/java -jar /usr/share/java/AirVideoServerLinux.jar /etc/airvideo.properties
246fbce2 43 RETVAL=$?
39b7c45e
ER
44 if [ $RETVAL -eq 0 ]; then
45 # XXX
46 pgrep -u nobody java > /var/run/airvideo.pid
47 touch /var/lock/subsys/airvideo
48 fi
246fbce2
ER
49}
50
51stop() {
52 if [ ! -f /var/lock/subsys/airvideo ]; then
53 msg_not_running "Air-Video Server"
54 return
55 fi
56
57 # Stop daemons.
58 msg_stopping "Air-Video Server"
59 killproc --pidfile /var/run/airvideo.pid airvideo -TERM
60 rm -f /var/lock/subsys/airvideo
61}
62
63condrestart() {
64 if [ ! -f /var/lock/subsys/airvideo ]; then
65 msg_not_running "Air-Video Server"
66 RETVAL=$1
67 return
68 fi
69
70 stop
71 start
72}
73
74RETVAL=0
75# See how we were called.
76case "$1" in
77 start)
78 start
79 ;;
80 stop)
81 stop
82 ;;
83 restart)
84 stop
85 start
86 ;;
87 try-restart)
88 condrestart 0
89 ;;
90 force-reload)
91 condrestart 7
92 ;;
93 status)
94 status --pidfile /var/run/airvideo.pid airvideo java
95 RETVAL=$?
96 ;;
97 *)
98 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
99 exit 3
100esac
101
102exit $RETVAL
This page took 0.067086 seconds and 4 git commands to generate.