~free.ekanayaka/landscape-client/jaunty-1.5.0.1-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to debian/landscape-client.init

  • Committer: Free Ekanayaka
  • Date: 2010-04-22 12:40:12 UTC
  • Revision ID: free.ekanayaka@canonical.com-20100422124012-185qa9e2pmeu02oj
* New upstream version
  - Fix smart-update failing its very first run (LP: #562496)
  - Depend on pythonX.Y-dbus and pythonX.Y-pycurl (LP: #563063)
  - Make only one request at a time to retrieve EC2 instances (LP: #567515)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
. /lib/lsb/init-functions
26
26
[ -f $LANDSCAPE_DEFAULTS ] && . $LANDSCAPE_DEFAULTS
27
27
 
28
 
# This $RUN check should match the semantics of
29
 
# l.sysvconfig.SysVConfig.is_configured_to_run.
30
 
if [ $RUN -eq 0 ]; then
31
 
        if [ $CLOUD -eq 1 ]; then
32
 
                if landscape-is-cloud-managed; then
33
 
                        # Install the cloud default configuration file
34
 
                        cp /usr/share/landscape/cloud-default.conf /etc/landscape/client.conf
35
 
                        # Override default file for not going in this conditional again at
36
 
                        # next startup
37
 
                        sed -i "s/^RUN=.*/RUN=1/" $LANDSCAPE_DEFAULTS
38
 
                        if ! grep -q "^RUN=" $LANDSCAPE_DEFAULTS; then
39
 
                                echo "RUN=1" >> $LANDSCAPE_DEFAULTS
40
 
                        fi
41
 
                else
42
 
                        echo "$NAME is not configured, please run landscape-config."
43
 
                        exit 0
44
 
                fi
45
 
        else
46
 
                echo "$NAME is not configured, please run landscape-config."
47
 
                exit 0
48
 
        fi
49
 
fi
 
28
check_config () {
 
29
    # This $RUN check should match the semantics of
 
30
    # l.sysvconfig.SysVConfig.is_configured_to_run.
 
31
    if [ $RUN -eq 0 ]; then
 
32
            if [ $CLOUD -eq 1 ]; then
 
33
                    if landscape-is-cloud-managed; then
 
34
                            # Install the cloud default configuration file
 
35
                            cp /usr/share/landscape/cloud-default.conf /etc/landscape/client.conf
 
36
                            # Override default file for not going in this conditional again at
 
37
                            # next startup
 
38
                            sed -i "s/^RUN=.*/RUN=1/" $LANDSCAPE_DEFAULTS
 
39
                            if ! grep -q "^RUN=" $LANDSCAPE_DEFAULTS; then
 
40
                                    echo "RUN=1" >> $LANDSCAPE_DEFAULTS
 
41
                            fi
 
42
                    else
 
43
                            echo "$NAME is not configured, please run landscape-config."
 
44
                            exit 0
 
45
                    fi
 
46
            else
 
47
                    echo "$NAME is not configured, please run landscape-config."
 
48
                    exit 0
 
49
            fi
 
50
    fi
 
51
}
50
52
 
51
53
case "$1" in
52
54
        start)
 
55
                check_config
53
56
                log_daemon_msg "Starting the $NAME daemon"
54
57
                if [ ! -e $PIDDIR ]; then
55
58
                        mkdir $PIDDIR