Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Save all the detailed sourced files information and the errors during the logging process.

114 views
Skip to first unread message

hongy...@gmail.com

unread,
Jan 25, 2023, 11:28:34 PM1/25/23
to
Hi here,

For Linux desktop login, say, Gnome, with the bash as the default shell, is there a method to save all the detailed sourced files information and the errors during the logging process?

I often encounter strange phenomena and problems in login, but I don't know where they come from. Any tips will be appreciated.

Regards,
Zhao

Bit Twister

unread,
Jan 26, 2023, 12:13:16 AM1/26/23
to
Since you did not provide what Distribution you are using, no one can a
lot of detailed information.

So, check system logs, X11 logs, and user logs.
Since I am running Xfce4 on Mageia Linux that would be journalctl, /var/log.
and ~/.*error*

hongy...@gmail.com

unread,
Jan 26, 2023, 2:17:09 AM1/26/23
to
On Thursday, January 26, 2023 at 1:13:16 PM UTC+8, Bit Twister wrote:
> On Wed, 25 Jan 2023 20:28:31 -0800 (PST), hongy...@gmail.com wrote:
> > Hi here,
> >
> > For Linux desktop login, say, Gnome, with the bash as the default shell, is there a method to save all the detailed sourced files information and the errors during the logging process?
> >
> > I often encounter strange phenomena and problems in login, but I don't know where they come from. Any tips will be appreciated.
> Since you did not provide what Distribution you are using, no one can a
> lot of detailed information.

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.10
Release: 22.10
Codename: kinetic

werner@X10DAi:~$ echo $SHELL
/bin/bash

Furthermore, I've complicated and structured customized profile configurations in the following locations:

werner@X10DAi:~$ ls /etc/profile.d/000-rootshare.sh
/etc/profile.d/000-rootshare.sh
werner@X10DAi:~$ ls ~/.profile.d/
000-networkd-resolved-netplan-dnsmasq.bash 300-fcitx5-rime.bash
001-dnsmasq-dnsproxy.bash 300-firefox.bash
005-blacklist-nouveau.sh 300-ftl.git.bash
005-disable-update-upgrade.sh 300-fzf.git.bash
005-fix-locale.bash 300-gnus.d.bash
005-git-env.sh 300-iso.bash
005-zsys-daemon-connection-error.bash 300-nginx.git.bash
010-docker-client.sh 300-openjdk.bash
010-docker-daemon.sh 300-openssh.bash
010-dockerd-data-root.sh.save 300-ripgrep-all.git.bash.save
010-proxychains-ng-daemon.git.bash 300-ripgrep.git.bash
015-apollo.git.bash 300-slurm.bash
100-gnome-terminal.sh 300-tclreadline.git.bash
100-xdgbds.bash 300-tessdata_best.git.bash.save
200-git-config.sh 300-tessdata.git.bash
200-go.git.bash 300-texlive.bash
200-pyenv.git.bash 300-wine-libgl.bash
300-brook.git.bash 300-x11docker.git.bash
300-calibre.git.bash 400-maven.bash
300-carat.git.bash 900-homeshare.git.bash
300-ext-saladict-chrome.bash

> So, check system logs, X11 logs, and user logs.
> Since I am running Xfce4 on Mageia Linux that would be journalctl, /var/log.
> and ~/.*error*

Recently, I always meet the "Are you sure you want to proceed?" message on login as described here [1], and none of the above logs give me some clues. I want to disable the above message window to appear each time when I'm trying to log in and still failed to figure out the solution.

[1] https://askubuntu.com/questions/587868/are-you-sure-you-want-to-proceed-message-on-login

Regards,
Zhao

Kees Nuyt

unread,
Jan 26, 2023, 7:12:15 AM1/26/23
to
On Wed, 25 Jan 2023 23:17:06 -0800 (PST), "hongy...@gmail.com"
<hongy...@gmail.com> wrote:

[...]
>werner@X10DAi:~$ ls /etc/profile.d/000-rootshare.sh
>/etc/profile.d/000-rootshare.sh
>werner@X10DAi:~$ ls ~/.profile.d/
>000-networkd-resolved-netplan-dnsmasq.bash 300-fcitx5-rime.bash
>001-dnsmasq-dnsproxy.bash 300-firefox.bash
[...]

Binay search will take just a few tries.
Move half of the scripts in ~/.profile.d/ somewhere where they
will not run.
Try again.
- No error: the problem was in the half you moved away
- Still error: the problem was in the half you did not move

Proceed by activating half of the set of scripts that has the
problem.
Repeat until the size of the set is one script.
--
Kees Nuyt

hongy...@gmail.com

unread,
Jan 26, 2023, 7:32:52 AM1/26/23
to
Nice idea. I'll give a try.

> --
> Kees Nuyt

Regards,
Zhao

Bit Twister

unread,
Jan 26, 2023, 8:52:05 AM1/26/23
to
On Wed, 25 Jan 2023 23:17:06 -0800 (PST), hongy...@gmail.com wrote:

> Recently, I always meet the "Are you sure you want to proceed?" message on login as described here [1], and none of the above logs give me some clues. I want to disable the above message window to appear each time when I'm trying to log in and still failed to figure out the solution.

I suggest creating a test account, say junk. Log out of hongyi and into junk.
If junk has the same problem as hongyi you know it is a system wide problem.
If junk does not have the problem then you know it is a user (hongyi) problem.

You can test the login process from either account by logging into the
other user account by clicking up a terminal and doing
su - junk
from a hongyi terminal or su - hongyi from a junk terminal, depending
on who you want to test.

For you, I suggest anytime you make any login script change is to
su - junk and very there are no problems.

hongy...@gmail.com

unread,
Jan 26, 2023, 10:09:49 PM1/26/23
to
Do you mean always first test any newly added/revised script with this account?

Best,
Zhao

Bit Twister

unread,
Jan 26, 2023, 10:16:01 PM1/26/23
to
Why not. Can not see that it take long to su -l junk and enter password.

On my distribution, that kind of error will not let you do a gui login.


What is your procedure if you make a change and can not do a gui login?

Janis Papanagnou

unread,
Jan 27, 2023, 1:15:32 AM1/27/23
to
On 27.01.2023 04:09, hongy...@gmail.com wrote:
> On Thursday, January 26, 2023 at 9:52:05 PM UTC+8, Bit Twister wrote:
>> [...]
>
> Do you mean always first test any newly added/revised script with this account?

Nah! In this part of the world we say that testing is only for wimps.

We accept that systems get spoiled. Provide arbitrary changes quickly.
It's certainly thrilling.

Unavailable and unreliable and non-trustworthy environments for users
and customers are just a minor nuisance.

Real heroes can then jump in an fix any issues. (With more untested
scripts.)

Mind that admins get no credit for nicely and reliably working systems.

If you show that you can fix issues (and issues of fixes, recursively)
you prove that you are a competent doer, a hero with quick solutions.
(In many environments no one cares if you are the [continuous] source
of the issue.)

This all works well at least in companies with ignorant management and
where folks have to depend on skills and expertise.


Disclaimer: Anyone who is taking above as serious professional approach
is hopelessly lost. - OTOH that might fit well in quite some parts of
our (IT-)world. *sigh*

Janis

>
> Best,
> Zhao
>

hongy...@gmail.com

unread,
Jan 27, 2023, 3:35:27 AM1/27/23
to
On Friday, January 27, 2023 at 11:16:01 AM UTC+8, Bit Twister wrote:
> On Thu, 26 Jan 2023 19:09:46 -0800 (PST), hongy...@gmail.com wrote:
> > On Thursday, January 26, 2023 at 9:52:05 PM UTC+8, Bit Twister wrote:
> >> On Wed, 25 Jan 2023 23:17:06 -0800 (PST), hongy...@gmail.com wrote:
>
> >> For you, I suggest anytime you make any login script change is to
> >> su - junk and very there are no problems.
> >
> > Do you mean always first test any newly added/revised script with this
> > account?
> Why not. Can not see that it take long to su -l junk and enter password.

Agreed.

> On my distribution, that kind of error will not let you do a gui login.

That's the same dilemma I face here.

> What is your procedure if you make a change and can not do a gui login?

Fortunately, I found the following quick workaround to avoid rebooting the system for the next login attempt when the "Are you sure you want to proceed?" problem occurs:

1. Ctrl + Alt + F4 opens a console window, where you can log in using the username and password.
2. After logging in, run the following command to restart gdm:

$ sudo systemctl restart gdm

3. Then you will have the opportunity to log back in to the GUI.

Best,
Zhao

Bit Twister

unread,
Jan 27, 2023, 5:50:08 AM1/27/23
to
But what happens if gui does not start.

Can YOU run a non gui editor to rectify your induced problem?

hongy...@gmail.com

unread,
Jan 27, 2023, 9:14:56 AM1/27/23
to
As far as the current focus question is concerned, a.k.a., "Are you sure you want to proceed?", I really didn't have observed GUI did not start again.

> Can YOU run a non gui editor to rectify your induced problem?

Only if I know what's the culprit, otherwise, I don't know what should be rectified, just as the question discussed here.

Regards,
Zhao

Bit Twister

unread,
Jan 27, 2023, 1:44:59 PM1/27/23
to
If you are modifying one of your files in the login path, I assume you have
set -u
just after the #!/bin/bash at the top of your scripts, I would expect when
you do a su - l junk you will see some bash error message.

The quest was not about what file, but can YOU run a non-gui editor?



hongy...@gmail.com

unread,
Jan 27, 2023, 7:57:44 PM1/27/23
to
On Saturday, January 28, 2023 at 2:44:59 AM UTC+8, Bit Twister wrote:
> On Fri, 27 Jan 2023 06:14:53 -0800 (PST), hongy...@gmail.com wrote:
> > On Friday, January 27, 2023 at 6:50:08 PM UTC+8, Bit Twister wrote:
>
> >> Can YOU run a non gui editor to rectify your induced problem?
> >
> > Only if I know what's the culprit, otherwise, I don't know what should be rectified, just as the question discussed here.
> If you are modifying one of your files in the login path, I assume you have
> set -u
> just after the #!/bin/bash at the top of your scripts, I would expect when
> you do a su - l junk you will see some bash error message.

Thank you for this tip.

> The quest was not about what file, but can YOU run a non-gui editor?

Yes. I can.

Jerry Peters

unread,
Jan 29, 2023, 4:38:19 PM1/29/23
to
I run a second X server, when I make changes I test by switching to it
& logging in. Most likely, if login fails, it's the change I just made.
I also use it to test changes to my FVWM configuration to see if I
like them.

Jerry

hongy...@gmail.com

unread,
Jan 29, 2023, 8:34:21 PM1/29/23
to
On Thursday, January 26, 2023 at 8:12:15 PM UTC+8, Kees Nuyt wrote:
I've tried out the above method, and find that the "Are you sure you want to proceed?" problem is not caused by any scripts located under ~/.profile.d/. So what should I do for further examination?

> --
> Kees Nuyt
Zhao

Kees Nuyt

unread,
Jan 30, 2023, 4:42:13 AM1/30/23
to
On Sun, 29 Jan 2023 17:34:18 -0800 (PST), "hongy...@gmail.com"
<hongy...@gmail.com> wrote:

> I've tried out the above method, and find that the
> "Are you sure you want to proceed?" problem is not
> caused by any scripts located under ~/.profile.d/. So
> what should I do for further examination?

Continue with the scripts in /etc/profile.d/ , and
and ~/.xxxxxx scripts, like .bashrc and .profile,
and any GUI equivalents of those.
--
Kees Nuyt

hongy...@gmail.com

unread,
Jan 31, 2023, 7:06:15 PM1/31/23
to
In my case, it seems that all stuff under /etc/profile.d/, and in .bashrc or .profile are not the culprits. And I've the following ~/.xxxxxx scripts:

werner@X10DAi:~$ find -L . -maxdepth 1 -mindepth 1 -xtype l -name '.*'
./.bashrc
./.newsrc
./.newsrc.eld
./.gprc
./.tclshrc
./.gnus.el
./.git
./.zshrc
werner@X10DAi:~$ find . -maxdepth 1 -mindepth 1 -type f -name '.*'
./.sys1og.conf
./.pypirc
./.xdvirc
./.zlua
./.sudo_as_admin_successful
./.bash_history
./.wget-hsts
./.pmgrc.yaml
./.latexmkrc
./.profile
./.gap_hist
./.gp_history
./.ripgreprc
./.emacs-w3m.el
./.condarc
./.lesshst
./.python_history
./.gitconfig
./.xinputrc

However, not all of them will be sourced by the login process. So how should I further focus on some of them?

> --
> Kees Nuyt
Zhao

hongy...@gmail.com

unread,
Feb 5, 2023, 6:41:25 AM2/5/23
to
Finally, it turns out that the problem is caused by a bug of a Ubuntu patch and the incorrect settings in my initialization scripts. See the following links for more details:

https://git.launchpad.net/ubuntu/+source/gdm3/tree/debian/patches/ubuntu/config_error_dialog.patch
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/2005135
https://discourse.gnome.org/t/are-you-sure-you-want-to-proceed-message-on-login/13758/7

> > --
> > Kees Nuyt
> Zhao

hongy...@gmail.com

unread,
Feb 6, 2023, 4:40:45 AM2/6/23
to
According to the above suggestions, I conducted the following test:

werner@X10DAi:~$ sudo useradd test
werner@X10DAi:~$ sudo passwd test # Set the pw as: asdf1234
werner@X10DAi:~$ sudo usermod -d /home/test -s /bin/bash test
werner@X10DAi:~$ sudo mkdir /home/test

# This time, the problem discussed here doesn't appear again:
werner@X10DAi:~$ su - test
Password:
test@X10DAi:~$

So, I tried to login back as follows and the problem appeared once more:

test@X10DAi:~$ su - werner
Password:
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to create dbus connection
xhost: unable to open display ""
dirname: invalid option -- 'b'
Try 'dirname --help' for more information.
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.

Any tips for further debugging?

Regards,
Zhao

Kees Nuyt

unread,
Feb 6, 2023, 9:15:00 AM2/6/23
to
On Sun, 5 Feb 2023 03:41:22 -0800 (PST), "hongy...@gmail.com"
<hongy...@gmail.com> wrote:

> Finally, it turns out that the problem is caused by a bug
> of a Ubuntu patch and the incorrect settings in my
> initialization scripts.

I'm glad you could solve it.
--
Kees Nuyt

hongy...@gmail.com

unread,
Feb 6, 2023, 9:02:29 PM2/6/23
to
But Gunnar Hjalmarsson <200...@bugs.launchpad.net> gives the alternative maybe nicer solution *:

--- begin quote ---
Gunnar Hjalmarsson (gunnarhj) wrote on 2020-07-12: #2

Second thoughts...

The --no-markup option prevents zenity from interpreting \n which makes the dialog hard to read in most cases. So only adding --no-markup is not a viable solution.

As a possible alternative I played with sed() a bit. The script includes this line:

TEXT="$PARA1\n\n$(fold -s $ERR)\n\n$PARA2"

My thought is to add a new line right after that. Something along these lines:

TEXT=$(printf '%s' "$TEXT" | sed 's/</\&lt;/g')

which would replace all occurrences of '<' with '&lt;'. Can you please test that and see if it helps in your case.
Changed in gdm3 (Ubuntu):
status: In Progress → Incomplete
Changed in lightdm (Ubuntu):
status: In Progress → Incomplete
summary: - lightdm config-error-dialog.sh should pass --no-markup
+ config-error-dialog.sh should pass --no-markup
--- end quote ---

Below is my comment on the above method:

--- begin quote ---
Thank you for letting me know your alternative nice solution. But
there are so many HTML Character Entities [1-2]. How does your method
deal with all these possible situations?

[1] https://www.w3schools.com/HTML/html_entities.asp
[2] https://stackoverflow.com/questions/5068951/what-do-lt-and-gt-stand-for
--- end quote ---

Any more comments, suggestions, and alternative enhancements for fixing this bug gracefully and thoroughly will be greatly appreciated.

* https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1887252

Bit Twister

unread,
Feb 7, 2023, 9:25:47 PM2/7/23
to
>su - werner
> Any tips for further debugging?

if su - test works and su - werner failed
then some script executed by werner login is failing.

No idea why

Message about dirname and readlink aught to be fixed.

Apparently you are running some script executing those instructions that
test does not execute.

By the way, after spending years as an maintenance programmer I found it beneficial
to fix any errors I find even if I believe they have no bearing on the problem
I am trying to fix.

For your xhost problem I would need to see the xhost command. Looking through my
host xx__local.sh script I have
# grep xhost xx__local.sh
/local/bin/set_xhost +"$(hostname --fqdn)"
/local/bin/set_xhost +localhost >
xhost +local:docker

You may want to consider install/using shellcheck to check your scripts.

hongy...@gmail.com

unread,
Feb 7, 2023, 11:46:12 PM2/7/23
to
Agreed. Nice idea!

> For your xhost problem I would need to see the xhost command. Looking through my
> host xx__local.sh script I have
> # grep xhost xx__local.sh
> /local/bin/set_xhost +"$(hostname --fqdn)"
> /local/bin/set_xhost +localhost >
> xhost +local:docker

Mine is as follows:

werner@X10DAi:~/Public/repo/github.com/bash-it/custom$ ug xhost
300-run-graphical-application-as-root-in-Wayland-session.bash: if ! xhost | grep -qE '^(LOCAL:|SI:localuser:root)'; then
300-run-graphical-application-as-root-in-Wayland-session.bash: # xhost local:
300-run-graphical-application-as-root-in-Wayland-session.bash: xhost si:localuser:root > /dev/null 2>&1

> You may want to consider install/using shellcheck to check your scripts.

Thank you for your advice.

Regards,
Zhao

hongy...@gmail.com

unread,
Feb 8, 2023, 1:27:17 AM2/8/23
to
I wonder whether there is a similar but targeting for generating detail debug messages of startup scripts (profile, .bashrc, etc...).

Regards,
Zhao

Bit Twister

unread,
Feb 17, 2023, 7:00:53 AM2/17/23
to
For debugging a script I use
script -c "bash -x script_to_debug_here" a.log

As for login scripts which I need to see when something changed modified
/etc/profile to check if $HOME/debug is executable and if so run it.
Test is before/after each login script. Example snippet from /etc/profile
follows"


for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
if [ -r "$i" ]; then
if [ "${-#*i}" != "$-" ]; then
if [ -x $HOME/debug ] ; then
. $HOME/debug "starting $i "
fi
. "$i"
if [ -x $HOME/debug ] ; then
. $HOME/debug "finished $i "
fi
else
if [ -x $HOME/debug ] ; then
. $HOME/debug "starting $i "
fi
. "$i" >/dev/null
if [ -x $HOME/debug ] ; then
. $HOME/debug "finished $i "
fi
fi
fi
done

hongy...@gmail.com

unread,
Feb 25, 2023, 10:41:06 AM2/25/23
to
Nice idea. Thank you very much again. I will try to follow your prompts for further inspection and testing.

Regards,
Zhao

Jalen Q

unread,
Mar 7, 2023, 3:53:40 PM3/7/23
to
feeeeresrsdrdcv

Jalen Q

unread,
Apr 1, 2023, 10:43:34 PM4/1/23
to
cddffdfdfd

Jalen Q

unread,
Apr 1, 2023, 10:44:01 PM4/1/23
to
On Tuesday, March 7, 2023 at 2:53:40 PM UTC-6, Jalen Q wrote:

Jalen Q

unread,
Apr 5, 2023, 3:15:20 AM4/5/23
to
On Wednesday, January 25, 2023 at 10:28:34 PM UTC-6, hongy...@gmail.com wrote:
> Hi here,
>
> For Linux desktop login, say, Gnome, with the bash as the default shell, is there a method to save all the detailed sourced files information and the errors during the logging process?
>
> I often encounter strange phenomena and problems in login, but I don't know where they come from. Any tips will be appreciated.
>
> Regards,
> Zhaorffrfrrfrfrfrfrfrfrffrfr

Jalen Q

unread,
Apr 5, 2023, 3:16:03 AM4/5/23
to

Jalen Q

unread,
Apr 11, 2023, 11:20:10 PM4/11/23
to

Jalen Q

unread,
Apr 11, 2023, 11:20:34 PM4/11/23
to
gttttfftftftfggyygytytyttggggttggttgtgtgt66666666676ttyyyuy

Jalen Q

unread,
Apr 30, 2023, 5:15:44 PM4/30/23
to
On Wednesday, January 25, 2023 at 10:28:34 PM UTC-6, hongy...@gmail.com wrote:
> Hi here,
>
> For Linux desktop login, say, Gnome, with the bash as the default shell, is there a method to save all the detailed sourced files information and the errors during the logging process?
>
> I often encounter strange phenomena and problems in login, but I don't know where they come from. Any tips will be appreciated.
>
> Regards,
> Zhao
fffdtdfdfrrrdrdtdtttffrfrf
0 new messages