[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

18.04 = circular login problem on system freeze

On Fri, 20 Jul 2018 04:30:28 +0200, Ralf Mardorf wrote:
>Sometimes I boot an Ubuntu flavour live media and run scripts to change
>a few defaults. Since those scripts also run apt command that require
>root privileges and because the user of Ubuntu flavour live media has
>got the UID 1001 and the script is in a mounted home of a user with the
>UID 1000 I run
>sudo -i
>first, then I launch the script.
>A script could contain something like this:
>[rocketmouse at archlinux ~]$ grep flavour=
>flavour="ubuntu-mate"  # user name
>[rocketmouse at archlinux ~]$ grep userset\( -A5
>userset() # Usage: userset <schema> <key> <value>
>  HOME="/home/$flavour"
>  sudo -u $flavour gsettings set $@
>  HOME="/root"
>[rocketmouse at archlinux ~]$ grep rootset\( -A3
>rootset() # Usage: rootset <schema> <key> <value>
>  gsettings set $@
>[rocketmouse at archlinux ~]$ grep pluma
>rootset org.mate.pluma             color-scheme        'tango'
>userset org.mate.pluma             color-scheme        'tango'
>[rocketmouse at archlinux ~]$ grep Marco
>userset org.mate.Marco.general reduced-resources   $redures
>userset org.mate.Marco.general side-by-side-tiling $sidetil
>userset org.mate.Marco.general     theme               'TraditionalOk'
>userset org.mate.Marco.general     focus-mode          'mouse'
>userset org.mate.Marco.general     button-layout
>':minimize,maximize,close' userset org.mate.Marco.general
>center-new-windows  true userset org.mate.Marco.general
>compositing-manager false
>or it does contain something similar to this:

UID 1000, since this script was used for a Tails (Debian based) live
media, but the script alos run with root privileges for apt usage:

>[rocketmouse at archlinux ~]$ grep u1000= 
>u1000=$(getent passwd 1000 | cut -d: -f1)
>[rocketmouse at archlinux ~]$ grep prof_default= 
>prof_default=$(echo [:$(gsettings get org.gnome.Terminal.ProfilesList
>default | sed "s/'//g")]) [rocketmouse at archlinux ~]$ grep bell_tmp=
> bell_tmp=/tmp/gnome-terminal-bell-$u1000-$(id -u)
>[rocketmouse at archlinux ~]$ grep "dbus-launch dconf dump" -B1 -A9
> sudo -u $u1000 echo $prof_default > $bell_tmp
>sudo -u $u1000 dbus-launch dconf
>dump /org/gnome/terminal/legacy/profiles:/ | grep -v audible-bell |
>grep -vF $prof_default >> $bell_tmp case $1 in
>  --bell-off)
>    echo audible-bell=false >> $bell_tmp
>  ;;
>  *)
>    echo audible-bell=true  >> $bell_tmp
>  ;;
>sudo -u $u1000 dbus-launch dconf
>load /org/gnome/terminal/legacy/profiles:/ < $bell_tmp

Try running

sudo -i
sudo -u dan gsettings set show-apps-at-top false