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
1=== modified file 'debian/maas-region-controller.postinst'
2--- debian/maas-region-controller.postinst 2016-09-16 01:18:32 +0000
3+++ debian/maas-region-controller.postinst 2016-11-10 10:04:52 +0000
4@@ -16,7 +16,7 @@
5 }
6
7 restart_postgresql(){
8- invoke-rc.d --force postgresql restart || true
9+ deb-systemd-invoke restart postgresql || true
10 }
11
12 configure_maas_default_url() {
13@@ -110,7 +110,7 @@
14 # Create the database
15 dbc_go maas-region-controller $@
16 maas-region local_config_set \
17- --database-host "localhost" --database-name "$dbc_dbname" \
18+ --database-host "localhost" --database-port 5432 --database-name "$dbc_dbname" \
19 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"
20
21 # Only syncdb if we have selected to install it with dbconfig-common.
22@@ -144,7 +144,7 @@
23
24 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
25 # If upgrading to any later package version, then upgrade db.
26- invoke-rc.d apache2 stop || true
27+ deb-systemd-invoke restart apache2 || true
28
29 # make sure postgresql is running
30 restart_postgresql
31@@ -170,7 +170,7 @@
32
33 # Reconfigure the config file.
34 maas-region local_config_set \
35- --database-host "localhost" --database-name "$dbc_dbname" \
36+ --database-host "localhost" --database-port 5432 --database-name "$dbc_dbname" \
37 --database-user "$dbc_dbuser" --database-pass "$dbc_dbpass"
38
39 mv /etc/maas/maas_local_settings.py /etc/maas/maas_local_settings.py.maas-old
40@@ -181,12 +181,12 @@
41 configure_migrate_maas_dns
42 fi
43
44-systemctl enable maas-regiond >/dev/null || true
45-systemctl restart maas-regiond >/dev/null || true
46-invoke-rc.d apache2 restart || true
47+deb-systemd-invoke enable maas-regiond >/dev/null || true
48+deb-systemd-invoke restart maas-regiond >/dev/null || true
49+deb-systemd-invoke restart apache2 || true
50
51 if [ -f /lib/systemd/system/maas-rackd.service ]; then
52- systemctl restart maas-rackd >/dev/null || true
53+ deb-systemd-invoke restart maas-rackd >/dev/null || true
54 fi
55
56 db_stop

Subscribers

People subscribed via source and target branches