diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-15 16:26:04 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-15 16:33:52 +0200 |
commit | d6ac8e57453040d9f6523098fe3f969cecf32e9d (patch) | |
tree | bbb1f8a89d61a3d4787968bfcfcc64f99f9fcec3 /setup-alpine.in | |
parent | 0660f4ca87c4c978589f923e0e2d0eca856be6b4 (diff) | |
download | alpine-conf-d6ac8e57453040d9f6523098fe3f969cecf32e9d.zip |
setup-alpine: ensure unintentional ssh diconnect
Avoid restart network when running over ssh. hostname is now a
dependency of networking so openrc will restart networking together with
hostname, which may lead to disconnection when running over ssh.
Solve this by only restart hostname if SSH_CONNECTION is empty.
fixes https://gitlab.alpinelinux.org/alpine/aports/-/issues/14018
Diffstat (limited to 'setup-alpine.in')
-rw-r--r-- | setup-alpine.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index c1634c1..952d7da 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -152,7 +152,7 @@ if [ "$rc_sys" != LXC ]; then if is_virtual_console || [ -n "$KEYMAPOPTS" ]; then setup-keymap ${KEYMAPOPTS} fi - setup-hostname ${HOSTNAMEOPTS} && rc-service hostname --quiet restart + setup-hostname ${HOSTNAMEOPTS} && [ -z "$SSH_CONNECTION" ] && rc-service hostname --quiet restart setup-devd -C mdev # just to bootstrap fi |