3 # sfa Wraps PLCAPI into the SFA compliant API
5 # hopefully right after plc
6 # chkconfig: 2345 61 39
8 # description: Wraps PLCAPI into the SFA compliant API
12 [ -f /etc/sfa/sfa_config ] && . /etc/sfa/sfa_config
14 # source function library
15 . /etc/init.d/functions
17 # Regenerate configuration files - almost verbatim from plc.init
22 # Regenerate the main configuration file from default values
23 # overlaid with site-specific and current values.
24 # Thierry -- 2007-07-05 : values in plc_config.xml are *not* taken into account here
26 /etc/sfa/default_config.xml
27 /etc/sfa/configs/site.xml
29 for file in "${files[@]}" ; do
30 if [ -n "$force" -o $file -nt /etc/sfa/sfa_config.xml ] ; then
31 tmp=$(mktemp /tmp/sfa_config.xml.XXXXXX)
32 plc-config --xml "${files[@]}" >$tmp
33 if [ $? -eq 0 ] ; then
34 mv $tmp /etc/sfa/sfa_config.xml
35 chmod 444 /etc/sfa/sfa_config.xml
37 echo "SFA: Warning: Invalid configuration file(s) detected"
44 # Convert configuration to various formats
45 if [ -n "$force" -o /etc/sfa/sfa_config.xml -nt /etc/sfa/sfa_config ] ; then
46 plc-config --shell /etc/sfa/sfa_config.xml >/etc/sfa/sfa_config
48 if [ -n "$force" -o /etc/sfa/sfa_config.xml -nt /etc/sfa/sfa_config.py ] ; then
49 plc-config --python /etc/sfa/sfa_config.xml >/etc/sfa/sfa_config.py
51 # if [ -n "$force" -o /etc/sfa/sfa_config.xml -nt /etc/sfa/php/sfa_config.php ] ; then
52 # mkdir -p /etc/sfa/php
53 # plc-config --php /etc/sfa/sfa_config.xml >/etc/sfa/php/sfa_config.php
56 # [re]generate the sfa_component_config
65 action $"SFA installing peer certs" daemon /usr/bin/sfa-start.py -t -d $OPTIONS
67 if [ "$SFA_REGISTRY_ENABLED" -eq 1 ]; then
68 action $"SFA Registry" daemon /usr/bin/sfa-start.py -r -d $OPTIONS
71 if [ "$SFA_AGGREGATE_ENABLED" -eq 1 ]; then
72 action $"SFA Aggregate" daemon /usr/bin/sfa-start.py -a -d $OPTIONS
75 if [ "$SFA_SM_ENABLED" -eq 1 ]; then
76 action "SFA SliceMgr" daemon /usr/bin/sfa-start.py -s -d $OPTIONS
79 if [ "$SFA_FLASHPOLICY_ENABLED" -eq 1 ]; then
80 action "Flash Policy Server" daemon /usr/bin/sfa_flashpolicy.py --file="$SFA_FLASHPOLICY_CONFIG_FILE" --port=$SFA_FLASHPOLICY_PORT -d
84 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa-start.py
89 action $"Shutting down SFA" killproc sfa-start.py
92 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa-start.py
99 reload) reload force ;;
100 restart) stop; start ;;
102 if [ -f /var/lock/subsys/sfa-start.py ]; then
112 echo $"Usage: $0 {start|stop|reload|restart|condrestart|status}"