Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script fixes #64

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 17 additions & 13 deletions install_yunohost
Expand Up @@ -119,14 +119,16 @@ function main()
step clean_image || die "Unable to clean image"
fi

info "Installation logs are available in $YUNOHOST_LOG"
success "YunoHost installation completed !"
conclusion

if is_raspbian ; then
# Reboot should be done before postinstall to be able to run iptables rules
info "Your server will now reboot. Please log back in as root and run the post-install."
reboot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add a small delay like sleep 5 here ? (Or even 10 ?) Otherwise the user will see a bunch of messages with no time to read them which is always frustrating ...

Also wondering if it makes sense to call conclusion if we're on raspian but idk

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexAubin Agreed for the sleep 5.
I think the conclusion is really important : without it, you're left wondering what to do after the reboot…

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmyup my concern is more that people will probably not have the time to read it just in 5 sec ... Maybe the best UX would be to press a key (or enter Y) to agree to reboot after reading the whole thing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well you don't need to. The text stays after ssh log-out.

…unless you're using some ssh client that clears the screen after disconnection.

Yeah, a "Press any key to reboot" would be great.

Anyways, could this script be automatically executed automatically at ssh connection ? Or at least, a
echo "Welcome, the yunohost install is not finished, please execute this command: …" could be shown.

fi

info "Installation logs are available in $YUNOHOST_LOG"
success "YunoHost installation completed !"
conclusion
exit 0
}

Expand Down Expand Up @@ -435,11 +437,11 @@ function workarounds_because_sysadmin_sucks() {
# ######################## #
# Workarounds for fail2ban #
# ######################## #
# We need to create auth.log in case it does not exists, because in some situation,

# We need to create auth.log in case it does not exists, because in some situation,
# this file does not exists, fail2ban will miserably fail to start because
# the default fail2ban jail include the sshd jail ... >.>
touch /var/log/auth.log
touch /var/log/auth.log

# ######################## #
# Workarounds for avahi #
Expand Down Expand Up @@ -512,24 +514,26 @@ function install_yunohost_packages() {
}

function restart_services() {
service slapd restart
# service yunohost-firewall start
service unscd restart
service nslcd restart
systemctl daemon-reload

systemctl restart slapd
# systemctl restart yunohost-firewall
systemctl restart unscd
systemctl restart nslcd

# NOTE : We don't fail if slapd fails to restart...
return 0
}

function fix_locales() {
# This function tries to fix the whole locale and perl mess about missing locale files

# Install 'locales' if locale-gen does not exists yet
command -v locale-gen > /dev/null || apt_get_wrapper -o Dpkg::Options::="--force-confold" -y install locales

# Generate at least en_US.UTF-8
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen

# If no /etc/environment exists, default to en_US.UTF-8
[ "$(grep LC_ALL /etc/environment)" ] || echo 'LC_ALL="en_US.UTF-8"' >> /etc/environment
source /etc/environment
Expand Down