Zenika-Training / strigo-init-script-libs

Script snippets for Strigo init scripts
3 stars 1 forks source link

Do not fail when trying to restart tmux session #34

Closed zigarn closed 2 years ago

zigarn commented 2 years ago

No tmux in Desktop environments

Fixes #32

zigarn commented 2 years ago

Found a way to reload sessions that is working on both terminal & desktop modes.

Ping @pyaillet @awattez @y0an @ebriand WDYT?

scandinave commented 2 years ago

I just test it on a fresh ubuntu desktop install. This seems to work. The session is killed and after reconnection, docker ps works as expected. But no script can be executed after this command. So to used it, this need to be done in a script called after all others.

So for docker, the best is maybe to call newgrp docker to allow the use of docker command in the current shell and call the script containing the loginctl terminate-user ubuntu after all scripts

zigarn commented 2 years ago

As the init script in Strigo is executed in the background as root, it does continue without any issue after this command, the ubuntu user is just momentarily kicked out from terminal or desktop.

On the opposite, using newgrp docker in the init script won't have any effect on the opened sessions of the ubuntu user, only the script session of root who doesn't need it.

scandinave commented 2 years ago

Ok. I just test it on strigo. This works fine.

awattez commented 2 years ago

LGTM 😉

zigarn commented 2 years ago

@pyaillet : pure découverte pour moi aussi !