Strange behaviour [SOLVED]

If none of the more specific forums is the right place to ask

Strange behaviour [SOLVED]

Postby consufed » 2018-02-26 10:15

Debian stretch amd64 XFCE. HW System running Debian without problems for c. 3 years, apart from HDD crash 3 months ago; HDD replaced with SSD.
Since about 2 weeks I have 2 strange repeatable symptoms:
(1) To logout or shutdown, I have to perform the complete action two times: click on 'applications-logout-logout'; the two instances of logout or shutdown can be separated by any length of time, as if a latch is being set.
(2) On boot and login, .bashrc is not executed. Normally .bashrc is run when .profile is executed, so that after login, certain actions such character composing and sound settings are carried out. But .bashrc is now only executed when I open a console.
These 2 consistent faults are a minor nuisance, but are possibly indicative of a more serious problem. I cannot say if the 2 problems started at the same time or not, nor can I recall any causative specific action. Seems unlikely that the 2 symptoms are linked, but....
I played around trying to run fsck, but this was not possible - 'init 1' just freezes the system, after a some screen output. fsck is also not part of the installation image. Anyway, it seems that fsck is run during boot.
Last edited by consufed on 2018-02-26 20:00, edited 1 time in total.
consufed
 
Posts: 28
Joined: 2013-08-11 21:57

Re: Strange behaviour

Postby bw123 » 2018-02-26 10:58

consufed wrote:(2) On boot and login, .bashrc is not executed. Normally .bashrc is run when .profile is executed, so that after login, certain actions such character composing and sound settings are carried out. But .bashrc is now only executed when I open a console.


I've been confused by .profile and .bashrc myself, and noticed that ~/.profile is not read when booting to lightdm then login to plasma desktop. If I boot my fluxbox installation without a display manager all the way to login prompt and login, then .profile is read as before.

The reason I noticed is that ~/.profile is what adds ~/bin to the users path, and this situation breaks that path in any terminals opened under plasma desktop. I don't know what the answer is, or whether it's related to your problem, but it has been this way ever since I installed stretch about a yr ago.
User avatar
bw123
 
Posts: 3572
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Strange behaviour

Postby oswaldkelso » 2018-02-26 13:36

I've been confused by .profile and .bashrc myself


Your not the only one.

https://blog.flowblok.id.au/2013-02/she ... ripts.html
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
User avatar
oswaldkelso
 
Posts: 1147
Joined: 2005-07-26 23:20
Location: UK

Re: Strange behaviour

Postby Head_on_a_Stick » 2018-02-26 19:03

consufed wrote:Normally .bashrc is run when .profile is executed

That is not true, ~/.bashrc is run if you open any interactive shell whereas ~/.profile is only sourced for login shells.

confused wrote:.bashrc is not executed

What makes you think this?

What doesn't happen that you think should happen, exactly?

I don't use bash myself (mksh ftw!) but I can assure you that ~/.bashrc works exactly as expected in Debian 9 because I have been testing our BunsenLabs Helium desktop extensively recently (based on stretch) and we need ~/.bashrc to work properly.

bw123 wrote:~/.profile is not read when booting to lightdm

Use ~/.xsessionrc instead ;)
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8315
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Strange behaviour

Postby consufed » 2018-02-26 19:53

I wrote: 'Normally .bashrc is run when .profile is executed'
This statement is true by default in Debian 9.
Head_on_a_stick wrote that 'Normally .bashrc is run when .profile is executed' is not true.
Head_on_a_stick meant to write: 'Normally .bashrc is run when .profile is executed' and 'when you login' in the default installation of Debian 9.
Head_on_a_stick implied that my .bashrc is not working.
consufed
 
Posts: 28
Joined: 2013-08-11 21:57

Re: Strange behaviour

Postby Head_on_a_Stick » 2018-02-26 20:01

consufed wrote:Head_on_a_stick meant to write: 'Normally .bashrc is run when .profile is executed' and 'when you login' in the default installation of Debian 9.

No, I didn't. My statement is completely correct.

It is certainly true that the stock Debian /etc/skel/.profile sources ~/.bashrc but we cannot be sure that applies to your system until you post the content of your ~/.profile ;)

confused wrote:Head_on_a_stick implied that my .bashrc is not working.

No, I didn't.

You stated that your ~/.bashrc doesn't work, I am doubting that assertion.

What, exactly, doesn't work for you?

What do you think should happen? What actually happens?
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8315
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Strange behaviour [SOLVED]

Postby Head_on_a_Stick » 2018-02-26 20:07

Why has this thread been marked [SOLVED]?

Please share your solution with the community so that others can benefit.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8315
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Strange behaviour

Postby bw123 » 2018-02-27 03:48

Head_on_a_Stick wrote:
bw123 wrote:~/.profile is not read when booting to lightdm

Use ~/.xsessionrc instead ;)


Use .xessionrc instead of .profile to add ~/bin to path? Not sure I'd want that, what about ssh, or logins that don't start an x session?

If I use .xsessionrc to source .profile it would have potential to source .profile twice, depending on whether login or dm starts the x session. Also, what if X session is started under ssh? I really like keeping things simple and as close to defaults as possible.

This whole thing is confusing. I know most people use only one setup, but I use my computers quite a few different ways.

Head_on_a_Stick wrote:
can assure you that ~/.bashrc works exactly as expected in Debian 9 because I have been testing our BunsenLabs Helium desktop


sheesh, give me a break.
User avatar
bw123
 
Posts: 3572
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Strange behaviour

Postby Head_on_a_Stick » 2018-02-27 07:25

bw123 wrote:Use .xessionrc instead of .profile to add ~/bin to path?

I was just pointing out that if LightDM is used then ~/.xsessionrc fills the same role that ~/.profile does for a console login.

Anything that you would add to ~/.profile for a console-based login can be added to ~/.xsessionrc to produce the same effect for a login under LightDM.

sheesh, give me a break.

I wasn't talking to you :P
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8315
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable