Merge lp:~ltrager/maas/default_port into lp:~maas-maintainers/maas/packaging

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: 535
Merged at revision: 534
Proposed branch: lp:~ltrager/maas/default_port
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 56 lines (+8/-8)
1 file modified
debian/maas-region-controller.postinst (+8/-8)
To merge this branch: bzr merge lp:~ltrager/maas/default_port
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+310034@code.launchpad.net

Commit message

Set the default database port in /etc/maas/regiond.conf

Description of the change

With https://code.launchpad.net/~ltrager/maas/lp1613862/+merge/310033 MAAS now allows the user to set the port to connect to Postgres with. When creating the default /etc/maas/regiond.conf set the default port number so the user knows they can do that.

I also noticed this postinst script was still using a few SysV commands to restart services. I've converted them all to use systemctl.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

One question, one thing to consider.

review: Needs Information
lp:~ltrager/maas/default_port updated
535. By Lee Trager

Use deb-systemd-invoke instead of systemctl directly

Revision history for this message
Lee Trager (ltrager) wrote :

Replied in comments.

Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst 2016-09-16 01:18:32 +0000
+++ debian/maas-region-controller.postinst 2016-11-10 10:04:52 +0000
@@ -16,7 +16,7 @@
16}16}
1717
18restart_postgresql(){18restart_postgresql(){
19 invoke-rc.d --force postgresql restart || true19 deb-systemd-invoke restart postgresql || true
20}20}
2121
22configure_maas_default_url() {22configure_maas_default_url() {
@@ -110,7 +110,7 @@
110 # Create the database110 # Create the database
111 dbc_go maas-region-controller $@111 dbc_go maas-region-controller $@
112 maas-region local_config_set \112 maas-region local_config_set \
113 --database-host "localhost" --database-name "$dbc_dbname" \113 --database-host "localhost" --database-port 5432 --database-name "$dbc_dbname" \
114 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"114 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"
115115
116 # Only syncdb if we have selected to install it with dbconfig-common.116 # Only syncdb if we have selected to install it with dbconfig-common.
@@ -144,7 +144,7 @@
144144
145elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then145elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
146 # If upgrading to any later package version, then upgrade db.146 # If upgrading to any later package version, then upgrade db.
147 invoke-rc.d apache2 stop || true147 deb-systemd-invoke restart apache2 || true
148148
149 # make sure postgresql is running149 # make sure postgresql is running
150 restart_postgresql150 restart_postgresql
@@ -170,7 +170,7 @@
170170
171 # Reconfigure the config file.171 # Reconfigure the config file.
172 maas-region local_config_set \172 maas-region local_config_set \
173 --database-host "localhost" --database-name "$dbc_dbname" \173 --database-host "localhost" --database-port 5432 --database-name "$dbc_dbname" \
174 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"174 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"
175175
176 mv /etc/maas/maas_local_settings.py /etc/maas/maas_local_settings.py.maas-old176 mv /etc/maas/maas_local_settings.py /etc/maas/maas_local_settings.py.maas-old
@@ -181,12 +181,12 @@
181 configure_migrate_maas_dns181 configure_migrate_maas_dns
182fi182fi
183183
184systemctl enable maas-regiond >/dev/null || true184deb-systemd-invoke enable maas-regiond >/dev/null || true
185systemctl restart maas-regiond >/dev/null || true185deb-systemd-invoke restart maas-regiond >/dev/null || true
186invoke-rc.d apache2 restart || true186deb-systemd-invoke restart apache2 || true
187187
188if [ -f /lib/systemd/system/maas-rackd.service ]; then188if [ -f /lib/systemd/system/maas-rackd.service ]; then
189 systemctl restart maas-rackd >/dev/null || true189 deb-systemd-invoke restart maas-rackd >/dev/null || true
190fi190fi
191191
192db_stop192db_stop

Subscribers

People subscribed via source and target branches