From 47f342a44b814b49a67fb2d1f5695f605f3c84fc Mon Sep 17 00:00:00 2001 From: Zamentur aka ljf Date: Sat, 26 Sep 2015 23:12:37 +0200 Subject: [PATCH 1/6] [fix] Allow to create a DockerFile by ignore hostname change failure --- install_yunohostv2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 057592a..4e5752b 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -132,7 +132,8 @@ set_domain() { # Configure hostname to yunohost.yunohost.org if not already set # NOTE: This is done also during postinstall "to avoid amavis bug" # so we might not need it here - [[ "$(hostname -d 2>/dev/null)" != "" ]] || hostname yunohost.yunohost.org > /dev/null 2>&1 + [[ "$(hostname -d 2>/dev/null)" != "" ]] || hostname yunohost.yunohost.org \ + || echo 'Hostname change is not permitted' > /dev/null 2>&1 } confirm_installation() { From ad502ef188ed193fa66e704e0166aade08d71581 Mon Sep 17 00:00:00 2001 From: Zamentur aka ljf Date: Sat, 26 Sep 2015 23:27:23 +0200 Subject: [PATCH 2/6] [fix] Remove completely the set_domain to allow DockerFile creation The hostname is change in post installation --- install_yunohostv2 | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 4e5752b..bb2a4e4 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -128,14 +128,6 @@ EOF fi } -set_domain() { - # Configure hostname to yunohost.yunohost.org if not already set - # NOTE: This is done also during postinstall "to avoid amavis bug" - # so we might not need it here - [[ "$(hostname -d 2>/dev/null)" != "" ]] || hostname yunohost.yunohost.org \ - || echo 'Hostname change is not permitted' > /dev/null 2>&1 -} - confirm_installation() { [[ "$AUTOMODE" == "1" ]] && return 0 @@ -390,40 +382,36 @@ if ! step create_custom_config ; then die "Creating custom configuration file /etc/yunohost/yunohost.conf failed" 4 fi -if ! step set_domain ; then - die "Setting hostname failed" 5 -fi - if ! step confirm_installation ; then - die "Installation cancelled at your request" 6 + die "Installation cancelled at your request" 5 fi if ! step setup_package_source ; then - die "Setting up deb package sources failed" 7 + die "Setting up deb package sources failed" 6 fi if ! step apt_update ; then - die "Error caught during 'apt-get update'" 8 + die "Error caught during 'apt-get update'" 7 fi if ! step register_debconf ; then - die "Unable to insert new values into debconf database" 9 + die "Unable to insert new values into debconf database" 8 fi if ! step workaround_avahi_installation ; then - die "Unable to install workaround for avahi installation" 10 + die "Unable to install workaround for avahi installation" 9 fi if ! step install_yunohost_packages ; then - die "Installation of Yunohost packages failed" 11 + die "Installation of Yunohost packages failed" 10 fi if ! step restart_services ; then - die "Error caught during services restart" 12 + die "Error caught during services restart" 11 fi if ! step post_install ; then - die "Post-installation failed" 13 + die "Post-installation failed" 12 fi # Success ! From 688b42de1d5324fd0e9f94fa114074fb2465fdd5 Mon Sep 17 00:00:00 2001 From: Le Kload Date: Mon, 28 Sep 2015 00:13:35 +0200 Subject: [PATCH 3/6] [fix] Force dependency install --- install_yunohostv2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index bb2a4e4..34a2297 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -97,7 +97,7 @@ upgrade_system() { installscript_dependencies() { # install dependencies of the install script itself apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y install \ + -y --force-yes install \ lsb-release wget whiptail \ || return 1 } @@ -257,7 +257,7 @@ workaround_avahi_installation() { install_yunohost_packages() { apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ - -y install \ + -y --force-yes install \ yunohost yunohost-config \ yunohost-config-postfix \ postfix postfix-ldap \ From ed1de840f8b7ee59295fa2dd40f7ffe4841ba625 Mon Sep 17 00:00:00 2001 From: zamentur Date: Mon, 28 Sep 2015 23:09:23 +0200 Subject: [PATCH 4/6] [fix] Bad debconf command --- install_yunohostv2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 34a2297..6d74f1e 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -173,7 +173,7 @@ apt_update() { register_debconf() { if [[ $(lsb_release -c | awk '{print $2}') == jessie ]]; then - cat << EOF > debconf-set-selections + debconf-set-selections << EOF slapd slapd/password1 password yunohost slapd slapd/password2 password yunohost slapd slapd/domain string yunohost.org @@ -194,7 +194,7 @@ nslcd nslcd/ldap-base string dc=yunohost,dc=org libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow EOF else - cat << EOF > debconf-set-selections + debconf-set-selections << EOF slapd slapd/password1 password yunohost slapd slapd/password2 password yunohost slapd slapd/domain string yunohost.org From 21be853424479dce38da67f90a6dc07a8fe3214c Mon Sep 17 00:00:00 2001 From: zamentur Date: Tue, 29 Sep 2015 00:05:29 +0200 Subject: [PATCH 5/6] [fix] Random avahi adduser not working correctly --- install_yunohostv2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 6d74f1e..98a802a 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -239,7 +239,7 @@ workaround_avahi_installation() { # Get a random unused uid between 500 and 999 (system-user) local avahi_id=$((500 + RANDOM % 500)) - while ! cut -d ':' -f 3 /etc/passwd | grep -q $avahi_id ; + while cut -d ':' -f 3 /etc/passwd | grep -q $avahi_id ; do avahi_id=$((500 + RANDOM % 500)) done From 35d9857286c60183c206ff634203612c45778dbc Mon Sep 17 00:00:00 2001 From: zamentur Date: Tue, 29 Sep 2015 00:06:32 +0200 Subject: [PATCH 6/6] [fix] Service nscd was not started at the end of the installation --- install_yunohostv2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 98a802a..1f99d6d 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -267,8 +267,8 @@ install_yunohost_packages() { restart_services() { service slapd restart # service yunohost-firewall start -# service nscd restart -# service nslcd restart + service nscd restart + service nslcd restart # NOTE : We don't fail if slapd fails to restart... return 0