~allenap/maas/device-discovery-updates-2.1

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Gavin Panella
  • Date: 2012-02-20 15:15:32 UTC
  • mto: This revision was merged to the branch mainline in revision 494.
  • Revision ID: gavin.panella@canonical.com-20120220151532-d63xkerv800hh81j
Use daemontools to start and stop pserv.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        find . -type f -name '*.py[co]' -print0 | xargs -r0 $(RM)
68
68
        find . -type f -name '*~' -print0 | xargs -r0 $(RM)
69
69
 
70
 
distclean: clean pserv-stop
 
70
distclean: clean shutdown
71
71
        utilities/maasdb delete-cluster ./db/
72
72
        $(RM) -r eggs develop-eggs
73
73
        $(RM) -r bin build dist logs parts
76
76
        $(RM) docs/api.rst
77
77
        $(RM) -r docs/_build/
78
78
 
79
 
pserv.pid: bin/twistd.pserv
80
 
        bin/twistd.pserv --pidfile=$@ maas-pserv --config-file=etc/pserv.yaml
81
 
 
82
 
pserv-start: pserv.pid
83
 
 
84
 
pserv-stop:
85
 
        { test -e pserv.pid && cat pserv.pid; } | xargs --no-run-if-empty kill
86
 
 
87
 
run: bin/maas dev-db pserv.pid
 
79
run: bin/maas dev-db start
88
80
        bin/maas runserver 8000 --settings=maas.demo
89
81
 
 
82
services/scan.pid:
 
83
        @svscan services > services/scan.log 2>&1 <&- & \
 
84
            echo $$! > services/scan.pid
 
85
 
 
86
start: bin/twistd.pserv dev-db services/scan.pid
 
87
        @find services -type f -name run -printf '%h\0' \
 
88
            | xargs -n1 -0 svc -u
 
89
 
 
90
stop:
 
91
        @find services -type f -name run -printf '%h\0' \
 
92
            | xargs -n1 -0 svc -d
 
93
 
 
94
status: services
 
95
        @find services -type f -name run -printf '%h\0' \
 
96
            | xargs -n1 -0 svstat
 
97
 
 
98
shutdown: pidfile=services/scan.pid
 
99
shutdown:
 
100
        @test ! -f $(pidfile) || { kill `cat $(pidfile)` && $(RM) $(pidfile); }
 
101
        @find services -type f -name run -printf '%h\0' \
 
102
            | xargs -n1 -0 svc -dx
 
103
 
90
104
harness: bin/maas dev-db
91
105
        bin/maas shell
92
106
 
95
109
 
96
110
.PHONY: \
97
111
    build check clean dev-db distclean doc \
98
 
    harness lint pserv-start pserv-stop run \
99
 
    syncdb test sampledata
 
112
    harness lint run shutdown syncdb test \
 
113
    sampledata start stop status \