From b8bb87390f96bb25485222be976d2fea7b4b13b3 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 14 Sep 2018 10:41:00 +0200 Subject: [PATCH] Make cgroups preexisting hard dependency --- activemq/setup/etc/init.d/activemq | 4 ---- basic/srv/vm/mgr/__init__.py | 9 ++++++--- ckan-datapusher/setup/etc/init.d/ckan-datapusher | 4 ---- ckan/setup/etc/init.d/ckan | 2 +- crisiscleanup/setup/etc/init.d/crisiscleanup | 2 +- cts/setup/etc/init.d/cts | 2 +- frontlinesms/setup/etc/init.d/frontlinesms | 4 ---- gnuhealth/setup/etc/init.d/gnuhealth | 2 +- kanboard/setup/etc/init.d/kanboard | 2 +- mariadb/setup/etc/init.d/mariadb | 4 ---- mifosx/setup/etc/init.d/mifosx | 2 +- motech/setup/etc/init.d/motech | 2 +- opendatakit-build/setup/etc/init.d/opendatakit-build | 2 +- opendatakit/setup/etc/init.d/opendatakit | 2 +- openmapkit/setup/etc/init.d/openmapkit | 4 ---- pandora/setup/etc/init.d/pandora | 2 +- postgres/setup/etc/init.d/postgres | 4 ---- rabbitmq/setup/etc/init.d/rabbitmq | 4 ---- redis/setup/etc/init.d/redis | 4 ---- sahana-demo/setup/etc/init.d/sahana-demo | 2 +- sahana/setup/etc/init.d/sahana | 2 +- sambro/setup/etc/init.d/sambro | 2 +- seeddms/setup/etc/init.d/seeddms | 2 +- sigmah/setup/etc/init.d/sigmah | 2 +- solr/setup/etc/init.d/solr | 4 ---- ushahidi/setup/etc/init.d/ushahidi | 2 +- 26 files changed, 22 insertions(+), 55 deletions(-) diff --git a/activemq/setup/etc/init.d/activemq b/activemq/setup/etc/init.d/activemq index e8a3d90..993871b 100644 --- a/activemq/setup/etc/init.d/activemq +++ b/activemq/setup/etc/init.d/activemq @@ -2,10 +2,6 @@ description="ActiveMQ container" -depend() { - need cgroups -} - start() { /usr/bin/lxc-start activemq } diff --git a/basic/srv/vm/mgr/__init__.py b/basic/srv/vm/mgr/__init__.py index bf3fd10..f0bc98c 100644 --- a/basic/srv/vm/mgr/__init__.py +++ b/basic/srv/vm/mgr/__init__.py @@ -189,12 +189,15 @@ class VMMgr: return deps def get_app_deps(self, app): - # Get "needs" line from init script and split it to list, skipping first two elements (docker, net) + # Get "needs" line from init script and split it to list try: with open(os.path.join('/etc/init.d', app), 'r') as f: - return [l.split()[2:] for l in f.readlines() if l.startswith('\tneed')][0] + for line in f.readlines(): + if line.strip().startswith('need'): + return line.split()[1:] except: - return [] + pass + return [] def enable_autostart(self, app): # Add the app to OpenRC default runlevel diff --git a/ckan-datapusher/setup/etc/init.d/ckan-datapusher b/ckan-datapusher/setup/etc/init.d/ckan-datapusher index 5156bdd..7fb4589 100755 --- a/ckan-datapusher/setup/etc/init.d/ckan-datapusher +++ b/ckan-datapusher/setup/etc/init.d/ckan-datapusher @@ -2,10 +2,6 @@ description="CKAN DataPusher container" -depend() { - need cgroups -} - start() { lxc-start ckan-datapusher } diff --git a/ckan/setup/etc/init.d/ckan b/ckan/setup/etc/init.d/ckan index 5361d49..cd575e2 100755 --- a/ckan/setup/etc/init.d/ckan +++ b/ckan/setup/etc/init.d/ckan @@ -3,7 +3,7 @@ description="CKAN container" depend() { - need cgroups ckan-datapusher postgres redis solr + need ckan-datapusher postgres redis solr } start() { diff --git a/crisiscleanup/setup/etc/init.d/crisiscleanup b/crisiscleanup/setup/etc/init.d/crisiscleanup index 251fff3..df618fe 100644 --- a/crisiscleanup/setup/etc/init.d/crisiscleanup +++ b/crisiscleanup/setup/etc/init.d/crisiscleanup @@ -3,7 +3,7 @@ description="Crisis Cleanup container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/cts/setup/etc/init.d/cts b/cts/setup/etc/init.d/cts index 9934fa6..b1d1528 100755 --- a/cts/setup/etc/init.d/cts +++ b/cts/setup/etc/init.d/cts @@ -3,7 +3,7 @@ description="CTS container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/frontlinesms/setup/etc/init.d/frontlinesms b/frontlinesms/setup/etc/init.d/frontlinesms index 1de62ec..c1409b2 100755 --- a/frontlinesms/setup/etc/init.d/frontlinesms +++ b/frontlinesms/setup/etc/init.d/frontlinesms @@ -2,10 +2,6 @@ description="FrontlineSMS container" -depend() { - need cgroups -} - start() { lxc-start frontlinesms } diff --git a/gnuhealth/setup/etc/init.d/gnuhealth b/gnuhealth/setup/etc/init.d/gnuhealth index c5ca4ed..65b8c87 100755 --- a/gnuhealth/setup/etc/init.d/gnuhealth +++ b/gnuhealth/setup/etc/init.d/gnuhealth @@ -3,7 +3,7 @@ description="GNU Health container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/kanboard/setup/etc/init.d/kanboard b/kanboard/setup/etc/init.d/kanboard index d4d31dc..e8f833c 100755 --- a/kanboard/setup/etc/init.d/kanboard +++ b/kanboard/setup/etc/init.d/kanboard @@ -3,7 +3,7 @@ description="KanBoard container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/mariadb/setup/etc/init.d/mariadb b/mariadb/setup/etc/init.d/mariadb index f73941c..0295ee5 100755 --- a/mariadb/setup/etc/init.d/mariadb +++ b/mariadb/setup/etc/init.d/mariadb @@ -2,10 +2,6 @@ description="MariaDB container" -depend() { - need cgroups -} - start() { /usr/bin/lxc-start mariadb } diff --git a/mifosx/setup/etc/init.d/mifosx b/mifosx/setup/etc/init.d/mifosx index f10fab9..0ca53da 100755 --- a/mifosx/setup/etc/init.d/mifosx +++ b/mifosx/setup/etc/init.d/mifosx @@ -3,7 +3,7 @@ description="Mifos X container" depend() { - need cgroups mariadb + need mariadb } start() { diff --git a/motech/setup/etc/init.d/motech b/motech/setup/etc/init.d/motech index 5a083df..e837dd3 100755 --- a/motech/setup/etc/init.d/motech +++ b/motech/setup/etc/init.d/motech @@ -3,7 +3,7 @@ description="Motech container" depend() { - need cgroups activemq postgres + need activemq postgres } start() { diff --git a/opendatakit-build/setup/etc/init.d/opendatakit-build b/opendatakit-build/setup/etc/init.d/opendatakit-build index 832af30..bfca4d1 100755 --- a/opendatakit-build/setup/etc/init.d/opendatakit-build +++ b/opendatakit-build/setup/etc/init.d/opendatakit-build @@ -3,7 +3,7 @@ description="OpenDataKit Build container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/opendatakit/setup/etc/init.d/opendatakit b/opendatakit/setup/etc/init.d/opendatakit index 03f5084..ceaeb49 100755 --- a/opendatakit/setup/etc/init.d/opendatakit +++ b/opendatakit/setup/etc/init.d/opendatakit @@ -3,7 +3,7 @@ description="OpenDataKit Aggregate container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/openmapkit/setup/etc/init.d/openmapkit b/openmapkit/setup/etc/init.d/openmapkit index bc2a769..9975e88 100755 --- a/openmapkit/setup/etc/init.d/openmapkit +++ b/openmapkit/setup/etc/init.d/openmapkit @@ -2,10 +2,6 @@ description="OpenMapKit container" -depend() { - need cgroups -} - start() { lxc-start openmapkit } diff --git a/pandora/setup/etc/init.d/pandora b/pandora/setup/etc/init.d/pandora index 5a7df95..80b4dfb 100755 --- a/pandora/setup/etc/init.d/pandora +++ b/pandora/setup/etc/init.d/pandora @@ -3,7 +3,7 @@ description="Pan.do/ra container" depend() { - need cgroups postgres rabbitmq + need postgres rabbitmq } start() { diff --git a/postgres/setup/etc/init.d/postgres b/postgres/setup/etc/init.d/postgres index 8ea9bb9..b4f0c70 100755 --- a/postgres/setup/etc/init.d/postgres +++ b/postgres/setup/etc/init.d/postgres @@ -2,10 +2,6 @@ description="Postgres container" -depend() { - need cgroups -} - start() { lxc-start postgres } diff --git a/rabbitmq/setup/etc/init.d/rabbitmq b/rabbitmq/setup/etc/init.d/rabbitmq index 8c901c0..3743466 100755 --- a/rabbitmq/setup/etc/init.d/rabbitmq +++ b/rabbitmq/setup/etc/init.d/rabbitmq @@ -2,10 +2,6 @@ description="RabbitMQ container" -depend() { - need cgroups -} - start() { lxc-start rabbitmq } diff --git a/redis/setup/etc/init.d/redis b/redis/setup/etc/init.d/redis index 28b7d5d..489b7cd 100755 --- a/redis/setup/etc/init.d/redis +++ b/redis/setup/etc/init.d/redis @@ -2,10 +2,6 @@ description="Redis container" -depend() { - need cgroups -} - start() { lxc-start redis } diff --git a/sahana-demo/setup/etc/init.d/sahana-demo b/sahana-demo/setup/etc/init.d/sahana-demo index b4ef4e6..8160f7c 100755 --- a/sahana-demo/setup/etc/init.d/sahana-demo +++ b/sahana-demo/setup/etc/init.d/sahana-demo @@ -3,7 +3,7 @@ description="Sahana Eden Demo container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/sahana/setup/etc/init.d/sahana b/sahana/setup/etc/init.d/sahana index a8f8c7a..b864cdc 100755 --- a/sahana/setup/etc/init.d/sahana +++ b/sahana/setup/etc/init.d/sahana @@ -3,7 +3,7 @@ description="Sahana Eden container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/sambro/setup/etc/init.d/sambro b/sambro/setup/etc/init.d/sambro index 4f0582a..82d7c4a 100755 --- a/sambro/setup/etc/init.d/sambro +++ b/sambro/setup/etc/init.d/sambro @@ -3,7 +3,7 @@ description="SAMBRO container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/seeddms/setup/etc/init.d/seeddms b/seeddms/setup/etc/init.d/seeddms index 76c3107..b0f9688 100755 --- a/seeddms/setup/etc/init.d/seeddms +++ b/seeddms/setup/etc/init.d/seeddms @@ -3,7 +3,7 @@ description="SeedDMS container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/sigmah/setup/etc/init.d/sigmah b/sigmah/setup/etc/init.d/sigmah index b1a723c..b0d961a 100755 --- a/sigmah/setup/etc/init.d/sigmah +++ b/sigmah/setup/etc/init.d/sigmah @@ -3,7 +3,7 @@ description="Sigmah container" depend() { - need cgroups postgres + need postgres } start() { diff --git a/solr/setup/etc/init.d/solr b/solr/setup/etc/init.d/solr index 2bb6600..5d62670 100755 --- a/solr/setup/etc/init.d/solr +++ b/solr/setup/etc/init.d/solr @@ -2,10 +2,6 @@ description="Solr container" -depend() { - need cgroups -} - start() { lxc-start solr } diff --git a/ushahidi/setup/etc/init.d/ushahidi b/ushahidi/setup/etc/init.d/ushahidi index c7fe9b4..7476ac6 100755 --- a/ushahidi/setup/etc/init.d/ushahidi +++ b/ushahidi/setup/etc/init.d/ushahidi @@ -3,7 +3,7 @@ description="Ushahidi container" depend() { - need cgroups mariadb + need mariadb } start() {