diff options
-rw-r--r-- | buildtools/debian-skeleton/rpki-ca.postinst | 4 | ||||
-rw-r--r-- | buildtools/debian-skeleton/rpki-ca.postrm | 3 | ||||
-rw-r--r-- | buildtools/debian-skeleton/rpki-ca.upstart | 18 |
3 files changed, 19 insertions, 6 deletions
diff --git a/buildtools/debian-skeleton/rpki-ca.postinst b/buildtools/debian-skeleton/rpki-ca.postinst index 08b6e59d..866183af 100644 --- a/buildtools/debian-skeleton/rpki-ca.postinst +++ b/buildtools/debian-skeleton/rpki-ca.postinst @@ -48,7 +48,7 @@ setup_rpki_conf() { fi } -setup_mysql() { +setup_sql() { #rpki-sql-setup --mysql-defaults /etc/mysql/debian.cnf create rpki-sql-setup --postgresql-root-username postgres create } @@ -94,7 +94,7 @@ case "$1" in setup_rpkid_user setup_apache setup_rpki_conf - setup_mysql + setup_sql setup_bpki setup_django setup_cron diff --git a/buildtools/debian-skeleton/rpki-ca.postrm b/buildtools/debian-skeleton/rpki-ca.postrm index c93f84df..372847f2 100644 --- a/buildtools/debian-skeleton/rpki-ca.postrm +++ b/buildtools/debian-skeleton/rpki-ca.postrm @@ -25,7 +25,8 @@ case "$1" in sql=/etc/rpki/drop_databases.sql if test -f $sql then - mysql --defaults-file=/etc/mysql/debian.cnf --execute "source $sql" + #mysql --defaults-file=/etc/mysql/debian.cnf --execute "source $sql" + sudo -u postgres psql -f $sql fi rm -f /etc/rpki.conf /etc/rpki.conf.sample $sql rm -f /etc/rpki/apache.conf /etc/rpki/apache.cer /etc/rpki/apache.key diff --git a/buildtools/debian-skeleton/rpki-ca.upstart b/buildtools/debian-skeleton/rpki-ca.upstart index 36a792ee..7b1b6611 100644 --- a/buildtools/debian-skeleton/rpki-ca.upstart +++ b/buildtools/debian-skeleton/rpki-ca.upstart @@ -7,10 +7,22 @@ author "Rob Austein <sra@hactrn.net>" # welcome, but please first read the Python code to understand what it # is doing. -# Our only real dependencies are on mysqld and our config file. +# Our only real dependencies are on our SQL engine and our config file. +# +# Unfortunately, the switch to postgresql means we can't use a straightforward +# upstart dependency here, because postgresql uses an old-style init.d script. +# But everybody is moving to systemd, so we're going to have to rewrite this +# in any case. -start on started mysql -stop on stopping mysql +# FWIW, "/etc/init.d/postgres status" returns a status line ending in "online" +# when the server is up, "down" when the server is down, and perhaps other values +# under stranger circumstances. + +#start on started mysql +#stop on stopping mysql + +start on runlevel [2345] +stop on runlevel [!2345] pre-start script if test -f /etc/rpki.conf && |